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:
parent
5be4e0ef1a
commit
9a51709ca6
@ -2782,8 +2782,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
|
|||||||
{
|
{
|
||||||
Q_D(const QMacStyle);
|
Q_D(const QMacStyle);
|
||||||
QMacCGContext cg(p);
|
QMacCGContext cg(p);
|
||||||
QWindow *window = w && w->window() ? w->window()->windowHandle() :
|
QWindow *window = w && w->window() ? w->window()->windowHandle() : nullptr;
|
||||||
QStyleHelper::styleObjectWindow(opt->styleObject);
|
|
||||||
d->resolveCurrentNSView(window);
|
d->resolveCurrentNSView(window);
|
||||||
switch (pe) {
|
switch (pe) {
|
||||||
case PE_IndicatorArrowUp:
|
case PE_IndicatorArrowUp:
|
||||||
@ -3227,8 +3226,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
|
|||||||
{
|
{
|
||||||
Q_D(const QMacStyle);
|
Q_D(const QMacStyle);
|
||||||
QMacCGContext cg(p);
|
QMacCGContext cg(p);
|
||||||
QWindow *window = w && w->window() ? w->window()->windowHandle() :
|
QWindow *window = w && w->window() ? w->window()->windowHandle() : nullptr;
|
||||||
QStyleHelper::styleObjectWindow(opt->styleObject);
|
|
||||||
d->resolveCurrentNSView(window);
|
d->resolveCurrentNSView(window);
|
||||||
switch (ce) {
|
switch (ce) {
|
||||||
case CE_HeaderSection:
|
case CE_HeaderSection:
|
||||||
@ -4802,8 +4800,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
|
|||||||
{
|
{
|
||||||
Q_D(const QMacStyle);
|
Q_D(const QMacStyle);
|
||||||
QMacCGContext cg(p);
|
QMacCGContext cg(p);
|
||||||
QWindow *window = widget && widget->window() ? widget->window()->windowHandle() :
|
QWindow *window = widget && widget->window() ? widget->window()->windowHandle() : nullptr;
|
||||||
QStyleHelper::styleObjectWindow(opt->styleObject);
|
|
||||||
d->resolveCurrentNSView(window);
|
d->resolveCurrentNSView(window);
|
||||||
switch (cc) {
|
switch (cc) {
|
||||||
case CC_ScrollBar:
|
case CC_ScrollBar:
|
||||||
@ -5334,12 +5331,6 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
|
|||||||
d->drawToolbarButtonArrow(tb, p);
|
d->drawToolbarButtonArrow(tb, p);
|
||||||
}
|
}
|
||||||
if (tb->state & State_On) {
|
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;
|
NSView *view = window ? (NSView *)window->winId() : nil;
|
||||||
bool isKey = false;
|
bool isKey = false;
|
||||||
if (view)
|
if (view)
|
||||||
|
@ -403,14 +403,6 @@ QColor backgroundColor(const QPalette &pal, const QWidget* widget)
|
|||||||
return pal.color(QPalette::Base);
|
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)
|
WidgetSizePolicy widgetSizePolicy(const QWidget *widget, const QStyleOption *opt)
|
||||||
{
|
{
|
||||||
while (widget) {
|
while (widget) {
|
||||||
|
@ -90,7 +90,6 @@ namespace QStyleHelper
|
|||||||
Q_WIDGETS_EXPORT bool hasAncestor(QObject *obj, QAccessible::Role role);
|
Q_WIDGETS_EXPORT bool hasAncestor(QObject *obj, QAccessible::Role role);
|
||||||
#endif
|
#endif
|
||||||
Q_WIDGETS_EXPORT QColor backgroundColor(const QPalette &pal, const QWidget* widget = 0);
|
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 };
|
enum WidgetSizePolicy { SizeLarge = 0, SizeSmall = 1, SizeMini = 2, SizeDefault = -1 };
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user