TimeWidget.h
64 lines
| 1.3 KiB
| text/x-c
|
CLexer
r134 | #ifndef SCIQLOP_TIMEWIDGET_H | |||
#define SCIQLOP_TIMEWIDGET_H | ||||
#include <QWidget> | ||||
r1462 | #include <QWidgetAction> | |||
r134 | ||||
r1347 | #include <Data/DateTimeRange.h> | |||
r192 | ||||
r879 | #include <Common/spimpl.h> | |||
r1462 | namespace Ui | |||
{ | ||||
r134 | class TimeWidget; | |||
} // Ui | ||||
r1462 | ||||
class TimeWidget : public QWidget | ||||
{ | ||||
r134 | Q_OBJECT | |||
public: | ||||
r1462 | explicit TimeWidget(QWidget* parent = 0); | |||
r134 | virtual ~TimeWidget(); | |||
r1346 | void setTimeRange(DateTimeRange time); | |||
DateTimeRange timeRange() const; | ||||
r878 | ||||
r192 | signals: | |||
/// Signal emitted when the time parameters has beed updated | ||||
r1346 | void timeUpdated(DateTimeRange time); | |||
r192 | ||||
public slots: | ||||
/// slot called when time parameters update has ben requested | ||||
void onTimeUpdateRequested(); | ||||
r878 | protected: | |||
r1462 | void dragEnterEvent(QDragEnterEvent* event) override; | |||
void dragLeaveEvent(QDragLeaveEvent* event) override; | ||||
void dropEvent(QDropEvent* event) override; | ||||
r878 | ||||
r1462 | void mousePressEvent(QMouseEvent* event) override; | |||
void mouseMoveEvent(QMouseEvent* event) override; | ||||
r192 | ||||
r134 | private: | |||
r1462 | Ui::TimeWidget* ui; | |||
r879 | ||||
class TimeWidgetPrivate; | ||||
spimpl::unique_impl_ptr<TimeWidgetPrivate> impl; | ||||
r134 | }; | |||
r1462 | class TimeWidgetAction : public QWidgetAction | |||
{ | ||||
Q_OBJECT | ||||
TimeWidget* timeWidget; | ||||
public: | ||||
explicit TimeWidgetAction(QWidget* parent = 0) : QWidgetAction(parent) | ||||
{ | ||||
timeWidget = new TimeWidget(); | ||||
this->setDefaultWidget(timeWidget); | ||||
} | ||||
}; | ||||
r134 | #endif // SCIQLOP_ SQPSIDEPANE_H | |||