X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=mainwidget.hpp;h=4e29b66c44d8e1cf817b13a2e619b8ae724bd7d3;hb=217cea51bd3b77d651d485b18869355e2a91a42f;hp=e7c791fcc0eef0634f21bb4f6a0fb5efdca665ed;hpb=10b634bda8aef3f79597c1d9b06b49cd1457d715;p=yandex-traffic diff --git a/mainwidget.hpp b/mainwidget.hpp index e7c791f..4e29b66 100644 --- a/mainwidget.hpp +++ b/mainwidget.hpp @@ -3,36 +3,25 @@ #include -#include -#include +#include "settings.hpp" +#include "regions.hpp" +#include "light.hpp" -class MainWidget : public QLabel +class MainWidget : public QWidget { Q_OBJECT private: RegionsTable _regions; Settings _settings; -public: - MainWidget () - : QLabel () - { - const RegionInfo *ri; - - setAlignment(Qt::AlignCenter); -#ifdef Q_WS_MAEMO_5 - setAttribute(Qt::WA_TranslucentBackground); -#endif - ri = _regions.lookup (_settings.regions ()[0]); - - setText (_settings.regions ().join (", ") + ", " + QString (ri ? ri->name () : "")); - } + // Widgets + TrafficLight *_light; + QLabel *_label; - QSize sizeHint() const - { - return QLabel::sizeHint() + QSize (20, 0); - } +public: + MainWidget (); + QSize sizeHint () const; protected: void paintEvent(QPaintEvent *event) @@ -43,7 +32,7 @@ protected: p.drawRoundedRect(rect(), 10, 10); p.end(); - QLabel::paintEvent(event); + QWidget::paintEvent(event); } };