[Qt-qml] QtZibit: Simile-Widgets.org Exhibit runs local in QtWebKit rendering from QML/Json.
Niels Mayer
nielsmayer at gmail.com
Tue Jul 12 01:21:14 CEST 2011
Introducing http://code.google.com/p/qtzibit/ - Simile-widgets'
"Exhibit" running locally in QtWebKit, rendering arbitrary Json data
models from QML, Qt or QtMobility.
Some examples implemented in Exhibit: http://simile-widgets.org/exhibit/
With QtZibit, such apps could run locally (although the
google-map-based ones require an internet connection, the timeline,
timeplot, chart, visualizations don't). These can run "standalone" and
the associated JavaScript is loaded in from the local filesystem,
computed in QML/JavaScript/C++ or transferred from the web or local
SQL datastore. QtZibit can be used to visualize arbitrary datamodels
from JSON in QML, and in-turn, this JSON can be rendered via QtWebKit
in Exhibit. In many ways, it duplicates or complements the
"delegate"-based rendering of datamodels in Qt/QML, but uses Web-based
layouts and rendering.
For example, in
http://trunk.simile-widgets.org/exhibit/examples/polymap/medieval-mediterranean.html
, the rendered data comes from JSON elements that look like:
{"id":"15 - Madonna and Child",
"label":"15 - Madonna and Child",
"type":"Item",
"uri":"http://trunk.simile-widgets.org/exhibit/examples/polymap/item#15%20-%20Madonna%20and%20Child",
"modified":"no",
"Image":"http://lh5.ggpht.com/_eb5gxCGMANM/SZ8XlfMwLiI/AAAAAAAAAGE/SbO0e2TncR0/s144/CImabueMadonna.jpg",
"Century":"13th",
"Building+Name":"Church - Santa Trinita",
"latlng":"43.770031,11.250994",
"Medium":"gesso",
"Author":"Cimabue",
"Title":"Madonna and Child",
"City":"Florence",
"origin":"http://trunk.simile-widgets.org/exhibit/examples/polymap/medieval-mediterranean.html#15%20-%20Madonna%20and%20Child"
},
(See http://trunk.simile-widgets.org/exhibit/examples/polymap/ JSON
files visualized by these these "mashups" ; other examples at
http://trunk.simile-widgets.org/exhibit/examples/ )
The map elements in the "medieval mediterranean" example above are
rendered by extracting ".latlng" ".polyline", etc. entities from the
JSON data elements such as the one from the prior example.
<div ex:role="view"
id="the-map"
ex:viewClass="Map"
ex:center="43.76852162810477,11.252446174621582"
ex:zoom="15"
ex:latlng=".latlng"
ex:polyline=".polyline"
ex:mapHeight="600"
ex:borderWidth="7"
ex:borderOpacity="1"
ex:overviewControl="true"
ex:size="large"
>
</div>
Exhibit also has capabilities for rendering SPARQL queries, which
might be useful to combine with the existing "semantic desktop"
facilities in MeeGo/Harmattan that are based on
http://projects.gnome.org/tracker/ . One app that would be pretty cool
for would be to geolocate all phone events onto a map, or be able to
dial around & visualize all phone events on a single timeline, etc.
Or similarly, automatically render thumbnails for captured media on a
map or timeline based on tracker-extracted metadata.
Niels
http://nielsmayer.com
PS: For Harmattan ( http://swipe.nokia.com/ ) , it sure would be nice
if someone developed an Ovi Maps plugin that worked just like the
Google/OpenLayers/OpenStreetMap/VirtualEarth maps Exhibit supports
currently:
http://code.google.com/p/simile-widgets/source/browse/exhibit/trunk/src/webapp/api/extensions/map/map-extension.js
PPS: Unlike the web version, a Mobile or WebKit version of Exhibit can
call out from Exhibit back to QML and therefore allows invocation of
C++ primitives from an Exhibit UI -- Using
http://doc.qt.nokia.com/4.7/qml-webview.html#javaScriptWindowObjects-prop
... which means apps like
http://nielsmayer.com/xwiki/bin/view/Timeline/NprTimeline won't need
Flash for media playback, they'll just invoke QtMultimediaKit Audio or
Video players....
More information about the Qt-qml
mailing list