Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML StackView's model path to files problem - after push I get blank screen
Forum Updated to NodeBB v4.3 + New Features

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

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
3 Posts 3 Posters 806 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MarkoSan
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • I Offline
      I Offline
      IAmHe
      wrote on last edited by
      #2

      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?

      1 Reply Last reply
      0
      • jpnurmiJ Offline
        jpnurmiJ Offline
        jpnurmi
        wrote on last edited by
        #3

        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?

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved