PDA

View Full Version : Qt Application Top Widget



zgulser
28th March 2012, 14:34
Hi,

How can I get the top widget of my application?

ChrisW67
28th March 2012, 23:39
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().