Horizontal list of items with animated scaling of center item
-
Hi.
How can I create a horizontal list of a custom widget?
I want to use this list in mobile, so I want to scroll it with touch event.
Also I want that, the list, shows 3 Items at a time, and the center Item be bigger than the others. just exactly like hill climb racing game.
https://play.google.com/store/apps/details?id=com.fingersoft.hillclimb&hl=enHow can I achieve this? can I create animation for scaling center item size?
Also, I want to use it in a QGraphicsView element.Thanks in advance.
Excuse me for bad english :) -
Hi,
It would be easier to do with QML and Qt Quick both for animation and touch handing.
-
@MajidKamali As said by @SGaist with QML you can use
ListView
orPathView
(for circular list) -
Thanks guys.
PathView documentation has a great Example
http://doc.qt.io/qt-5/qml-qtquick-pathview.htmlBUT, can I create somthing similar with listview? because I want other Items to be outside of screen boundry
-
BUT, can I create somthing similar with listview? because I want other Items to be outside of screen boundry
Yes but
ListView
doesn't have the exact same features as that ofPathView
.
What do you mean by screen boundary ? -
I tried PathView. setting some PathLine objects with x, outside the screen width can simulate a linear horizontal listview.
but my problem is that, it cycles through items. when it reaches the last item, next item is the first one.
I want that similar to listview, when it reaches the end item, user can not swipe to next Item, it stops there, and does not show first Item next to last one. -
I want that similar to listview, when it reaches the end item, user can not swipe to next Item, it stops there, and does not show first Item next to last one.
ListView
doesn't have that feature. You have to usePathView
.