Qt 4.8.6 - Parent Window on Linux
General and Desktop
4
Posts
3
Posters
1.1k
Views
1
Watching
-
On Windows if I create 2 windows, with one being the parent of the other the child window becomes a floating window. Namely the child cannot go underneath the parent window. On my Linux box this behavior doesn't seem to work. My code is:
@
#include <QApplication>
#include <QWidget>int main(int argc, char **argv)
{
QApplication app(argc, argv);QWidget widget; widget.setWindowTitle("win1"); widget.show(); QWidget widget2; widget2.setWindowTitle("win2"); widget2.setParent(&widget, widget.windowFlags()); widget2.show();
}
@Any suggestions?
-
-
Could always do something like this for the first window:
Declare widget1 to have a member childWidget.virtual method for
@ widget1.childWidget = &widget2;@
And write out its virtual method for the focusInEvent() with something like:
@void MainWindow::focusInEvent(QFocusEvent *)
{
if (childWidget)
childWidget->raise();
}
@Can propigate the raise for all other children as well.