import QtQuick 1.1

Rectangle {
    width: 400
    height: 300
    property int viewNumber: 1
    property int viewCount: 2

    Loader {
        id: loader
        anchors.fill: parent
        source: "View" + viewNumber + ".qml";
    }

    MouseArea {
        focus: true
        anchors.fill: parent
        onClicked: {
            nextView();
        }
    }

    function nextView() {
        var i = viewNumber + 1;
        if (i > viewCount)
            viewNumber = 1;
        else
            viewNumber = i;
    }
}
