13#ifndef STREAMS_TAB_INDICATOR_H
14#define STREAMS_TAB_INDICATOR_H
43 explicit TabIndicator(QTabWidget *tabs, QWidget *page,
const QString &tooltip,
44 QObject *parent =
nullptr);
66 void poll(std::function<
bool()> running,
int interval_ms = 500);
std::function< bool()> m_running
The polled predicate.
Definition tab_indicator.h:74
void setActive(bool active)
Show or hide the dot.
Definition tab_indicator.cpp:34
TabIndicator(QTabWidget *tabs, QWidget *page, const QString &tooltip, QObject *parent=nullptr)
Add a hidden red dot to the header of a tab.
Definition tab_indicator.cpp:19
QTimer m_timer
Polling timer.
Definition tab_indicator.h:72
void poll(std::function< bool()> running, int interval_ms=500)
Follow a predicate, evaluated on the GUI thread at a fixed interval.
Definition tab_indicator.cpp:41
QLabel * m_dot
The dot, owned by the tab bar.
Definition tab_indicator.h:70