From 94fdd09199b3373bc6d6e9d9c873cd16d54184a5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 5 Sep 2019 13:53:45 +0200 Subject: Fix deprecation warnings related to qmlRegisterType() Use qmlRegisterAnonymousType() instead of qmlRegisterType(), fixing: qtquicktemplates2plugin.cpp:176:54: warning: 'int qmlRegisterType() [with T = QQuickApplicationWindowAttached]' is deprecated: Use qmlRegisterAnonymousType instead [-Wdeprecated-declarations] qtquicktemplates2plugin.cpp:176:54: warning: 'int qmlRegisterType() [with T = QQuickApplicationWindowAttached]' is deprecated: Use qmlRegisterAnonymousType instead [-Wdeprecated-declarations] Change-Id: If5788a78643ad7148c33c4515396b074d20d62ab Reviewed-by: Fabian Kosmale Reviewed-by: Ulf Hermann --- src/imports/platform/qtlabsplatformplugin.cpp | 4 +-- src/imports/templates/qtquicktemplates2plugin.cpp | 38 +++++++++++------------ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/imports/platform/qtlabsplatformplugin.cpp b/src/imports/platform/qtlabsplatformplugin.cpp index b92c1ea0..98d5dcc4 100644 --- a/src/imports/platform/qtlabsplatformplugin.cpp +++ b/src/imports/platform/qtlabsplatformplugin.cpp @@ -83,7 +83,7 @@ void QtLabsPlatformPlugin::registerTypes(const char *uri) qmlRegisterUncreatableType(uri, 1, 0, "Dialog", QQuickPlatformDialog::tr("Dialog is an abstract base class")); qmlRegisterType(uri, 1, 0, "ColorDialog"); qmlRegisterType(uri, 1, 0, "FileDialog"); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 1); qmlRegisterType(uri, 1, 0, "FolderDialog"); qmlRegisterType(uri, 1, 0, "FontDialog"); qmlRegisterType(uri, 1, 0, "MessageDialog"); @@ -107,7 +107,7 @@ void QtLabsPlatformPlugin::registerTypes(const char *uri) qRegisterMetaType(); #endif - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 1); qRegisterMetaType(); } diff --git a/src/imports/templates/qtquicktemplates2plugin.cpp b/src/imports/templates/qtquicktemplates2plugin.cpp index 73919576..e84db606 100644 --- a/src/imports/templates/qtquicktemplates2plugin.cpp +++ b/src/imports/templates/qtquicktemplates2plugin.cpp @@ -173,11 +173,11 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri) // QtQuick.Templates 2.0 (originally introduced in Qt 5.7) qmlRegisterType(uri, 2, 0, "AbstractButton"); qmlRegisterType(uri, 2, 0, "ApplicationWindow"); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 2); qmlRegisterType(uri, 2, 0, "BusyIndicator"); qmlRegisterType(uri, 2, 0, "Button"); qmlRegisterType(uri, 2, 0, "ButtonGroup"); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 2); qmlRegisterType(uri, 2, 0, "CheckBox"); qmlRegisterType(uri, 2, 0, "CheckDelegate"); qmlRegisterType(uri, 2, 0, "ComboBox"); @@ -191,7 +191,7 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri) qmlRegisterType(uri, 2, 0, "Label"); qmlRegisterType(uri, 2, 0, "Menu"); qmlRegisterType(uri, 2, 0, "MenuItem"); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 2); qmlRegisterType(uri, 2, 0, "Page"); qmlRegisterType(uri, 2, 0, "PageIndicator"); qmlRegisterType(uri, 2, 0, "Pane"); @@ -200,33 +200,33 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri) qmlRegisterType(uri, 2, 0, "RadioButton"); qmlRegisterType(uri, 2, 0, "RadioDelegate"); qmlRegisterType(uri, 2, 0, "RangeSlider"); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 2); qmlRegisterType(uri, 2, 0, "ScrollBar"); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 2); qmlRegisterType(uri, 2, 0, "ScrollIndicator"); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 2); qmlRegisterType(uri, 2, 0, "Slider"); qmlRegisterType(uri, 2, 0, "SpinBox"); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 2); qmlRegisterType(uri, 2, 0, "StackView"); - qmlRegisterType(); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 2); + qmlRegisterAnonymousType(uri, 2); qmlRegisterType(uri, 2, 0, "SwipeDelegate"); qmlRegisterType(uri, 2, 0, "SwipeView"); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 2); qmlRegisterType(uri, 2, 0, "Switch"); qmlRegisterType(uri, 2, 0, "SwitchDelegate"); qmlRegisterType(uri, 2, 0, "TabBar"); qmlRegisterType(uri, 2, 0, "TabButton"); qmlRegisterType(uri, 2, 0, "TextArea"); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 2); qmlRegisterType(uri, 2, 0, "TextField"); qmlRegisterType(uri, 2, 0, "ToolBar"); qmlRegisterType(uri, 2, 0, "ToolButton"); qmlRegisterType(uri, 2, 0, "ToolTip"); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 2); #if QT_CONFIG(quick_listview) && QT_CONFIG(quick_pathview) - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 2); qmlRegisterType(uri, 2, 0, "Tumbler"); #endif @@ -245,7 +245,7 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri) qmlRegisterType(uri, 2, 1, "Container"); qmlRegisterType(uri, 2, 1, "Dialog"); qmlRegisterType(uri, 2, 1, "DialogButtonBox"); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 2); qmlRegisterType(uri, 2, 1, "MenuSeparator"); qmlRegisterType(uri, 2, 1, "Page"); qmlRegisterType(uri, 2, 1, "Popup"); @@ -297,7 +297,7 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri) qmlRegisterType(uri, 2, 3, "Container"); qmlRegisterType(uri, 2, 3, "Dialog"); qmlRegisterType(uri, 2, 3, "DialogButtonBox"); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 2); qRegisterMetaType(); qmlRegisterType(uri, 2, 3, "Label"); qmlRegisterType(uri, 2, 3, "Menu"); @@ -305,7 +305,7 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri) qmlRegisterType(uri, 2, 3, "MenuBarItem"); qmlRegisterType(uri, 2, 3, "MenuItem"); qmlRegisterUncreatableType(uri, 2, 3, "Overlay", QStringLiteral("Overlay is only available as an attached property.")); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 2); qmlRegisterType(uri, 2, 3, "Popup"); qmlRegisterType(uri, 2, 3, "RangeSlider"); qmlRegisterType(uri, 2, 3, "ScrollBar"); @@ -341,7 +341,7 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri) qmlRegisterType(uri, 2, 5, "Label"); qmlRegisterType(uri, 2, 5, "Page"); qmlRegisterType(uri, 2, 5, "Popup"); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 2); qmlRegisterType(uri, 2, 5, "RangeSlider"); qmlRegisterType(uri, 2, 5, "Slider"); qmlRegisterType(uri, 2, 5, "SpinBox"); @@ -351,10 +351,10 @@ void QtQuickTemplates2Plugin::registerTypes(const char *uri) // QtQuick.Templates 2.13 (new types and revisions in Qt 5.13) qmlRegisterType(uri, 2, 13, "SplitView"); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 2); qmlRegisterUncreatableType(uri, 2, 13, "SplitHandle", QStringLiteral("SplitHandle is only available as an attached property.")); - qmlRegisterType(); + qmlRegisterAnonymousType(uri, 2); // QtQuick.Templates 2.14 (new types and revisions in Qt 5.14) qmlRegisterType(uri, 2, 14, "ComboBox"); -- cgit v1.2.3