diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-11-11 11:43:46 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-11-11 11:46:43 (GMT) |
commit | ad5f41c02daa0278902d0e8273c8cd34efd2d6da (patch) | |
tree | 37a811503b24b5912546db76466592b73ab59a88 | |
parent | 2d97f299f5f25888656696c6dad0924b243ce4fd (diff) | |
download | Qt-ad5f41c02daa0278902d0e8273c8cd34efd2d6da.zip Qt-ad5f41c02daa0278902d0e8273c8cd34efd2d6da.tar.gz Qt-ad5f41c02daa0278902d0e8273c8cd34efd2d6da.tar.bz2 |
Fix Font combobox: one can set the current font without it being changed
Task-number: QTBUG-5693
Reviewed-by: ogoffart
-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(); |