0
votes

I new and coming up to speed with QTQuick 2 and QML. I am trying to throw together a UI where I load a series of pages into a stackView. I have the following qml.page code snippet I'm trying to migrate to QtQuick 2.14. I got this sample from the examples in QTCreator.

import QtQuick 2.4
import QtQuick.Layouts 1.14
import QtQuick.Controls 2.14

ScrollablePage {
    id: page

    Column {
        spacing: 40
        width: parent.width

        Label {
            width: parent.width
            wrapMode: Label.Wrap
            horizontalAlignment: Qt.AlignHCenter
            text: "Some Text"
        }

        ColumnLayout {
            spacing: 20
            anchors.horizontalCenter: parent.horizontalCenter

            Button {
                text: "First"
                Layout.fillWidth: true
            }
            Button {
                id: button
                text: "Second"
                highlighted: true
                Layout.fillWidth: true
            }
            Button {
                text: "Third"
                enabled: false
                Layout.fillWidth: true
            }
        }
    }
}

I'm loading the page with the following code snippet:

I get the following error at run time:

delegate: ItemDelegate {
                width: parent.width
                text: model.title
                font.pixelSize: 20
                font.bold: true
                highlighted: ListView.isCurrentItem
                onClicked: {
                    listView.currentIndex = index
                    stackView.push("qrc:/pages/ManageCollections.qml")
                    drawer.close()
                }
            }

qrc:/gallery.qml:180:5: QML StackView: push: qrc:/pages/ManageCollections.qml:54 ScrollablePage is not a type

Can someone please help shed some light on this and/or get me pointed in the right direction as to how to solve this?

Thanks, JohnB

1

1 Answers

0
votes

OK. So it appears that ScrollablePage is NOT a supported type in QtQuick 2.14; I should be using ScrollView. It seems to be confusing to me which controls are supported/deprecated between these QtQuick releases.