You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
402 B
20 lines
402 B
|
8 years ago
|
import QtQuick 2.10
|
||
|
|
import QtQuick.Controls 2.3
|
||
|
|
|
||
|
|
ComboBox {
|
||
|
|
id: _edit
|
||
|
|
property alias inputValue: _edit.currentValue
|
||
|
|
property var currentValue: getCurrentValue()
|
||
|
|
property alias listElements: _edit.model
|
||
|
|
|
||
|
|
textRole: "name"
|
||
|
|
|
||
|
|
function getCurrentValue() {
|
||
|
|
var value = _edit.model[_edit.currentIndex].value;
|
||
|
|
if(typeof value !== "undefined")
|
||
|
|
return value;
|
||
|
|
else
|
||
|
|
return _edit.displayText;
|
||
|
|
}
|
||
|
|
}
|