// Copyright 2013, University of Freiburg, // Author: Manuel Schneider #ifndef TIMEOUTDIALOG_H #define TIMEOUTDIALOG_H #include #include namespace Ui { class TimeOutDialog; } class TimeOutDialog : public QDialog { Q_OBJECT public: TimeOutDialog(int time, QWidget *parent = nullptr); bool isActive() const { return _timer.isActive(); } bool wasCanceled() const { return _time > 0; } private: Ui::TimeOutDialog *_ui; int _time; QTimer _timer; protected: void hideEvent(QHideEvent *event) override; bool eventFilter(QObject *object, QEvent *event) override; private slots: void update(); }; #endif // TIMEOUTDIALOG_H