Resolve issue with configuration button incorrectly placed.
authorMax Lapan <max.lapan@gmail.com>
Thu, 11 Mar 2010 16:09:49 +0000 (19:09 +0300)
committerMax Lapan <max.lapan@gmail.com>
Thu, 11 Mar 2010 16:09:49 +0000 (19:09 +0300)
light.cpp
mainwidget.cpp
mainwidget.hpp

index 20b5734..61613af 100644 (file)
--- a/light.cpp
+++ b/light.cpp
@@ -10,7 +10,7 @@ TrafficLight::TrafficLight (QWidget *parent)
     : QWidget (parent)
 {
     _color = ExtendedTrafficInfo::Unknown;
-    setMinimumSize (30, 30);
+    setFixedSize (40, 40);
 }
 
 
index a9c1277..160a8c0 100644 (file)
 MainWidget::MainWidget ()
     : QWidget ()
 {
+    setMinimumSize (300, 80);
 #ifdef Q_WS_MAEMO_5
-        setAttribute(Qt::WA_TranslucentBackground);
+    setAttribute(Qt::WA_TranslucentBackground);
 #endif
-        _light = new TrafficLight (this);
-        _label = new QLabel (this);
+    _light = new TrafficLight (this);
+    _label = new QLabel (this);
 
-        QHBoxLayout *layout = new QHBoxLayout;
-        layout->addWidget (_light);
-        layout->addWidget (_label);
-        setLayout (layout);
+    QHBoxLayout *layout = new QHBoxLayout;
+    layout->addWidget (_light);
+    layout->addWidget (_label);
+    setLayout (layout);
 
-        connect (&_traffic, SIGNAL (updated ()), SLOT (trafficUpdated ()));
+    connect (&_traffic, SIGNAL (updated ()), SLOT (trafficUpdated ()));
 
-        // every 5 minutes (TODO, make option)
-        startTimer (5*60*1000);
+    // every 5 minutes (TODO, make option)
+    startTimer (5*60*1000);
 
-        // perform update just after creation
-        _traffic.update ();
+    // perform update just after creation
+    _traffic.update ();
 }
 
 
-QSize MainWidget::sizeHint() const
-{
-    return _label->sizeHint () + _light->sizeHint () + QSize (20, 0);
-}
-
 
 void MainWidget::paintEvent(QPaintEvent *event)
 {
@@ -57,6 +53,7 @@ void MainWidget::timerEvent (QTimerEvent *)
 }
 
 
+
 void MainWidget::trafficUpdated ()
 {
     ExtendedTrafficInfo info = _traffic.lookup_ext ("1");
index 0fb63a2..59aa5f2 100644 (file)
@@ -23,7 +23,6 @@ private:
 
 public:
     MainWidget ();
-    QSize sizeHint () const;
 
 protected:
     void paintEvent (QPaintEvent *event);