[Qt-qml] Views and models
Cornelius Hald
hald at icandy.de
Fri Aug 6 15:32:54 CEST 2010
Please forget my earlier post. I was just tired and confused. After
taking a short break it was clear that this scenario can be solved using
ListView and ListModel. At least if it is ok that the slides are sliding
in and out...
Which brings me to a follow up question: Is it possible to change the
behavior of the ListView in a way that I can get a cross-fade between
the current item and the next item?
Thanks!
Conny
Am 06.08.2010 13:57, schrieb Cornelius Hald:
> Hi,
>
> I´m new to QML and Qt, so please excuse my beginner questions. To get
> acquainted with QML I´m trying to do a small multi-media slide show
> thing. Basically it should show pictures with some text and play some
> audio file. A simple XML model could look like this:
>
> <slideshow>
> <slide id="1">
> <image>http://example.com/img1.jpg"</image>
> <audio>http://example.com/snd1.mp3"</audio>
> <text>Some text...</text>
> </slide>
>
> [...]
>
> <slide id="42">
> <image>http://example.com/img42.jpg"</image>
> <audio>http://example.com/snd42.mp3"</audio>
> <text>Some other text...</text>
> </slide>
>
> </slideshow>
>
> My view should have a 'previous' and a 'next' button and always show one
> picture + text + audio. Once someone clicks the 'next' button the next
> slide should be shown.
>
> Building the view was no problem and it´s working as expected, the
> problem is how to build the model for the view and how to present it to
> the view. (The view is just a .qml file, so not a view like the e.g. the
> ListView.)
>
> I´ve looked at ListModel and XmlListModel and I think they provide all I
> need on the model side. Then for the view part I looked at ListView,
> GridView and PathView, but somehow those views are made to show all
> items at once and I only want to display one item a time.
>
> Do I have to create my own *View class? If yes, do I have to do this
> with C++ or is there a way to build a custom view using only QML/JS? I
> was trying to pass a ListModel into my view just by binding properties,
> but that doesn´t seem to work.
>
> It could be that I´m missing something obvious here, if so, please tell
> me :)
>
> All pointers would be very much appreciated and if something is unclear
> I´ll provide more information.
>
> Thanks!
> Conny
> _______________________________________________
> Qt-qml mailing list
> Qt-qml at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-qml
More information about the Qt-qml
mailing list