PDA

View Full Version : Child always on top on XP



mpi
6th January 2010, 08:58
How come, in the example below, the label widget always is on top of its parent widget when running on XP? On Linux, however, the two widgets are completely independent.

The reason why I set up thing as I do, is that I want the child widget to be closed automatically when the parent widget is closed.

#include <QApplication>
#include <QLabel>


int main(int argc, char *argv[])
{
QApplication app(argc, argv);

QWidget *widget = new QWidget;
widget->show();

QLabel *label = new QLabel("Label", widget, Qt::Window);
label->show();

return app.exec();
}

aamer4yu
6th January 2010, 10:39
What if you remove the Qt::Window flag ?

mpi
6th January 2010, 18:36
Then the child widget is layout inside the parent widget. I want it to be a separate window with its own frame etc.