Allow time-limited status messages
MODIFY
src/statusmanager.h
src/statusmanager.h
#include <QObject>
#include <QString>
+#include <QTimer>
namespace Ripes {
class StatusEmitter : public QObject {
@@ -30,9 +31,17 @@ signals:
} \
\
static void setStatus(const QString& s) { get().emitter.setStatus(s); } \
+ static void setStatusTimed(const QString& s, int ms) { \
+ setStatus(s); \
+ get().m_timer.start(ms); \
+ } \
static void clearStatus() { get().emitter.clearStatus(); } \
StatusEmitter emitter; \
\
private: \
- name##StatusManager() {} \
+ name##StatusManager() { \
+ m_timer.setSingleShot(true); \
+ m_timer.connect(&m_timer, &QTimer::timeout, [this] { this->clearStatus(); }); \
+ } \
+ QTimer m_timer; \
};

Allow time-limited status messages