diff options
Diffstat (limited to 'doc/src/snippets/declarative/flickableScrollbar.qml')
-rw-r--r-- | doc/src/snippets/declarative/flickableScrollbar.qml | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/doc/src/snippets/declarative/flickableScrollbar.qml b/doc/src/snippets/declarative/flickableScrollbar.qml new file mode 100644 index 0000000..147751a --- /dev/null +++ b/doc/src/snippets/declarative/flickableScrollbar.qml @@ -0,0 +1,26 @@ +import Qt 4.7 + +//![0] +Rectangle { + width: 200; height: 200 + + Flickable { + id: flickable +//![0] + anchors.fill: parent + contentWidth: image.width; contentHeight: image.height + + Image { id: image; source: "pics/qt.png" } +//![1] + } + + Rectangle { + id: scrollbar + anchors.right: flickable.right + y: flickable.visibleArea.yPosition * flickable.height + width: 10 + height: flickable.visibleArea.heightRatio * flickable.height + color: "black" + } +} +//![1] |