[solved] edit function
-
So I have here another problem that I can't solve. Hope you can help me with this.
Let's say we have a QML file named "Xxx":
@import QtQuick 1.0
Item {
function foo() {
...some code...
}
}@And another QML file:
@Item {
Xxx {
function foo() {
...another code...
}
}@How do I combine both codes in function foo without rewriting the first one like this:
@function foo() {
...some code...
...another code...
}@ -
If you really like the name 'foo' you could also do:
Yyy.qml:
@
Item {
Xxx {
id: xxxItem
}
function foo() {
xxxItem.foo();
...another code...
}
}
@(but that would expose Yyy.foo() if Yyy is used as an item)