Tuesday, October 1, 2013

QtQuick Controls: ScrollView

Example of using ScrollView in QtQuick.Controls 1.0.

There are two Images in the window, both loaded from the same source at internet. The upper one place within a ScrollView, the bottom one is a standalone image.

QtQuick Controls: ScrollView
QtQuick Controls: ScrollView

import QtQuick 2.1
import QtQuick.Controls 1.0

Rectangle {
    width: 500
    height: 500

    //Image within ScrollView
    ScrollView{
        id: myScrollView
        anchors.top: parent.top
        width: 500
        height: 250
        Image {
            source: "http://goo.gl/ZfY4AM"
        }
    }

    //standalone Image
    Image {
        anchors.top: myScrollView.bottom
        width: 500
        height: 250
        source: "http://goo.gl/ZfY4AM"
    }
}


Related: QtQuick Controls: SplitView