Results 1 to 3 of 3

Thread: how to get main widget in QT4

  1. #1
    Join Date
    Jun 2008
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default how to get main widget in QT4

    hello,
    we can use QApplication::mainWidget() to get main widget in a application in QT3,but I can't find this function in QT4 , how can we get main widget in QT4?

    thank you!

  2. #2
    Join Date
    Mar 2008
    Posts
    27
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to get main widget in QT4

    Quote Originally Posted by cresthong View Post
    hello,
    we can use QApplication::mainWidget() to get main widget in a application in QT3,but I can't find this function in QT4 , how can we get main widget in QT4?

    thank you!
    This is not needed anymore in Qt 4.3 (It was removed in 4.3)
    See the porting notes:
    http://doc.trolltech.com/4.4/porting4.html#qapplication
    QApplication::setMainWidget() is no longer used. When all an application's windows are closed, the application will exit normally.

  3. #3
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to get main widget in QT4

    You can use QApplication::topLevelWidgets() to get a list of all widgets (hidden or no) of the Application
    A camel can go 14 days without drink,
    I can't!!!

Similar Threads

  1. accessing my main application window widget
    By jayw710 in forum Newbie
    Replies: 8
    Last Post: 15th November 2007, 19:33
  2. Background image for main window widget using css.
    By Enygma in forum Qt Programming
    Replies: 8
    Last Post: 23rd August 2007, 15:40
  3. transparent background of the main widget
    By nagpalma in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2007, 17:52
  4. Replies: 4
    Last Post: 10th March 2007, 18:01
  5. closing dialog in hidden main Widget
    By Lele in forum Qt Programming
    Replies: 3
    Last Post: 6th December 2006, 10:35

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.