qml parse property between pages
-
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 ?
-
@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.
-
@AppLee thanks it works now
-
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
-