summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorNorwegian Rock Cat <qt-info@nokia.com>2009-07-13 11:37:23 (GMT)
committerNorwegian Rock Cat <qt-info@nokia.com>2009-07-13 11:43:52 (GMT)
commit3af223d89836fbde213aa2f54d775c9cd840f693 (patch)
tree1debdf8b0beb05187110dfa35e01d207e589ba10 /src/gui/widgets
parent821c7c1486beb6d5e65bd3ac8ba74752fec37fe8 (diff)
downloadQt-3af223d89836fbde213aa2f54d775c9cd840f693.zip
Qt-3af223d89836fbde213aa2f54d775c9cd840f693.tar.gz
Qt-3af223d89836fbde213aa2f54d775c9cd840f693.tar.bz2
Fix font propagation issues with QComboBox and the popup menu.
This has always been a bit bumpy, the problem is that the popup normally has its own styling from the desktop, plus it's its own top-level and that is normally a boundary for propagation. Of course, people are surprised by this (especially when it works for editable). So, we need to be a bit better propagating the info. Also the QStyleOptionMenuItem has the correct font, but if it's set on a window, by the time it reaches the popup, its resolve mask is very weak, so it will fail to resolve at all. Setting the point size allows the font to have a bit of strength. Task-number: 257486 Reviewed-by: Jens Bache-Wiig
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/qcombobox.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/widgets/qcombobox.cpp b/src/gui/widgets/qcombobox.cpp
index 1ca878d..097f3d0 100644
--- a/src/gui/widgets/qcombobox.cpp
+++ b/src/gui/widgets/qcombobox.cpp
@@ -148,8 +148,10 @@ QStyleOptionMenuItem QComboMenuDelegate::getStyleOption(const QStyleOptionViewIt
menuOption.rect = option.rect;
// Make sure fonts set on the combo box also overrides the font for the popup menu.
- if (mCombo->testAttribute(Qt::WA_SetFont) || mCombo->testAttribute(Qt::WA_MacSmallSize)
- || mCombo->testAttribute(Qt::WA_MacMiniSize))
+ if (mCombo->testAttribute(Qt::WA_SetFont)
+ || mCombo->testAttribute(Qt::WA_MacSmallSize)
+ || mCombo->testAttribute(Qt::WA_MacMiniSize)
+ || mCombo->font() != qt_app_fonts_hash()->value("QComboBox", QFont()))
menuOption.font = mCombo->font();
else
menuOption.font = qt_app_fonts_hash()->value("QComboMenuItem", mCombo->font());