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:
parent
20d08a96c8
commit
12ae86119c
@ -3366,7 +3366,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
|
|||||||
if (const QStyleOptionToolButton *tb = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) {
|
if (const QStyleOptionToolButton *tb = qstyleoption_cast<const QStyleOptionToolButton *>(opt)) {
|
||||||
QStyleOptionToolButton myTb = *tb;
|
QStyleOptionToolButton myTb = *tb;
|
||||||
myTb.state &= ~State_AutoRaise;
|
myTb.state &= ~State_AutoRaise;
|
||||||
if (w && qobject_cast<QToolBar *>(w->parentWidget())) {
|
if (QStyleHelper::hasAncestor(opt->styleObject, QAccessible::ToolBar)) {
|
||||||
QRect cr = tb->rect;
|
QRect cr = tb->rect;
|
||||||
int shiftX = 0;
|
int shiftX = 0;
|
||||||
int shiftY = 0;
|
int shiftY = 0;
|
||||||
@ -3405,7 +3405,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
|
|||||||
if (tb->toolButtonStyle != Qt::ToolButtonIconOnly) {
|
if (tb->toolButtonStyle != Qt::ToolButtonIconOnly) {
|
||||||
needText = true;
|
needText = true;
|
||||||
if (tb->toolButtonStyle == Qt::ToolButtonTextUnderIcon) {
|
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()) {
|
if (mw && mw->unifiedTitleAndToolBarOnMac()) {
|
||||||
pr.setHeight(pixmap.size().height() / pixmap.devicePixelRatio());
|
pr.setHeight(pixmap.size().height() / pixmap.devicePixelRatio());
|
||||||
cr.adjust(0, pr.bottom() + 1, 0, 1);
|
cr.adjust(0, pr.bottom() + 1, 0, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user