forked from qt-creator/qt-creator
QmlDesigner: Fix HelperWidgets ComboBox
Task-number: QDS-926 Change-Id: I77eafbf8c66b8a384dc8786726c74c89acad58ad Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Thomas Hartmann
parent
79576601db
commit
8f9fa82880
@@ -62,9 +62,7 @@ StudioControls.ComboBox {
|
|||||||
ColorLogic {
|
ColorLogic {
|
||||||
id: colorLogic
|
id: colorLogic
|
||||||
backendValue: comboBox.backendValue
|
backendValue: comboBox.backendValue
|
||||||
onValueFromBackendChanged: {
|
onValueFromBackendChanged: invalidate()
|
||||||
invalidate();
|
|
||||||
}
|
|
||||||
|
|
||||||
function invalidate() {
|
function invalidate() {
|
||||||
|
|
||||||
@@ -74,9 +72,9 @@ StudioControls.ComboBox {
|
|||||||
block = true
|
block = true
|
||||||
|
|
||||||
if (manualMapping) {
|
if (manualMapping) {
|
||||||
valueFromBackendChanged();
|
comboBox.valueFromBackendChanged()
|
||||||
} else if (!comboBox.useInteger) {
|
} else if (!comboBox.useInteger) {
|
||||||
var enumString = comboBox.backendValue.enumeration;
|
var enumString = comboBox.backendValue.enumeration
|
||||||
|
|
||||||
if (enumString === "")
|
if (enumString === "")
|
||||||
enumString = comboBox.backendValue.value
|
enumString = comboBox.backendValue.value
|
||||||
@@ -100,24 +98,23 @@ StudioControls.ComboBox {
|
|||||||
|
|
||||||
onActivated: {
|
onActivated: {
|
||||||
if (!__isCompleted)
|
if (!__isCompleted)
|
||||||
return;
|
return
|
||||||
|
|
||||||
if (backendValue === undefined)
|
if (backendValue === undefined)
|
||||||
return;
|
return
|
||||||
|
|
||||||
if (manualMapping)
|
if (manualMapping)
|
||||||
return;
|
return
|
||||||
|
|
||||||
if (!comboBox.useInteger) {
|
if (!comboBox.useInteger) {
|
||||||
backendValue.setEnumeration(comboBox.scope, comboBox.currentText);
|
backendValue.setEnumeration(comboBox.scope, comboBox.currentText)
|
||||||
} else {
|
} else {
|
||||||
backendValue.value = comboBox.currentIndex;
|
backendValue.value = comboBox.currentIndex
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
colorLogic.invalidate()
|
colorLogic.invalidate()
|
||||||
__isCompleted = true;
|
__isCompleted = true
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user