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. StackView properties
QtWS25 Last Chance

StackView properties

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 1 Posters 590 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hello,

    I am a beginner with QT. I try to use Stackview component in QML.

    But I have a problem.
    I have two qml files, my first qml file contain a stackview.

    I push a new qml file with:
    stackview.push(Qt.resolvedUrl(Qt.resolvedUrl("second.qml"))
    its woking fine

    But now I want send properties to my second qml file.
    stackView.push({item : Qt.resolvedUrl("second.qml"), properties : { locale : qsTr("test param") }})

    its working but I dont know how to get "locale" parameter value in second.qml :(

    Any idea ?

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      I have find a solution,

      1.add this line in first qml file and in second qml file :

      property string locale

      1. and to push second qml file use :

      stackView.push({item : Qt.resolvedUrl("second.qml"), properties : { "locale" : "test param" }})

      1. in the second qml file the value can be read in locale property.
      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