QMacStyle: Remove handling of defunct _q_styleObjectWindow property

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 <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Tor Arne Vestbø 2018-07-18 22:29:49 +02:00
parent 5be4e0ef1a
commit 9a51709ca6
3 changed files with 3 additions and 21 deletions

View File

@ -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<QWindow *>();
NSView *view = window ? (NSView *)window->winId() : nil;
bool isKey = false;
if (view)

View File

@ -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<QWindow *>();
return 0;
}
WidgetSizePolicy widgetSizePolicy(const QWidget *widget, const QStyleOption *opt)
{
while (widget) {

View File

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