Display of regions in label
[yandex-traffic] / mainwidget.hpp
1 #ifndef __MAINWIDGET_H__
2 #define __MAINWIDGET_H__
3
4 #include <QtGui>
5
6 #include <settings.hpp>
7 #include <regions.hpp>
8
9
10 class MainWidget : public QLabel
11 {
12     Q_OBJECT
13 private:
14     RegionsTable _regions;
15     Settings _settings;
16
17 public:
18     MainWidget ()
19         : QLabel ()
20     {
21         setAlignment(Qt::AlignCenter);
22         setAttribute(Qt::WA_TranslucentBackground);
23
24         setText (_settings.regions ().join (", "));
25     }
26
27     QSize sizeHint() const
28     {
29         return 2 * QLabel::sizeHint();
30     }
31 };
32
33 #endif /* __MAINWIDGET_H__ */