Insert un placeholder or similar in a state
-
Hi, maybe this topic has already been adressed.
I have an item that i want to reuse more times. Inside there's a Loader and some States. I want to change property loader.source every time, for example i use that item three times and an item call a video, another a picture, and last a webpage. There's possible to use a placeholder or similar to obtain that target?callObject.qml ... Item{ .... Loader{ id:loader1 ...} states[ State { id:state1 PropertyChanges { target: loader1;source: SOME PLACEHOLDER; } main.qml ... callObject{ id:call1 SOMEPLACEHOLDER:"video.qml" } callObject{ id:call2 SOMEPLACEHOLDER:"webpage.qml" } callObject{ id:call3 SOMEPLACEHOLDER:"image.qml" }
-
Hi, maybe this topic has already been adressed.
I have an item that i want to reuse more times. Inside there's a Loader and some States. I want to change property loader.source every time, for example i use that item three times and an item call a video, another a picture, and last a webpage. There's possible to use a placeholder or similar to obtain that target?callObject.qml ... Item{ .... Loader{ id:loader1 ...} states[ State { id:state1 PropertyChanges { target: loader1;source: SOME PLACEHOLDER; } main.qml ... callObject{ id:call1 SOMEPLACEHOLDER:"video.qml" } callObject{ id:call2 SOMEPLACEHOLDER:"webpage.qml" } callObject{ id:call3 SOMEPLACEHOLDER:"image.qml" }
-
@Polly hi
You can simply add a property into CallObject.qml//CallObject.qml Item { property url page : ""
//main.qml CallObject{ page: Qt.resolvedUrl("Page1.qml") }