summaryrefslogtreecommitdiffstats
path: root/examples/xmlpatterns/trafficinfo
diff options
context:
space:
mode:
Diffstat (limited to 'examples/xmlpatterns/trafficinfo')
-rw-r--r--examples/xmlpatterns/trafficinfo/mainwindow.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/xmlpatterns/trafficinfo/mainwindow.cpp b/examples/xmlpatterns/trafficinfo/mainwindow.cpp
index 47c51c9..c797373 100644
--- a/examples/xmlpatterns/trafficinfo/mainwindow.cpp
+++ b/examples/xmlpatterns/trafficinfo/mainwindow.cpp
@@ -69,16 +69,15 @@ MainWindow::MainWindow()
setWindowTitle(tr("Traffic Info Oslo"));
- QTimer *timer = new QTimer(this);
- connect(timer, SIGNAL(timeout()), this, SLOT(updateTimeInformation()));
- timer->start(1000*60*5);
-
const QSettings settings("Qt Software", "trafficinfo");
m_station = StationInformation(settings.value("stationId", "03012130").toString(),
settings.value("stationName", "Nydalen [T-bane] (OSL)").toString());
m_lines = settings.value("lines", QStringList()).toStringList();
- updateTimeInformation();
+ QTimer *timer = new QTimer(this);
+ connect(timer, SIGNAL(timeout()), this, SLOT(updateTimeInformation()));
+ timer->start(1000*60*5);
+ QMetaObject::invokeMethod(this, SLOT(updateTimeInformation()), Qt::QueuedConnection);
}
MainWindow::~MainWindow()