Results 1 to 2 of 2

Thread: Qt Application Top Widget

  1. #1
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Qt Application Top Widget

    Hi,

    How can I get the top widget of my application?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qt Application Top Widget

    That depends on what you mean by "top widget". Any widget without a parent widget is a top-level widget or window. In a simple application there is only one such widget and it is generally created on the stack of your main() function. From an arbitrary widget you can call QWidget::window() to get the window that contains the widget... but this may not be the only window in the application. You can get a list of all top-level widgets in your application using QApplication::topLevelWidgets().

Similar Threads

  1. Replies: 22
    Last Post: 14th October 2010, 17:44
  2. add .ui file with custom widget in application
    By stella1016 in forum Qt Programming
    Replies: 10
    Last Post: 19th November 2009, 09:25
  3. Reparenting widget to Win32 application
    By RThaden in forum Qt Programming
    Replies: 0
    Last Post: 23rd February 2009, 18:21
  4. Invoking QT Docking widget from MFC MDI application
    By Vikram in forum Qt Programming
    Replies: 1
    Last Post: 7th July 2007, 18:26
  5. Replies: 1
    Last Post: 14th June 2006, 14:36

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.