diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-13 23:05:26 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-13 23:05:26 (GMT) |
commit | a5e9e86a6daddde6fb906cbf09bf562e50b17698 (patch) | |
tree | 18e1fbc22574ae2168500349a04f758d91a37c8e /examples/declarative/scrollbar/display.qml | |
parent | c46c06d363b7c90fecd84e7ef333ffa449f1d71c (diff) | |
parent | a15c2d6ba9c2da1c709fbb23d0c07ad51450d93e (diff) | |
download | Qt-a5e9e86a6daddde6fb906cbf09bf562e50b17698.zip Qt-a5e9e86a6daddde6fb906cbf09bf562e50b17698.tar.gz Qt-a5e9e86a6daddde6fb906cbf09bf562e50b17698.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: (26 commits)
Remove warning on ASCII cast
Fix compilation on Solaris, AIX and HP-UX.
Speed up borderimage test.
Exclude webview examples when compiled without webview
Fix test
Use SRCDIR to make examples test work with shadow builds.
Example fixes
Improve efficiency of model dataChanged.
Optimize some autotests
Fix test (run with -qws on QWS).
Stabilize behaviors test.
Struct -> class because class is better.
Move effect property where it should be.
Tweak tests to run in parallel
Network-related test fails on the rare occasion
Fix code style in examples
Make demo code more consistent with example code in terms of variable
Fix score from previous change
Doc improvements
Fix example code style
...
Diffstat (limited to 'examples/declarative/scrollbar/display.qml')
-rw-r--r-- | examples/declarative/scrollbar/display.qml | 48 |
1 files changed, 22 insertions, 26 deletions
diff --git a/examples/declarative/scrollbar/display.qml b/examples/declarative/scrollbar/display.qml index 421cb7f..cb1da16 100644 --- a/examples/declarative/scrollbar/display.qml +++ b/examples/declarative/scrollbar/display.qml @@ -3,56 +3,52 @@ import Qt 4.7 Rectangle { width: 640 height: 480 + // Create a flickable to view a large image. Flickable { id: view anchors.fill: parent + contentWidth: picture.width + contentHeight: picture.height + Image { id: picture source: "pics/niagara_falls.jpg" asynchronous: true } - contentWidth: picture.width - contentHeight: picture.height + // Only show the scrollbars when the view is moving. - states: [ - State { - name: "ShowBars" - when: view.moving - PropertyChanges { target: verticalScrollBar; opacity: 1 } - PropertyChanges { target: horizontalScrollBar; opacity: 1 } - } - ] - transitions: [ - Transition { - from: "*" - to: "*" - NumberAnimation { - properties: "opacity" - duration: 400 - } - } - ] + states: State { + name: "ShowBars" + when: view.moving + PropertyChanges { target: verticalScrollBar; opacity: 1 } + PropertyChanges { target: horizontalScrollBar; opacity: 1 } + } + + transitions: Transition { + from: "*"; to: "*" + NumberAnimation { properties: "opacity"; duration: 400 } + } } + // Attach scrollbars to the right and bottom edges of the view. ScrollBar { id: verticalScrollBar + width: 12; height: view.height-12 + anchors.right: view.right opacity: 0 orientation: "Vertical" position: view.visibleArea.yPosition pageSize: view.visibleArea.heightRatio - width: 12 - height: view.height-12 - anchors.right: view.right } + ScrollBar { id: horizontalScrollBar + width: view.width-12; height: 12 + anchors.bottom: view.bottom opacity: 0 orientation: "Horizontal" position: view.visibleArea.xPosition pageSize: view.visibleArea.widthRatio - height: 12 - width: view.width-12 - anchors.bottom: view.bottom } } |