source: src/gui/daynavigatorwidget.h @ 83020cd

qt5
Last change on this file since 83020cd was 5992909, checked in by pavelpa <pavelpa@…>, 12 years ago

day navigator widget changes

  • changed from Horizontal to Vertical
  • Property mode set to 100644
File size: 1.7 KB
Line 
1#ifndef DAYNAVIGATORWIDGET_H
2#define DAYNAVIGATORWIDGET_H
3
4#include "ui_daynavigatorwidget.h"
5#include <QObject>
6#include <QDate>
7
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
54class DayNavigatorWidget : public QWidget, private Ui::DayNavigatorWidget
55{
56    Q_OBJECT
57    public:
58        DayNavigatorWidget(QWidget *aParent = NULL);
59        ~DayNavigatorWidget() {}
60        void setDates(const QDate &aStartDate, const QDate &aEndDate);
61        QDate getCurrentDate();
62    protected:
63        void paintEvent(QPaintEvent *);
64    private slots:
65        void prevDayButtonClicked();
66        void nextDayButtonClicked();
67    signals:
68        void dateChanged(const QDate &aDate);
69    private:
70        QDate mStartDate;
71        QDate mEndDate;
72        QDate mCurDate;
73        QFontMetrics *mFontMetrics;
74};
75
76#endif /* DAYNAVIGATORWIDGET_H */
77
Note: See TracBrowser for help on using the repository browser.