Skip to content

Commit 4d83ff3

Browse files
committed
QtPropertyBrowser: Respond to each change of text in QtLineEditFactory
I've extended this editor to allow adding a QCompleter to the line edit, but when changing the value via the QCompleter only the 'textChanged' and not the 'textEdited' signal is emitted. 'blockSignals' is now used to avoid this signal when applying a change of property value, like for all other editors. Change-Id: I1668dd45ad2e2bc651777b97cb143d1525eb5bd0 Reviewed-by: Jarek Kobus <[email protected]>
1 parent e7c410b commit 4d83ff3

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

qtpropertybrowser/src/qteditorfactory.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -968,8 +968,11 @@ void QtLineEditFactoryPrivate::slotPropertyChanged(QtProperty *property,
968968
QListIterator<QLineEdit *> itEditor( m_createdEditors[property]);
969969
while (itEditor.hasNext()) {
970970
QLineEdit *editor = itEditor.next();
971-
if (editor->text() != value)
971+
if (editor->text() != value) {
972+
editor->blockSignals(true);
972973
editor->setText(value);
974+
editor->blockSignals(false);
975+
}
973976
}
974977
}
975978

@@ -1117,7 +1120,7 @@ QWidget *QtLineEditFactory::createEditor(QtStringPropertyManager *manager,
11171120
}
11181121
editor->setText(manager->value(property));
11191122

1120-
connect(editor, SIGNAL(textEdited(const QString &)),
1123+
connect(editor, SIGNAL(textChanged(const QString &)),
11211124
this, SLOT(slotSetValue(const QString &)));
11221125
connect(editor, SIGNAL(destroyed(QObject *)),
11231126
this, SLOT(slotEditorDestroyed(QObject *)));

0 commit comments

Comments
 (0)