summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles/qmacstyle_mac.mm
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-10-21 14:06:37 +0200
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-10-22 16:19:40 +0200
commit024f595d111ddb20d00436001e06fa83f61ff904 (patch)
tree70ba12d97345b9db7bbb68d6b1cb73c845dcb80b /src/widgets/styles/qmacstyle_mac.mm
parent4c144d006d96989c133575c3f6edb0b53d5670ca (diff)
Build with -no-accessibility on OS X
This build will have broken tool button style. I also do not see a reason why someone would purposefully leave behind people that could otherwise use their applications. The build with this flag will be completely unsupported as configure states. Task-number: QTBUG-32551 Change-Id: Ie33269a49ecc10258c9f8611542f7cf99a698bb5 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Diffstat (limited to 'src/widgets/styles/qmacstyle_mac.mm')
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 090716f7f9..ff0f51ee13 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -3078,8 +3078,11 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
break;
case SH_ScrollBar_Transient:
if ((qobject_cast<const QScrollBar *>(w) && w->parent() &&
- qobject_cast<QAbstractScrollArea*>(w->parent()->parent())) ||
- (opt && QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ScrollBar))) {
+ qobject_cast<QAbstractScrollArea*>(w->parent()->parent()))
+#ifndef QT_NO_ACCESSIBILITY
+ || (opt && QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ScrollBar))
+#endif
+ ) {
ret = QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (ret)
@@ -3725,6 +3728,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
if (const QStyleOptionToolButton *tb = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) {
QStyleOptionToolButton myTb = *tb;
myTb.state &= ~State_AutoRaise;
+#ifndef QT_NO_ACCESSIBILITY
if (QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ToolBar)) {
QRect cr = tb->rect;
int shiftX = 0;
@@ -3821,6 +3825,9 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
} else {
QCommonStyle::drawControl(ce, &myTb, p, w);
}
+#else
+ Q_UNUSED(tb)
+#endif
}
break;
case CE_ToolBoxTabShape:
@@ -5983,7 +5990,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
case CC_ToolButton:
if (const QStyleOptionToolButton *tb
= qstyleoption_cast<const QStyleOptionToolButton *>(opt)) {
-
+#ifndef QT_NO_ACCESSIBILITY
if (QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ToolBar)) {
if (tb->subControls & SC_ToolButtonMenu) {
QStyleOption arrowOpt(0);
@@ -6118,6 +6125,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
label.rect = buttonRect.adjusted(fw, fw, -fw, -fw);
proxy()->drawControl(CE_ToolButtonLabel, &label, p, widget);
}
+#endif
}
break;
case CC_Dial:
@@ -6597,7 +6605,11 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op
break;
case CC_ToolButton:
ret = QCommonStyle::subControlRect(cc, opt, sc, widget);
- if (sc == SC_ToolButtonMenu && !QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ToolBar)) {
+ if (sc == SC_ToolButtonMenu
+#ifndef QT_NO_ACCESSIBILITY
+ && !QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ToolBar)
+#endif
+ ) {
ret.adjust(-1, 0, 0, 0);
}
break;