javascript - How to get base class of item in QML? -
javascript - How to get base class of item in QML? -
is there way item class in qml
? know objectname
, id
etc. looks bit unusual , not comfortable. need:
combobox { id: combobox } textfield { id: textfield } function getvalue(item) { switch(item.???) { //what property can utilize here? case 'combobox': homecoming item.model.get(item.currentindex).value; case 'textfield': homecoming item.text; } }
using objectname
described in lots of articles on net might ambiguous , excessive, example:
combobox { id: combobox objectname: "combobox" } textfield { id: textfield objectname: "combobox" /// oops!! } function getvalue(item) { switch(item.objectname) { case 'combobox': homecoming item.model.get(item.currentindex).value; case 'textfield': homecoming item.text; } }
no, can done c++.
javascript qt qml qtquick2
Comments
Post a Comment