Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

QML Dial example

Loading...

Sign in or sign up now!
29,922
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on May 12, 2009

An example of how property bindings with mechanics like springs can improve the user experience of even simple controls, using Qt's declarative Qt Modeling Language (QML).

http://labs.qt.nokia.com/page/Projects/Graphics/Kinetic/DeclarativeUI

Note the way the needle bounces a little as if on a real spring. Different Follow parameters will make it feel full of oil, or whatever other physical feel.

http://qt.nokia.com

  • likes, 4 dislikes

Link to this comment:

Share to:

Uploader Comments (QtStudios)

  • So could you have something like a shower dial, where there's a lot of friction, and you need to move the cursor a lot, but then it breaks down and turns way further than you expected?

    that would suck.

  • In the Dial QML there is a little piece of code that gives that behavior:

    rotation: Follow { spring: 1.4  damping: .15 source: Math.min(Math.max(-130, value*2.2 - 130), 133) }

    If you get rid of the "spring" and "damping" lines, then the needle will follow the set point exactly.

    In fact, if you download the Windows demo (or build from source), you can change the QML yourself. No recompile needed.

see all

All Comments (6)

Sign In or Sign Up now to post a comment!
  • Qt guys have a thing for gauges. Since trolltech i see that in a lot of examples.

  • beautiful.

  • lol I was just joking about how shower faucets are hard to turn without going past where you want.

    I think QML is a good idea, but I'm not a GUI developer, so I don't get much of a chance to use Qt :(

Loading...
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more