Update line edits upon combo box change
[agianapa.git] / qt / leleja / mytabreportdialog.h
blob101e18fa67a1a3204ec9f5de95a01fd74428f733
1 #ifndef MYTABREPORTDIALOG_H
2 #define MYTABREPORTDIALOG_H
4 #include <iostream>
5 #include <QDialog>
6 #include <QPixmap>
8 #include "ui_tabReportDialog.h"
10 #include "myrank.h"
12 #define MONTHS 0
13 #define WEEKS 1
14 #define DAYS 2
15 #define HOURS 3
16 #define MINUTES 4
17 #define SECONDS 5
19 class MyTabReportDialog : public QDialog, public Ui::tabReportDialog
21 Q_OBJECT
23 public:
24 MyTabReportDialog(QWidget *parent = 0);
25 ~MyTabReportDialog();
27 void setDaysLeft(unsigned int daysleft);
28 void setDaysOff(unsigned int daysOff);
29 void setDaysTotal(unsigned int totaldays);
31 void setRank(MyRank rank);
33 public slots:
34 void redrawContent(void) {
35 std::cout << "mytabreportdialog::redrawContent()\n";
37 // Draw graphics in pixmaps
38 drawPixmaps();
39 pixmapChanged = true;
41 // Update line edits
42 updateLineEdits();
45 private slots:
46 void updateLineEdits(void);
48 protected:
49 void paintEvent(QPaintEvent *event);
50 void resizeEvent(QResizeEvent *event);
52 private:
53 void drawMyLegend(QPainter *painter);
54 void drawMyPie(QPainter *painter);
55 void drawMyRank(QPainter *painter);
56 void drawPixmaps(void);
58 // Off screen image representation that can be used as a paint device
59 QPixmap m_piePixmap;
60 QPixmap m_rankPixmap;
62 // Holds information regarding the rank (mark, name, etc)
63 MyRank m_rank;
65 // Indicates whether the pixmaps have changed since the last time they were drawn
66 bool pixmapChanged;
68 // Holds the rank image
69 QImage m_image;
71 // The various days parameters
72 unsigned int m_daysLeft;
73 unsigned int m_daysOff;
74 unsigned int m_totalDays;
77 unsigned int getTime(unsigned int nDays, int toWhat);
79 #endif // MYTABREPORTDIALOG_H