PDA

View Full Version : how to get main widget in QT4



cresthong
3rd June 2008, 06:24
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!

profoX
3rd June 2008, 08:05
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.

mcosta
3rd June 2008, 09:08
You can use QApplication::topLevelWidgets() to get a list of all widgets (hidden or no) of the Application