linux.x86.linphone/Linphone/view/Item/Settings/ComboSetting.qml
2024-07-25 08:34:11 +00:00

29 lines
644 B
QML

import QtQuick
import QtQuick.Controls.Material
import QtQuick.Layouts
import Linphone
import 'qrc:/Linphone/view/Tool/utils.js' as Utils
ComboBox {
id: comboBox
Layout.preferredHeight: 49 * DefaultStyle.dp
property string propertyName
property var propertyOwner
property alias entries: comboBox.model
oneLine: true
currentIndex: Utils.findIndex(model, function (entry) {
return entry === propertyOwner[propertyName]
})
onCurrentTextChanged: {
binding.when = currentText != propertyOwner[propertyName]
}
Binding {
id: binding
target: propertyOwner
property: propertyName
value: comboBox.currentText
when: false
}
}