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>
This commit is contained in:
Gabriel de Dietrich 2013-05-29 17:42:30 +02:00 committed by The Qt Project
parent 20d08a96c8
commit 12ae86119c

View File

@ -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);