Remove deprecated ApplicationAttribute enum values
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ø <tor.arne.vestbo@qt.io>
This commit is contained in:
parent
5d32552cf4
commit
cc54685b8d
@ -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,
|
||||
|
@ -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
|
||||
*/
|
||||
|
||||
|
@ -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)) {
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user