diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-11-11 11:43:46 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-11-13 12:39:54 (GMT) |
commit | d46726a2ac1cebe60a8d4a4eb9f6ae45b64b4bab (patch) | |
tree | 64fda999817ffd219b5a89cd5dbb390c7dc44e3b | |
parent | 0c272bd1be9fce0a74b8087b37897aebe6fd7e20 (diff) | |
download | Qt-d46726a2ac1cebe60a8d4a4eb9f6ae45b64b4bab.zip Qt-d46726a2ac1cebe60a8d4a4eb9f6ae45b64b4bab.tar.gz Qt-d46726a2ac1cebe60a8d4a4eb9f6ae45b64b4bab.tar.bz2 |
Fix Font combobox: one can set the current font without it being changed
Task-number: QTBUG-5693
Reviewed-by: ogoffart
(cherry picked from commit ad5f41c02daa0278902d0e8273c8cd34efd2d6da)
-rw-r--r-- | src/gui/widgets/qfontcombobox.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/widgets/qfontcombobox.cpp b/src/gui/widgets/qfontcombobox.cpp index 806db59..a66657d 100644 --- a/src/gui/widgets/qfontcombobox.cpp +++ b/src/gui/widgets/qfontcombobox.cpp @@ -247,7 +247,14 @@ void QFontComboBoxPrivate::_q_updateModel() } list = result; + //we need to block the signals so that the model doesn't emit reset + //this prevents the current index from changing + //it will be updated just after this + ///TODO: we should finda way to avoid blocking signals and have a real update of the model + const bool old = m->blockSignals(true); m->setStringList(list); + m->blockSignals(old); + if (list.isEmpty()) { if (currentFont != QFont()) { currentFont = QFont(); |