QML Scrolling Digits: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
(No difference)

Revision as of 16:34, 14 January 2015

English Български

How to create scrolling digits component

Here is one way to easily create a scrolling digits component.

Code

First we create a component for digits:

Digit.qml

The component is just a Rectangle with gradient. In its center we place a PathView and set clipping to true, so only the selected digit will be visible.

Than we create the ScrollingDigits component:

ScrollingDigits.qml

We add two properties to Row: number and positions . number contains the number we want to display and positions is the number of digits we want.

Example

main.qml

Categories: