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. Getting "QML StackView: push: nothing to push" after trying to push a url to stack view
Forum Update on Monday, May 27th 2025

Getting "QML StackView: push: nothing to push" after trying to push a url to stack view

Scheduled Pinned Locked Moved Solved QML and Qt Quick
qmlstackviewpush
5 Posts 3 Posters 7.7k Views
  • 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.
  • A Offline
    A Offline
    Amir5121
    wrote on 23 Jan 2017, 04:49 last edited by Amir5121
    #1

    I'm trying to push a QML via it's url to a stackView and i am getting

    QML StackView: push: nothing to push
    

    the same happens when i try to push a component via it's id on the StackView here is my code:

    profilePic.onClicked: {
    stackView.push({item:"qrc:/Profile.qml", properties:{user_info:user_data} })
    console.log(user_data["id"]) 
    }
    
    

    and Profile.qml has a Flickable as the root parent if it matters.

    What am i missing? I'm new to Qt.

    1 Reply Last reply
    1
    • A Offline
      A Offline
      Amir5121
      wrote on 23 Jan 2017, 07:24 last edited by Amir5121
      #4
      stackView.push(["qrc:/Profile.qml", {user_info:user_data}] )
      

      Solved my issue.. i suppose my issue is a bug..

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dheerendra
        Qt Champions 2022
        wrote on 23 Jan 2017, 04:57 last edited by
        #2

        See if u can convert profile.qml to URL by qt.resolvedurl and then pass to item while pushing

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply
        4
        • A Offline
          A Offline
          Amir5121
          wrote on 23 Jan 2017, 05:20 last edited by Amir5121
          #3

          Nope.. still getting

          QML StackView: push: nothing to push
          
          stackView.push({item:Qt.resolvedUrl(":/Profile.qml"), properties:{user_info:user_data} })
          
          1 Reply Last reply
          0
          • A Offline
            A Offline
            Amir5121
            wrote on 23 Jan 2017, 07:24 last edited by Amir5121
            #4
            stackView.push(["qrc:/Profile.qml", {user_info:user_data}] )
            

            Solved my issue.. i suppose my issue is a bug..

            1 Reply Last reply
            0
            • S Offline
              S Offline
              stcorp
              wrote on 25 Jan 2017, 12:47 last edited by
              #5

              Are you using QtQuick Controls 1 or QtQuick Controls 2?

              If QtQuick Control 2, do the following:

              stackView.push("qrc:/Profile.qml", {user_info: user_data})
              

              For Controls 1:

              stackView.push({item: "qrc:/Profile.qml", properties: {user_info: user_data}})
              

              I think you may be using Controls 2, and the original command you used was for Controls 1. Your solution worked because it is a correct way to use the push function for Controls 2 (although having it as a list isn't necessary since you're only pushing one item)

              See the difference between the push function for Controls 1 and Controls 2 in the documentation:
              http://doc.qt.io/qt-5/qml-qtquick-controls-stackview.html#push-method (Controls 1)
              http://doc.qt.io/qt-5/qml-qtquick-controls2-stackview.html#push-method (Controls 2)

              1 Reply Last reply
              0

              1/5

              23 Jan 2017, 04:49

              • Login

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