flicking things

Zack Rusin zack at kde.org
Fri Feb 19 04:52:56 CET 2010


not since working on "stroking" have i seen a functionality with so much 
"email subject" potential as "flicking".

i got a little bored with hacking on drivers all the time so i've been hackin 
on some bling lately and i realized that at least this one thing might be 
useful for you folks so i extracted it. flicking things became almost mandatory 
on those small touch screens so it makes sense to have a class that allows you 
to make arbitrary widgets flickable. i wrote a version of it and then i decided 
that it doesn't match qml semantics and instead of trying to replicate the qml 
semantics i'd just port the qmlgraphicsflickable code to just operate on 
qgraphicswidget's without qml dependency. which is what i did. code is here:
http://ktown.kde.org/~zrusin/x.tar.bz2

along with an example that makes qgraphicswebview flickable. the code can 
obviously be used to make any plasma widget flickable.

one thing i absolutely /hate/ is that the code uses qmltimeline which i had to 
pull out of qml. qmltimeline is what you get if you're a heavy drinker with a 
nasty c++ template fetish. in general i'm not a fan of qml code, it's very un-
qt like and instead of reusing/fixing the code in qt it tends to reimplement 
everything including the kitchen sink (it's almost like the people who were 
hacking on it hated qt ;) ) but in this case i didn't see a more pragmatic 
solution - reimplementing everything and then making it match what qml does 
functionality wise just didn't seem very useful. then again plasma does have 
more folks actively maintaining code.

anyway, the code is there, it works (there's a bug where dynamic resizing of 
the viewport is not reflected, i'll fix that over the weekend, unless someone 
beats me to it of course :) ) and despite the qml code ugliness should allow 
you to play with some mobile ui ideas a bit.

drunken master


More information about the Plasma-devel mailing list