summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-02-18 16:14:52 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-02-18 16:14:52 +0100
commitf4900d340a4c620b56871995741696d28e53c167 (patch)
tree66d4ed6e4e8012e8a534717e87bf15cf8a992652 /src/widgets/styles
parent7c33ae6a7bbbd42ce70acf77aa55c1bc2a23c8ec (diff)
parent843de37bca944110fdf3aab161d680e3845d2dd2 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/widgets/styles/qmacstyle_mac.mm Change-Id: If8326db9e7da3cbf45dbf7475fdff9915c7723b1
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm3
-rw-r--r--src/widgets/styles/qstylehelper.cpp12
-rw-r--r--src/widgets/styles/qstylehelper_p.h2
3 files changed, 6 insertions, 11 deletions
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 085bf627aa..00356b7468 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -2705,7 +2705,8 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
ret = false;
break;
case SH_ScrollBar_Transient:
- if (qobject_cast<const QScrollBar *>(w) ||
+ if ((qobject_cast<const QScrollBar *>(w) && w->parent() &&
+ qobject_cast<QAbstractScrollArea*>(w->parent()->parent())) ||
(opt && QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ScrollBar))) {
ret = QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7;
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp
index 6d8a3ce0c3..75c74e4a88 100644
--- a/src/widgets/styles/qstylehelper.cpp
+++ b/src/widgets/styles/qstylehelper.cpp
@@ -86,17 +86,13 @@ qreal dpiScaled(qreal value)
#endif
}
+#ifndef QT_NO_ACCESSIBILITY
bool isInstanceOf(QObject *obj, QAccessible::Role role)
{
bool match = false;
-#ifndef QT_NO_ACCESSIBILITY
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(obj);
match = iface && iface->role() == role;
delete iface;
-#else
- Q_UNUSED(obj)
- Q_UNUSED(role)
-#endif // QT_NO_ACCESSIBILITY
return match;
}
@@ -104,19 +100,15 @@ bool isInstanceOf(QObject *obj, QAccessible::Role role)
bool hasAncestor(QObject *obj, QAccessible::Role role)
{
bool found = false;
-#ifndef QT_NO_ACCESSIBILITY
QObject *parent = obj ? obj->parent() : 0;
while (parent && !found) {
if (isInstanceOf(parent, role))
found = true;
parent = parent->parent();
}
-#else
- Q_UNUSED(obj)
- Q_UNUSED(role)
-#endif // QT_NO_ACCESSIBILITY
return found;
}
+#endif // QT_NO_ACCESSIBILITY
#ifndef QT_NO_DIAL
diff --git a/src/widgets/styles/qstylehelper_p.h b/src/widgets/styles/qstylehelper_p.h
index 41f823def7..01772e765c 100644
--- a/src/widgets/styles/qstylehelper_p.h
+++ b/src/widgets/styles/qstylehelper_p.h
@@ -82,8 +82,10 @@ namespace QStyleHelper
void drawBorderPixmap(const QPixmap &pixmap, QPainter *painter, const QRect &rect,
int left = 0, int top = 0, int right = 0,
int bottom = 0);
+#ifndef QT_NO_ACCESSIBILITY
bool isInstanceOf(QObject *obj, QAccessible::Role role);
bool hasAncestor(QObject *obj, QAccessible::Role role);
+#endif
}