From 9a51709ca6871a83afe58d26283eda63454b5214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 18 Jul 2018 22:29:49 +0200 Subject: [PATCH] QMacStyle: Remove handling of defunct _q_styleObjectWindow property MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was supposed to be used in Qt Quick Controls 1, for the desktop style, but the followup patches in QQC1 never landed, and QQC1 is now deprecated. Change-Id: Iceefd523fc02a9e48b986dc33bb13a41804dd199 Reviewed-by: Timur Pocheptsov Reviewed-by: Tor Arne Vestbø --- src/plugins/styles/mac/qmacstyle_mac.mm | 15 +++------------ src/widgets/styles/qstylehelper.cpp | 8 -------- src/widgets/styles/qstylehelper_p.h | 1 - 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index 204b8433aa..9d5cc15a4f 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -2782,8 +2782,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai { Q_D(const QMacStyle); QMacCGContext cg(p); - QWindow *window = w && w->window() ? w->window()->windowHandle() : - QStyleHelper::styleObjectWindow(opt->styleObject); + QWindow *window = w && w->window() ? w->window()->windowHandle() : nullptr; d->resolveCurrentNSView(window); switch (pe) { case PE_IndicatorArrowUp: @@ -3227,8 +3226,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter { Q_D(const QMacStyle); QMacCGContext cg(p); - QWindow *window = w && w->window() ? w->window()->windowHandle() : - QStyleHelper::styleObjectWindow(opt->styleObject); + QWindow *window = w && w->window() ? w->window()->windowHandle() : nullptr; d->resolveCurrentNSView(window); switch (ce) { case CE_HeaderSection: @@ -4802,8 +4800,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex { Q_D(const QMacStyle); QMacCGContext cg(p); - QWindow *window = widget && widget->window() ? widget->window()->windowHandle() : - QStyleHelper::styleObjectWindow(opt->styleObject); + QWindow *window = widget && widget->window() ? widget->window()->windowHandle() : nullptr; d->resolveCurrentNSView(window); switch (cc) { case CC_ScrollBar: @@ -5334,12 +5331,6 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex d->drawToolbarButtonArrow(tb, p); } if (tb->state & State_On) { - QWindow *window = 0; - if (widget && widget->window()) - window = widget->window()->windowHandle(); - else if (opt->styleObject) - window = opt->styleObject->property("_q_styleObjectWindow").value(); - NSView *view = window ? (NSView *)window->winId() : nil; bool isKey = false; if (view) diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp index 8679d96eda..0b910d46df 100644 --- a/src/widgets/styles/qstylehelper.cpp +++ b/src/widgets/styles/qstylehelper.cpp @@ -403,14 +403,6 @@ QColor backgroundColor(const QPalette &pal, const QWidget* widget) return pal.color(QPalette::Base); } -QWindow *styleObjectWindow(QObject *so) -{ - if (so) - return so->property("_q_styleObjectWindow").value(); - - return 0; -} - WidgetSizePolicy widgetSizePolicy(const QWidget *widget, const QStyleOption *opt) { while (widget) { diff --git a/src/widgets/styles/qstylehelper_p.h b/src/widgets/styles/qstylehelper_p.h index 260860bf4d..d79dfe4288 100644 --- a/src/widgets/styles/qstylehelper_p.h +++ b/src/widgets/styles/qstylehelper_p.h @@ -90,7 +90,6 @@ namespace QStyleHelper Q_WIDGETS_EXPORT bool hasAncestor(QObject *obj, QAccessible::Role role); #endif Q_WIDGETS_EXPORT QColor backgroundColor(const QPalette &pal, const QWidget* widget = 0); - Q_WIDGETS_EXPORT QWindow *styleObjectWindow(QObject *so); enum WidgetSizePolicy { SizeLarge = 0, SizeSmall = 1, SizeMini = 2, SizeDefault = -1 };