UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    qml parse property between pages

    Scheduled Pinned Locked Moved App Development
    5 Posts 4 Posters 448 Views 1 Watching
    Loading More Posts
    • 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.
      • 0 Offline
        007fred50
        last edited by 007fred50

        Hej

        How can i Parse proberty between pages? in QML (PageStack)

        property string vUser: "fredy"
        

        I trry to (import "variables/varis.qml" as varis) but then i get this error here:

        file:///usr/lib/x86_64-linux-gnu/qt5/qml/Ubuntu/Components/1.3/PageStack.qml:231:9: QML PageWrapper: (file:///home/fredy/Desktop/ubuntutouch/login2/build/all/app/install/qml/home.qml:6:33: Invalid import qualifier ID
            import "variables/varis.qml" as varis
                                            ^)
        

        Can you help me ?

        AppLeeA T 2 Replies Last reply Reply Quote 0
        • AppLeeA Offline
          AppLee @007fred50
          last edited by

          @007fred50
          You don't have to import anything.

          The property of the parent object is herited, so you can use it directly.

          You are limited in depth IIRC, but it's easy for a child to redefine the property at its level.

          0 1 Reply Last reply Reply Quote 0
          • 0 Offline
            007fred50 @AppLee
            last edited by

            @AppLee thanks it works now

            1 Reply Last reply Reply Quote 1
            • CiberSheepC Offline
              CiberSheep
              last edited by

              If you have the property defined in the page, you can add a value to it as:

              https://gitlab.com/cibersheep/gelek-vanilla/-/blob/master/qml/Main.qml#L169

              Another planet, another time, another universe!

              1 Reply Last reply Reply Quote 0
              • T Offline
                theBest3000 @007fred50
                last edited by

                @007fred50 Try writing

                import "variables/varis.qml" as Varis
                

                So the first letter is uppercase.

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post