diff options
author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2013-05-29 17:42:30 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-30 17:01:16 +0200 |
commit | 12ae86119cf389dab368bbc8a9d49b29b0b155cd (patch) | |
tree | b65cdcbc339a3de7341145e953af8bbc1bd8b3d2 /src | |
parent | 20d08a96c8240a9fda1a359d98be42f69ed9592e (diff) |
Mac style: Remove yet another reference to widgets
Change-Id: I545cfe22c6307864cdb18093a37e09a8ad042347
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/styles/qmacstyle_mac.mm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index b7f39d45dd..a8fba4fb68 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -3366,7 +3366,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; - if (w && qobject_cast<QToolBar *>(w->parentWidget())) { + if (QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ToolBar)) { QRect cr = tb->rect; int shiftX = 0; int shiftY = 0; @@ -3405,7 +3405,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter if (tb->toolButtonStyle != Qt::ToolButtonIconOnly) { needText = true; if (tb->toolButtonStyle == Qt::ToolButtonTextUnderIcon) { - QMainWindow *mw = qobject_cast<QMainWindow *>(w->window()); + QMainWindow *mw = w ? qobject_cast<QMainWindow *>(w->window()) : 0; if (mw && mw->unifiedTitleAndToolBarOnMac()) { pr.setHeight(pixmap.size().height() / pixmap.devicePixelRatio()); cr.adjust(0, pr.bottom() + 1, 0, 1); |