From cc54685b8d0610a682983418bd771e4d6f5f338b Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Fri, 17 Apr 2020 16:48:51 +0200 Subject: Remove deprecated ApplicationAttribute enum values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the declaration, leave them in as comments so that the gaps in the numbering of the values doesn't create confusion. Change-Id: I92ff299416896c471e7c7d80b988cd4642b6b756 Reviewed-by: Tor Arne Vestbø --- src/corelib/global/qnamespace.h | 13 +++--------- src/corelib/global/qnamespace.qdoc | 20 ------------------- src/plugins/platforms/cocoa/qcocoaintegration.mm | 1 - src/widgets/kernel/qwidget.cpp | 7 ------- .../kernel/qapplication/tst_qapplication.cpp | 23 +++++++++++----------- 5 files changed, 14 insertions(+), 50 deletions(-) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 87e5153964..0dd48ef7fe 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -491,24 +491,17 @@ namespace Qt { enum ApplicationAttribute { - AA_ImmediateWidgetCreation = 0, -#if QT_DEPRECATED_SINCE(5, 14) - AA_MSWindowsUseDirect3DByDefault Q_DECL_ENUMERATOR_DEPRECATED = 1, -#endif + // AA_ImmediateWidgetCreation = 0, + // AA_MSWindowsUseDirect3DByDefault = 1, AA_DontShowIconsInMenus = 2, AA_NativeWindows = 3, AA_DontCreateNativeWidgetSiblings = 4, AA_PluginApplication = 5, -#if QT_DEPRECATED_SINCE(5, 13) // ### Qt 6: remove me - AA_MacPluginApplication Q_DECL_ENUMERATOR_DEPRECATED = AA_PluginApplication, -#endif AA_DontUseNativeMenuBar = 6, AA_MacDontSwapCtrlAndMeta = 7, AA_Use96Dpi = 8, AA_DisableNativeVirtualKeyboard = 9, -#if QT_DEPRECATED_SINCE(5, 14) - AA_X11InitThreads Q_DECL_ENUMERATOR_DEPRECATED = 10, -#endif + // AA_X11InitThreads = 10, AA_SynthesizeTouchForUnhandledMouseEvents = 11, AA_SynthesizeMouseForUnhandledTouchEvents = 12, AA_UseHighDpiPixmaps = 13, diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 73c3f8c483..d19366dabb 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -293,26 +293,6 @@ Currently supported on the Windows platform only. This value was added in 5.15 - The following values are deprecated or obsolete: - - \value AA_ImmediateWidgetCreation This attribute is no longer fully - supported in Qt 5. It ensures that widgets are created - as soon as they are constructed. By default, resources for - widgets are allocated on demand to improve efficiency and - minimize resource usage. Setting or clearing this attribute - affects widgets constructed after the change. Setting it - tells Qt to create toplevel windows immediately. - Therefore, if it is important to minimize resource - consumption, do not set this attribute. - - \value AA_MacPluginApplication This attribute has been deprecated. - Use AA_PluginApplication instead. - - \value AA_MSWindowsUseDirect3DByDefault This value is obsolete and - has no effect. - - \value AA_X11InitThreads This value is obsolete and has no effect. - \omitvalue AA_AttributeCount */ diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index f273fa9d75..e0dd103fbc 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -189,7 +189,6 @@ QCocoaIntegration::QCocoaIntegration(const QStringList ¶mList) } } - // ### For AA_MacPluginApplication we don't want to load the menu nib. // Qt 4 also does not set the application delegate, so that behavior // is matched here. if (!QCoreApplication::testAttribute(Qt::AA_PluginApplication)) { diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index d7cb7e2f10..e4e09c17be 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1063,9 +1063,6 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f) if (++QWidgetPrivate::instanceCounter > QWidgetPrivate::maxInstances) QWidgetPrivate::maxInstances = QWidgetPrivate::instanceCounter; - if (QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation)) // ### fixme: Qt 6: Remove AA_ImmediateWidgetCreation. - q->create(); - QEvent e(QEvent::Create); QCoreApplication::sendEvent(q, &e); QCoreApplication::postEvent(q, new QEvent(QEvent::PolishRequest)); @@ -10411,10 +10408,6 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f) oldPaintManager->moveStaticWidgets(this); } - // ### fixme: Qt 6: Remove AA_ImmediateWidgetCreation. - if (QApplicationPrivate::testAttribute(Qt::AA_ImmediateWidgetCreation) && !testAttribute(Qt::WA_WState_Created)) - create(); - d->reparentFocusWidgets(oldtlw); setAttribute(Qt::WA_Resized, resized); diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp index 59ea12ce70..245e107170 100644 --- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp +++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp @@ -1843,25 +1843,24 @@ void tst_QApplication::setAttribute() { int argc = 1; QApplication app(argc, &argv0); - QVERIFY(!QApplication::testAttribute(Qt::AA_ImmediateWidgetCreation)); + QVERIFY(!QApplication::testAttribute(Qt::AA_NativeWindows)); QWidget *w = new QWidget; - QVERIFY(!w->testAttribute(Qt::WA_WState_Created)); + w->show(); // trigger creation; + QVERIFY(!w->testAttribute(Qt::WA_NativeWindow)); delete w; - QApplication::setAttribute(Qt::AA_ImmediateWidgetCreation); - QVERIFY(QApplication::testAttribute(Qt::AA_ImmediateWidgetCreation)); + QApplication::setAttribute(Qt::AA_NativeWindows); + QVERIFY(QApplication::testAttribute(Qt::AA_NativeWindows)); w = new QWidget; - QVERIFY(w->testAttribute(Qt::WA_WState_Created)); - QWidget *w2 = new QWidget(w); - w2->setParent(nullptr); - QVERIFY(w2->testAttribute(Qt::WA_WState_Created)); + w->show(); // trigger creation + QVERIFY(w->testAttribute(Qt::WA_NativeWindow)); delete w; - delete w2; - QApplication::setAttribute(Qt::AA_ImmediateWidgetCreation, false); - QVERIFY(!QApplication::testAttribute(Qt::AA_ImmediateWidgetCreation)); + QApplication::setAttribute(Qt::AA_NativeWindows, false); + QVERIFY(!QApplication::testAttribute(Qt::AA_NativeWindows)); w = new QWidget; - QVERIFY(!w->testAttribute(Qt::WA_WState_Created)); + w->show(); // trigger creation; + QVERIFY(!w->testAttribute(Qt::WA_NativeWindow)); delete w; } -- cgit v1.2.3