How to get default value in qml?
-
Hi,
I have a qml component:
In file XYZ.qml: Item { x: 10 ... }
Now in other file I would like to set his x-value:
In file ABC.qml: Item { XYZ { x: someCondition ? 20 : defaultValue } }
In this example defaultValue is 10. How can I do this? Here of course I know that x-value is 10, so I can write:
x: someCondition ? 20 : 10
but sometimes I don't know.
-
Hi,
I have a qml component:
In file XYZ.qml: Item { x: 10 ... }
Now in other file I would like to set his x-value:
In file ABC.qml: Item { XYZ { x: someCondition ? 20 : defaultValue } }
In this example defaultValue is 10. How can I do this? Here of course I know that x-value is 10, so I can write:
x: someCondition ? 20 : 10
but sometimes I don't know.