Results 1 to 3 of 3

Thread: Child always on top on XP

  1. #1
    Join Date
    Apr 2009
    Posts
    32
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Child always on top on XP

    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>

    Qt Code:
    1. int main(int argc, char *argv[])
    2. {
    3. QApplication app(argc, argv);
    4.  
    5. QWidget *widget = new QWidget;
    6. widget->show();
    7.  
    8. QLabel *label = new QLabel("Label", widget, Qt::Window);
    9. label->show();
    10.  
    11. return app.exec();
    12. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Child always on top on XP

    What if you remove the Qt::Window flag ?

  3. #3
    Join Date
    Apr 2009
    Posts
    32
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Child always on top on XP

    Then the child widget is layout inside the parent widget. I want it to be a separate window with its own frame etc.

Similar Threads

  1. How to be notified when a child changes?
    By mooreaa in forum Qt Programming
    Replies: 1
    Last Post: 3rd July 2008, 13:04
  2. add child a QTreeWidget
    By mattia in forum Newbie
    Replies: 1
    Last Post: 22nd February 2008, 23:37
  3. Best way to add child windows
    By Mrdata in forum Qt Programming
    Replies: 5
    Last Post: 3rd February 2007, 13:55
  4. Child Windows
    By s_a_white in forum Newbie
    Replies: 1
    Last Post: 16th July 2006, 00:20
  5. active child
    By evgenM in forum Qt Programming
    Replies: 3
    Last Post: 22nd May 2006, 12:16

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.