[969a840] | 1 | #ifndef DAYNAVIGATORWIDGET_H |
---|
| 2 | #define DAYNAVIGATORWIDGET_H |
---|
| 3 | |
---|
| 4 | #include "ui_daynavigatorwidget.h" |
---|
| 5 | #include <QObject> |
---|
| 6 | #include <QDate> |
---|
| 7 | |
---|
[5992909] | 8 | /*#include <QPainter>*/ |
---|
| 9 | /*#include <QLabel>*/ |
---|
| 10 | |
---|
| 11 | /*class QFontMetrics;*/ |
---|
| 12 | |
---|
| 13 | /*class VerticalLabel : public QWidget*/ |
---|
| 14 | /*{*/ |
---|
| 15 | |
---|
| 16 | /*public:*/ |
---|
| 17 | /*VerticalLabel(QWidget *aParent = NULL)*/ |
---|
| 18 | /*: QWidget(aParent)*/ |
---|
| 19 | /*, mText("")*/ |
---|
| 20 | /*{*/ |
---|
| 21 | /*mFont = QLabel().font();*/ |
---|
| 22 | /*} */ |
---|
| 23 | |
---|
| 24 | /*void paintEvent(QPaintEvent *)*/ |
---|
| 25 | /*{ */ |
---|
| 26 | /*QPainter p(this);*/ |
---|
| 27 | /*drawRotatedText(&p, 270, width()/2, height()/2, mText);*/ |
---|
| 28 | /*} */ |
---|
| 29 | |
---|
| 30 | /*void drawRotatedText(QPainter *aPainter, qreal aDegrees, int x, int y, const QString &aText)*/ |
---|
| 31 | /*{ */ |
---|
| 32 | |
---|
| 33 | /*aPainter->save();*/ |
---|
| 34 | /*aPainter->setFont(mFont);*/ |
---|
| 35 | /*aPainter->translate(x, y); */ |
---|
| 36 | /*aPainter->rotate(aDegrees);*/ |
---|
| 37 | /*QFontMetrics fm(mFont);*/ |
---|
| 38 | /*QRect r = fm.boundingRect(aText);*/ |
---|
| 39 | /*aPainter->drawText(-r.width()/2, fm.descent()/2, aText);*/ |
---|
| 40 | /*aPainter->restore();*/ |
---|
| 41 | /*} */ |
---|
| 42 | |
---|
| 43 | /*void setText(const QString &aText)*/ |
---|
| 44 | /*{*/ |
---|
| 45 | /*mText = aText;*/ |
---|
| 46 | /*update();*/ |
---|
| 47 | /*}*/ |
---|
| 48 | |
---|
| 49 | /*private:*/ |
---|
| 50 | /*QString mText;*/ |
---|
| 51 | /*QFont mFont;*/ |
---|
| 52 | /*};*/ |
---|
| 53 | |
---|
[f6300c7] | 54 | class DayNavigatorWidget : public QWidget, private Ui::DayNavigatorWidget |
---|
[969a840] | 55 | { |
---|
| 56 | Q_OBJECT |
---|
| 57 | public: |
---|
| 58 | DayNavigatorWidget(QWidget *aParent = NULL); |
---|
| 59 | ~DayNavigatorWidget() {} |
---|
| 60 | void setDates(const QDate &aStartDate, const QDate &aEndDate); |
---|
[5992909] | 61 | protected: |
---|
| 62 | void paintEvent(QPaintEvent *); |
---|
[969a840] | 63 | private slots: |
---|
| 64 | void prevDayButtonClicked(); |
---|
| 65 | void nextDayButtonClicked(); |
---|
| 66 | signals: |
---|
| 67 | void dateChanged(const QDate &aDate); |
---|
| 68 | private: |
---|
| 69 | QDate mStartDate; |
---|
| 70 | QDate mEndDate; |
---|
| 71 | QDate mCurDate; |
---|
[5992909] | 72 | QFontMetrics *mFontMetrics; |
---|
[969a840] | 73 | }; |
---|
| 74 | |
---|
| 75 | #endif /* DAYNAVIGATORWIDGET_H */ |
---|
| 76 | |
---|