Hi,
I have the same problem. I have an Item that must stay always on top edge of an viewport. I want try whit a widget on my viewport but I have some problem.
void CMCanvasManager
::createMenu(QWidget *canvas_parent
) {
QWidget *w
=new QWidget(canvas_parent, Qt
::Popup | Qt
::WindowStaysOnTopHint);
w->setGeometry(100, 100, 100, 100);
w->setMaximumSize(100,100);
w->setMinimumSize(100,100);
w->setFocusPolicy(Qt::NoFocus);
w->show();
}
void CMCanvasManager::createMenu(QWidget *canvas_parent)
{
QWidget *w=new QWidget(canvas_parent, Qt::Popup | Qt::WindowStaysOnTopHint);
w->setGeometry(100, 100, 100, 100);
w->setMaximumSize(100,100);
w->setMinimumSize(100,100);
w->setFocusPolicy(Qt::NoFocus);
w->show();
}
To copy to clipboard, switch view to plain text mode
Whit the code above I expect that my popup widget stay at 100,100 respect the parent geometry, but this does not happen. The widget appear at 100,100 respect the desktop, olso if I click on viewport the popup disappear. Any advice?
Bookmarks