How to determine if tabed QDockWidget is an active tab

There are several dock widgets in my Qt 5.1 application. I want to know which tab is currently active (regardless of whether it currently has focus), but I don’t understand how to get this information programmatically.

I tried QWidget :: IsVisible (), QWidget :: IsVisibleTo () and examined the list returned by QMainWindow :: tabifiedDockWidgets (), which excludes the widget sent as a parameter, and therefore cannot provide an order.

Any ideas?

+4
source share
1 answer

You can check if part of the dock widget is visible using the following code:

bool really_visible = !widget->visibleRegion().isEmpty();

, , -- .

+6

Source: https://habr.com/ru/post/1530445/


All Articles