Fix groupboxes for desktop components on mac
authorJens Bache-Wiig <jens.bache-wiig@digia.com>
Thu, 1 Nov 2012 11:47:40 +0000 (12:47 +0100)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 1 Nov 2012 19:17:57 +0000 (20:17 +0100)
The logic was a bit odd as it would check if the groupbox had a
font set and then override it anyway. Since we anyway want the
fallback to be used for components we just make sure that the fallback
is to use the same code path.

Change-Id: Ic5071b43cda76e2bb7356a6f71cc8458c4e8bf27
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
src/widgets/styles/qmacstyle_mac.mm

index 522d43d..b0a43c5 100644 (file)
@@ -5399,7 +5399,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
             QStyleOptionGroupBox groupBox(*gb);
             groupBox.state |= QStyle::State_Mini; // Force mini-sized checkbox to go with small-sized label
             bool didModifySubControls = false;
-            if ((widget && !widget->testAttribute(Qt::WA_SetFont))
+            if ((!widget || !widget->testAttribute(Qt::WA_SetFont))
                     && QApplication::desktopSettingsAware()) {
                 groupBox.subControls = groupBox.subControls & ~SC_GroupBoxLabel;
                 didModifySubControls = true;