Is it possible to emit a signal from an QML ListModel element?
-
My idea is to define a ListModel with some Elements, like this.
@
ListModel {
id: listListElement {
name: "test"
signal run
}ListElement {
name: "second"
signal stop
}ListElement {
...
}
}@Then I want to connect the Signal run with a State and start the Signal in Javascript with (for Example)
@emit ListView.currentItem.signal@
Thank you for your help.
-
-
Hello,
What I proposed will work if all your signals have the same name (which is no your case).
You will have to find what kind of signals are present for currentItem and call the signal you need to call.
I don't know if there is a means to get the list of signals of an object at runtime from QML.
Good luck!