Skip to content
  • 1 Votes
    5 Posts
    7k Views
    S

    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)