qt - Creating a Mechanical Counter look with QtQuick/QML -
i'am trying replicate of mechanical counter qtquick. (image below http://en.wikipedia.org/wiki/counter#mechanical_counters) counter value floating point number , 8.5 might show counter wheel showing bottom of 8 , top of 9.
for individual wheels thought of displaying shifting excerpts of graphic strips. next graphics shall illustrate this. qml component should display digits in bluish rectangle, rest (blurred in image below) shall not visible.
my question best approach build view , update counter display?
have littlecanvas
element each digit, draw excerpt of graphic strip it? use little flickable
whole graphic strip kid , pan graphic strip? don't want counter view mutable user, i.e. should not take mouse or touch events pan view. any other approaches?
if want items wrap around, utilize several pathview
s, models literal 10
:
model: 10
you can set interactive
false
each view disable user interaction.
each view in row
. set preferredhighlightbegin/end properties both 0.5
, current item centred.
then, enclose of within item
width equal implicitwidth
of row, , height equal whatever height want (probably height of 1 item delegate). set clip
true
hide items shouldn't visible. can centre contents (row) in item.
qt qml qtquick2
No comments:
Post a Comment