QML StackView's model path to files problem - after push I get blank screen



  • I have following StackView:

    StackView
        {
            id: ueMainSettingsMenuView
    
            anchors.fill: parent
            anchors.margins: 4
    
            focus: true
    
            clip: true
    
            initialItem: Item
            {
                width: parent.width
                height: parent.height
    
                GridView
                {
                    id: ueMainSettingsGridView
    
                    anchors.fill: parent
    
                    model: ueMainSettingsMenuModel
    
                    cellWidth: 256
                    cellHeight: 256
    
                    delegate: UeMainSettingsMenuDelegate
                    {
                        ueWidth: ueMainSettingsGridView.cellWidth-16
                        ueHeight: ueMainSettingsGridView.cellHeight-16
    
                        ueImage: image
                        ueText: name
    
                        onUeSignalClicked:
                        {
                            ueMainSettingsMenuView.push(Qt.resolvedUrl(page));
                        }   // onUeSignalClicked
                    }   // delegate:
                }   // GridView
            }   // initialItem
        }   // StackView
    

    which consists of GridLayout with following model:

    import QtQuick 2.7
    
    ListModel
    {
        ListElement
        {
            name: qsTr("Display Settings")
            page: "content/ueDisplaySettings.qml"
            image: "qrc:///icons/ueDisplaySettings.png"
        }
    
        ListElement
        {
            name: qsTr("Network Settings")
            page: "content/ueNetworkSettings.qml"
            image: "qrc:///icons/ueNetworkSettings.png"
        }
    }   // ListModel
    

    Now, when I choose Display Settings from GridView, I get push transition, however, pushed screen is empty - I think destinantion qml file to be shown cannot be found. How do I format page component (path to file), so StackView will be able to find it?



  • I was about to post about a similar issue. In my case, when running a Qt Quick application, the main screen comes up black. Interestingly, I've seen this only on Windows Server 2008, R2 and non-R2. The problem does not occur on Win7, Win10, or Windows Server 2012.

    What OS are you using? Have you tried any of the others I've listed?



  • Is there no debug output? Check the Application Output pane in Qt Creator. It should say File not found if that is the case.

    What does console.log(Qt.resolvedUrl(page)) output? Does it exist? Is "content/ueDispl aySettings.qml" in resources? Is the file where Qt.resolvedUrl() is called in resources?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.