From 30517ab710944941b869cbfcece9dd722bdb77cd Mon Sep 17 00:00:00 2001 From: Thomas Hartmann <Thomas.Hartmann@nokia.com> Date: Thu, 25 Mar 2010 16:54:51 +0100 Subject: [PATCH] QmlDesigner.propertyEditor: avoid binding loops --- .../qmldesigner/propertyeditor/Qt/FontComboBox.qml | 14 ++++++++++---- .../qmldesigner/propertyeditor/Qt/FontGroupBox.qml | 14 +++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/FontComboBox.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/FontComboBox.qml index d1395293ab6..cd2cc4b82a1 100644 --- a/share/qtcreator/qmldesigner/propertyeditor/Qt/FontComboBox.qml +++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/FontComboBox.qml @@ -56,10 +56,16 @@ QWidget { layout: HorizontalLayout { QFontComboBox { - id: fontSelector - // currentFont.family:backendValues.font_family.value - // onCurrentFontChanged: if (backendValues.font_family.value != currentFont.family) - // backendValues.font_family.value = currentFont.family; + id: fontSelector + + currentFont.family: backendValue.value + property var fontFamily: currentFont.family + onFontFamilyChanged: { + if (backendValue === undefined) + return; + if (backendValue.value != currentFont.family) + backendValue.value = currentFont.family; + } } } } diff --git a/share/qtcreator/qmldesigner/propertyeditor/Qt/FontGroupBox.qml b/share/qtcreator/qmldesigner/propertyeditor/Qt/FontGroupBox.qml index ddc16d996f6..8f7a86c96ab 100644 --- a/share/qtcreator/qmldesigner/propertyeditor/Qt/FontGroupBox.qml +++ b/share/qtcreator/qmldesigner/propertyeditor/Qt/FontGroupBox.qml @@ -14,13 +14,9 @@ GroupBox { Label { text: qsTr("Font") } + FontComboBox { - id: fontSelector - currentFont.family:backendValues.font_family.value - onCurrentFontChanged: if (backendValues.font_family.value != currentFont.family) - backendValues.font_family.value = currentFont.family; - - backendValue:backendValues.font_family + backendValue: backendValues.font_family baseStateFlag: isBaseState } } @@ -66,11 +62,11 @@ GroupBox { ComboBox { baseStateFlag:isBaseState - backendValue: backendValues.style + backendValue: (backendValues.style === undefined) ? dummyBackendValue : backendValues.style items : { ["Normal", "Outline", "Raised", "Sunken"] } - currentText: backendValues.style.value; + currentText: backendValue.value; onItemsChanged: { - currentText = backendValues.style.value; + currentText = backendValue.value; } } } -- GitLab