summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/qfontcombobox.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-07-07 08:01:21 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-07-07 08:01:21 (GMT)
commit4e31ccad1cfb9df0d624d5c39d7906a75b4fc2d0 (patch)
tree46395e49ab1c372ca5af7fc3bc4e8ea7595a013c /src/gui/widgets/qfontcombobox.cpp
parent134dad4c6a996045397098498eaf0afca889b6f9 (diff)
downloadQt-4e31ccad1cfb9df0d624d5c39d7906a75b4fc2d0.zip
Qt-4e31ccad1cfb9df0d624d5c39d7906a75b4fc2d0.tar.gz
Qt-4e31ccad1cfb9df0d624d5c39d7906a75b4fc2d0.tar.bz2
QFontComboBox: used to emit currentFontChanged twice when setting it.
Setting the current font would change the current font and then it would try to select the right model index and get the font only from the text of the combobox. This was resetting the point size of the font, resulting in emitting the signal a second time. In the case of the user, it was also causing signals to be called in a loop. Task-number: 229731
Diffstat (limited to 'src/gui/widgets/qfontcombobox.cpp')
-rw-r--r--src/gui/widgets/qfontcombobox.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/widgets/qfontcombobox.cpp b/src/gui/widgets/qfontcombobox.cpp
index 9660399..f87ccd3 100644
--- a/src/gui/widgets/qfontcombobox.cpp
+++ b/src/gui/widgets/qfontcombobox.cpp
@@ -263,7 +263,7 @@ void QFontComboBoxPrivate::_q_currentChanged(const QString &text)
{
Q_Q(QFontComboBox);
QFont newFont(text);
- if (currentFont != newFont) {
+ if (currentFont.family() != newFont.family()) {
currentFont = newFont;
emit q->currentFontChanged(currentFont);
}