I would want to know if I can determine in a Class_B who is the active or current widget of my application.
By other side, supposing my app is showing a form, any way to know the 'toplevel' parent ?
Thanks
I would want to know if I can determine in a Class_B who is the active or current widget of my application.
By other side, supposing my app is showing a form, any way to know the 'toplevel' parent ?
Thanks
If by active you mean the widget which receives user input, than you have hasFocus()
And QObject has (QWidget is derived from it so it has this too) parent() member function which returns a pointer to the parent object.
You can also have a look at QApplication::focusWidget().
Thanks to everybody
Bookmarks