Commit 9f0d5d58 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.propertyEditor: fix ComboBox.qml

parent a295ec49
......@@ -49,6 +49,18 @@ QWidget {
id: box
property var backendValue: comboBox.backendValue
onCurrentTextChanged: { backendValue.value = currentText; evaluate(); }
onItemsChanged: {
if (comboBox.backendValue.value == curentText)
return;
box.setCurrentTextSilent(comboBox.backendValue.value);
}
property var backendValueValue: comboBox.backendValue.value
onBackendValueValueChanged: {
if (comboBox.backendValue.value == curentText)
return;
box.setCurrentTextSilent(comboBox.backendValue.value);
}
ExtendedFunctionButton {
backendValue: comboBox.backendValue;
y: 3
......
......@@ -808,6 +808,18 @@ public slots:
emit currentTextChanged();
}
}
public slots:
void setCurrentTextSilent(const QString &text)
{
if (!m_itemsSet)
return;
int i = cb->findText(text);
if (i != -1) {
blockSignals(true);
cb->setCurrentIndex(i);
blockSignals(false);
}
}
signals:
void currentTextChanged();
void itemsChanged();
......@@ -817,8 +829,10 @@ private:
{
_items = list;
cb->clear();
blockSignals(true);
cb->addItems(list);
m_itemsSet = true;
blockSignals(false);
emit itemsChanged();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment