Connection tracker class finished.
[yandex-traffic] / mainwidget.hpp
index 5298de5..0fb63a2 100644 (file)
@@ -3,21 +3,34 @@
 
 #include <QtGui>
 
-class MainWidget : public QLabel
+#include "traffic.hpp"
+#include "settings.hpp"
+#include "regions.hpp"
+#include "light.hpp"
+
+
+class MainWidget : public QWidget
 {
     Q_OBJECT
+private:
+    Traffic _traffic;
+    RegionsTable _regions;
+    Settings _settings;
+
+    // Widgets
+    TrafficLight *_light;
+    QLabel *_label;
+
 public:
-    MainWidget ()
-        : QLabel (tr ("Hello, World"))
-    {
-        setAlignment(Qt::AlignCenter);
-        setAttribute(Qt::WA_TranslucentBackground);
-    }
-
-    QSize sizeHint() const
-    {
-        return 2 * QLabel::sizeHint();
-    }
+    MainWidget ();
+    QSize sizeHint () const;
+
+protected:
+    void paintEvent (QPaintEvent *event);
+    void timerEvent (QTimerEvent *event);
+
+protected slots:
+    void trafficUpdated ();
 };
 
 #endif /* __MAINWIDGET_H__ */