[Qt-interest] What's the best way to determine online status?
Arnold Krille
arnold at arnoldarts.de
Fri Oct 16 18:52:05 CEST 2009
Hi,
On Thursday 15 October 2009 23:48:25 Murphy, Sean M. wrote:
> > Why do you use two widgets? Why not use the webview for all display
> > and just show the google-maps background only when a connection is
> made?
>
> I need to show a collection of geographically located items to the user,
> allowing them to visually see the relationship between them. I also
> need to draw geographically located polygons, circles, lines, etc.
> Those items need to be scaled correctly. The sizes of these items also
> needs to be to scale. The old Qt3 widget I have does this perfectly,
> but over a blank grey background. It's QCanvas based, allowing for easy
> creation and placement of all the various items I need to put on it.
> The code for it has been tested for 10 years and works fine, with the
> exception of the lack of background imagery.
> Replacing the QCanvas widget with the QWebView/Google Maps idea seems
> like it makes sense if I'm online. But in that case, I'd be using the
> Google Maps API to draw the waypoints, polygons, circles, lines, etc.
> So I'd just be writing HTML that calls Google Maps' functions to
> correctly place them over the background imagery. In the case where I'm
> not online, but still using a QWebView class, I'd need to use a QPainter
> to correctly draw all the items in their relative positions and sizes, I
> wouldn't be using any webkit features at all. Basically I'd need to
> port my 10 year old Qt3 widget from QCanvas to QWebView.
> It seems quicker to just use my existing widget using the Qt3
> compatibility libraries as is whenever I'm not online, and use a
> QWebView with Google Maps' API when I am online, than try to port my
> widget over to a QWebView when I'm not using any webkit features at that
> point.
> I hope I'm making sense!
Yes, I fully understand this. From a perfectionist point of view I would still
advise you to port your qt3-class to a new qt4-based concept. Qt3Support isn't
going to be there forever (someday the only backward-compatibility you get is
Qt4Support:) and when you use the app on small devices (and it sounds as if
you do!), not using Qt3Support will give smaller executable / memory
footprints.
I don't really know which Qt4 class you should base on. It seems as if
QGraphicsView is following the concept of the canvas. But there might be a
better solution which could allow mixing the google-maps view from qwebview
with graphicsview and all scaled to fit.
Basically that idea is to draw your custom items by yourself all the time and
only scale the items or the map to fit when the map is available. That way you
don't have to send your data to google, have only one drawing mechanism to
support and could easily extend your app to support other maps (like
openstreetmap or marble) just by rendering different background-images...
Have fun,
Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091016/efaf57ae/attachment.bin
More information about the Qt-interest-old
mailing list