summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2009-06-11 14:47:02 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-06-16 15:13:03 (GMT)
commit920069066040a0a7f43f971c2e64117ab4c2a2df (patch)
treebe371177f5007d4c8f83111d28e31bdbf432a06d
parentba2bc36877a0cad9e64bc97fa3f19ba0752764e5 (diff)
downloadQt-920069066040a0a7f43f971c2e64117ab4c2a2df.zip
Qt-920069066040a0a7f43f971c2e64117ab4c2a2df.tar.gz
Qt-920069066040a0a7f43f971c2e64117ab4c2a2df.tar.bz2
Trafficinfo example: Asynchronous call to webservice at launch
This makes the main window shown immediatly even when the webservice of traffikanten.no cannot be reached. Does not properly fix the associated task yet, e.g. display an error message. Task-number: 254455 (cherry picked from commit 41df2299dad9041b690f28251ba6381563cd3c6b)
-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 30edab3..1d88e92 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()