Shows a red dot on the right of a tab header while something is running.
More...
#include <tab_indicator.h>
|
| | TabIndicator (QTabWidget *tabs, QWidget *page, const QString &tooltip, QObject *parent=nullptr) |
| | Add a hidden red dot to the header of a tab.
|
|
| TabIndicator (const TabIndicator &)=delete |
|
TabIndicator & | operator= (const TabIndicator &)=delete |
|
| TabIndicator (TabIndicator &&)=delete |
|
TabIndicator & | operator= (TabIndicator &&)=delete |
| void | setActive (bool active) |
| | Show or hide the dot.
|
| void | poll (std::function< bool()> running, int interval_ms=500) |
| | Follow a predicate, evaluated on the GUI thread at a fixed interval.
|
|
|
QLabel * | m_dot = nullptr |
| | The dot, owned by the tab bar.
|
|
QTimer | m_timer |
| | Polling timer.
|
|
std::function< bool()> | m_running |
| | The polled predicate.
|
Shows a red dot on the right of a tab header while something is running.
The dot is either set directly with setActive(), or follows a predicate that is polled with poll().
◆ TabIndicator()
| TabIndicator::TabIndicator |
( |
QTabWidget * | tabs, |
|
|
QWidget * | page, |
|
|
const QString & | tooltip, |
|
|
QObject * | parent = nullptr ) |
|
explicit |
Add a hidden red dot to the header of a tab.
- Parameters
-
| tabs | the tab widget holding the page |
| page | the page whose header gets the dot |
| tooltip | the tooltip of the dot |
| parent | the parent object |
◆ poll()
| void TabIndicator::poll |
( |
std::function< bool()> | running, |
|
|
int | interval_ms = 500 ) |
Follow a predicate, evaluated on the GUI thread at a fixed interval.
- Parameters
-
| running | returns true while the dot should be shown |
| interval_ms | the polling interval in milliseconds |
◆ setActive()
| void TabIndicator::setActive |
( |
bool | active | ) |
|
Show or hide the dot.
- Parameters
-
| active | true to show the dot |
The documentation for this class was generated from the following files: