Hi,
How can I get the top widget of my application?
Hi,
How can I get the top widget of my application?
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().
Bookmarks