[Qt-interest] What's the best way to determine online status?
Murphy, Sean M.
sean.murphy at gd-ais.com
Thu Oct 15 16:58:02 CEST 2009
Whoops! Forgot to put a subject!
-----Original Message-----
From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Murphy, Sean M.
Sent: Thursday, October 15, 2009 10:53 AM
To: qt-interest List
Subject: [Qt-interest] (no subject)
I'm looking for suggestions on the best way to determine if I'm
connected to the Internet from inside my application for displaying GPS
waypoints, like a hiking or biking path.
I've got two widgets, one that I wrote back in the Qt3 days that shows
the waypoints over a blank grey background, so the relative positions of
the waypoints are correct, but there is no context of where it is on the
real earth. I've got a second widget that is based on Qt4's Webkit
integration that shows the waypoints over Google Maps imagery.
The problem is that we will regularly use this application in two
networking environments, one where we're connected to a LAN that has no
path to the Internet, and one where we're on a different network that
does have connection to the Internet. So I need to decide which widget
to use based on my connectivity status. I'd like to make it as seamless
is possible to the user.
The only way I've thought of at the moment is right when I launch,
request a page from Google Maps, and set up a QNetworkReply watching for
a error signal. If I get an error, then I'll assume I'm on the LAN and
use the old Qt3 widget for the remainder of that session, if I get the
reply back successfully from Google Maps, then I'll know I'm online and
I'll use my WebKit version.
Anyone have any better ideas?
Sean
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
More information about the Qt-interest-old
mailing list