aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/imports/qtqml/.prev_CMakeLists.txt9
-rw-r--r--src/imports/qtqml/CMakeLists.txt5
-rw-r--r--src/imports/qtqml/qtqml.pro2
-rw-r--r--src/imports/qtquick2/CMakeLists.txt1
-rw-r--r--src/imports/qtquick2/plugin.cpp27
-rw-r--r--src/imports/qtquick2/qmldir2
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp21
-rw-r--r--src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.h7
-rw-r--r--src/qml/debugger/qqmldebugserviceinterfaces.cpp12
-rw-r--r--src/qml/debugger/qqmldebugserviceinterfaces_p.h5
-rw-r--r--src/quick/.prev_CMakeLists.txt3
-rw-r--r--src/quick/CMakeLists.txt2
-rw-r--r--src/quick/qtquick2.cpp25
-rw-r--r--src/quick/qtquick2_p.h67
-rw-r--r--src/quick/qtquickglobal_p.h1
-rw-r--r--src/quick/quick.pro3
-rw-r--r--src/quick/util/qquickglobal.cpp7
17 files changed, 58 insertions, 141 deletions
diff --git a/src/imports/qtqml/.prev_CMakeLists.txt b/src/imports/qtqml/.prev_CMakeLists.txt
index 4e17431218..52e6d3e1e0 100644
--- a/src/imports/qtqml/.prev_CMakeLists.txt
+++ b/src/imports/qtqml/.prev_CMakeLists.txt
@@ -1,12 +1,12 @@
# Generated from qtqml.pro.
set(module_dynamic_qml_imports
- QtQml.Models
+ QtQml.Models/auto
)
if (QT_FEATURE_qml_worker_script)
list(APPEND module_dynamic_qml_imports
- QtQml.WorkerScript
+ QtQml.WorkerScript/auto
)
endif()
@@ -21,6 +21,7 @@ qt_add_qml_module(qmlplugin
CLASSNAME QtQmlPlugin
SKIP_TYPE_REGISTRATION
IMPORTS ${module_dynamic_qml_imports}
+ PLUGIN_OPTIONAL
SOURCES
plugin.cpp
PUBLIC_LIBRARIES
@@ -30,7 +31,7 @@ qt_add_qml_module(qmlplugin
#### Keys ignored in scope 1:.:.:qtqml.pro:<TRUE>:
# CXX_MODULE = "qml"
-# DYNAMIC_QMLDIR = "module QtQml" "plugin qmlplugin" "classname QtQmlPlugin" "typeinfo plugins.qmltypes" "designersupported" "import QtQml.Models"
+# DYNAMIC_QMLDIR = "module QtQml" "optional plugin qmlplugin" "classname QtQmlPlugin" "typeinfo plugins.qmltypes" "designersupported" "import QtQml.Models auto"
# QML_IMPORT_VERSION = "$$QT_VERSION"
# TARGETPATH = "QtQml"
@@ -38,4 +39,4 @@ qt_add_qml_module(qmlplugin
#####################################################################
#### Keys ignored in scope 2:.:.:qtqml.pro:QT_FEATURE_qml_worker_script:
-# DYNAMIC_QMLDIR = "import QtQml.WorkerScript"
+# DYNAMIC_QMLDIR = "import QtQml.WorkerScript auto"
diff --git a/src/imports/qtqml/CMakeLists.txt b/src/imports/qtqml/CMakeLists.txt
index c33aad5cc4..8ad8c0e111 100644
--- a/src/imports/qtqml/CMakeLists.txt
+++ b/src/imports/qtqml/CMakeLists.txt
@@ -21,6 +21,7 @@ qt_add_qml_module(qmlplugin
CLASSNAME QtQmlPlugin
SKIP_TYPE_REGISTRATION
IMPORTS ${module_dynamic_qml_imports}
+ PLUGIN_OPTIONAL
SOURCES
plugin.cpp
PUBLIC_LIBRARIES
@@ -31,7 +32,7 @@ qt_add_qml_module(qmlplugin
#### Keys ignored in scope 1:.:.:qtqml.pro:<TRUE>:
# CXX_MODULE = "qml"
-# DYNAMIC_QMLDIR = "module QtQml" "plugin qmlplugin" "classname QtQmlPlugin" "typeinfo plugins.qmltypes" "designersupported" "import QtQml.Models"
+# DYNAMIC_QMLDIR = "module QtQml" "optional plugin qmlplugin" "classname QtQmlPlugin" "typeinfo plugins.qmltypes" "designersupported" "import QtQml.Models auto"
# QML_IMPORT_VERSION = "$$QT_VERSION"
# TARGETPATH = "QtQml"
@@ -39,4 +40,4 @@ qt_add_qml_module(qmlplugin
#####################################################################
#### Keys ignored in scope 2:.:.:qtqml.pro:QT_FEATURE_qml_worker_script:
-# DYNAMIC_QMLDIR = "import QtQml.WorkerScript"
+# DYNAMIC_QMLDIR = "import QtQml.WorkerScript auto"
diff --git a/src/imports/qtqml/qtqml.pro b/src/imports/qtqml/qtqml.pro
index ca162e65a9..d32c7ad341 100644
--- a/src/imports/qtqml/qtqml.pro
+++ b/src/imports/qtqml/qtqml.pro
@@ -11,7 +11,7 @@ QT = qml-private qmlmodels-private
DYNAMIC_QMLDIR = \
"module QtQml" \
- "plugin qmlplugin" \
+ "optional plugin qmlplugin" \
"classname QtQmlPlugin" \
"typeinfo plugins.qmltypes" \
"designersupported" \
diff --git a/src/imports/qtquick2/CMakeLists.txt b/src/imports/qtquick2/CMakeLists.txt
index 1da9bad480..aed797189a 100644
--- a/src/imports/qtquick2/CMakeLists.txt
+++ b/src/imports/qtquick2/CMakeLists.txt
@@ -12,6 +12,7 @@ qt_add_qml_module(qtquick2plugin
SKIP_TYPE_REGISTRATION
IMPORTS
QtQml/auto
+ PLUGIN_OPTIONAL
SOURCES
plugin.cpp
PUBLIC_LIBRARIES
diff --git a/src/imports/qtquick2/plugin.cpp b/src/imports/qtquick2/plugin.cpp
index dde0b7207a..414d9e29f5 100644
--- a/src/imports/qtquick2/plugin.cpp
+++ b/src/imports/qtquick2/plugin.cpp
@@ -38,42 +38,21 @@
****************************************************************************/
#include <QtQml/qqmlextensionplugin.h>
-#include <QtQml/QQmlEngine>
-
-#include <private/qtquick2_p.h>
+#include <private/qtquickglobal_p.h>
QT_BEGIN_NAMESPACE
-//![class decl]
-class QtQuick2Plugin : public QQmlExtensionPlugin
+class QtQuick2Plugin : public QQmlEngineExtensionPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
public:
- QtQuick2Plugin(QObject *parent = nullptr) : QQmlExtensionPlugin(parent)
+ QtQuick2Plugin(QObject *parent = nullptr) : QQmlEngineExtensionPlugin(parent)
{
volatile auto registration = &qml_register_types_QtQuick;
Q_UNUSED(registration);
}
-
- void registerTypes(const char *uri) override
- {
- Q_ASSERT(QLatin1String(uri) == QLatin1String("QtQuick"));
- Q_UNUSED(uri);
- moduleDefined = true;
- QQmlQtQuick2Module::defineModule();
- }
-
- void unregisterTypes() override
- {
- if (moduleDefined)
- QQmlQtQuick2Module::undefineModule();
- moduleDefined = false;
- }
-
- bool moduleDefined = false;
};
-//![class decl]
QT_END_NAMESPACE
diff --git a/src/imports/qtquick2/qmldir b/src/imports/qtquick2/qmldir
index b5c754a36f..3dbf9d4f2c 100644
--- a/src/imports/qtquick2/qmldir
+++ b/src/imports/qtquick2/qmldir
@@ -1,5 +1,5 @@
module QtQuick
-plugin qtquick2plugin
+optional plugin qtquick2plugin
classname QtQuick2Plugin
typeinfo plugins.qmltypes
designersupported
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
index 3cf0de74d1..f568b78294 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
+++ b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp
@@ -432,8 +432,8 @@ void QQmlEngineDebugServiceImpl::buildObjectList(QDataStream &message,
void QQmlEngineDebugServiceImpl::buildStatesList(bool cleanList,
const QList<QPointer<QObject> > &instances)
{
- if (m_statesDelegate)
- m_statesDelegate->buildStatesList(cleanList, instances);
+ if (auto delegate = statesDelegate())
+ delegate->buildStatesList(cleanList, instances);
}
QQmlEngineDebugServiceImpl::QQmlObjectData
@@ -681,8 +681,8 @@ bool QQmlEngineDebugServiceImpl::setBinding(int objectId,
if (property.isValid()) {
bool inBaseState = true;
- if (m_statesDelegate) {
- m_statesDelegate->updateBinding(context, property, expression, isLiteralValue,
+ if (auto delegate = statesDelegate()) {
+ delegate->updateBinding(context, property, expression, isLiteralValue,
filename, line, column, &inBaseState);
}
@@ -707,8 +707,8 @@ bool QQmlEngineDebugServiceImpl::setBinding(int objectId,
} else {
// not a valid property
- if (m_statesDelegate)
- ok = m_statesDelegate->setBindingForInvalidProperty(object, propertyName, expression, isLiteralValue);
+ if (auto delegate = statesDelegate())
+ ok = delegate->setBindingForInvalidProperty(object, propertyName, expression, isLiteralValue);
if (!ok)
qWarning() << "QQmlEngineDebugService::setBinding: unable to set property" << propertyName << "on object" << object;
}
@@ -761,8 +761,8 @@ bool QQmlEngineDebugServiceImpl::resetBinding(int objectId, const QString &prope
return true;
}
- if (m_statesDelegate) {
- m_statesDelegate->resetBindingForInvalidProperty(object, propertyName);
+ if (auto delegate = statesDelegate()) {
+ delegate->resetBindingForInvalidProperty(object, propertyName);
return true;
}
@@ -858,11 +858,6 @@ void QQmlEngineDebugServiceImpl::objectCreated(QJSEngine *engine, QObject *objec
emit messageToClient(name(), rs.data());
}
-void QQmlEngineDebugServiceImpl::setStatesDelegate(QQmlDebugStatesDelegate *delegate)
-{
- m_statesDelegate = delegate;
-}
-
QT_END_NAMESPACE
#include "moc_qqmlenginedebugservice.cpp"
diff --git a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.h b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.h
index 741768cd00..a18ff942b6 100644
--- a/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.h
+++ b/src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.h
@@ -99,7 +99,12 @@ public:
void engineAboutToBeRemoved(QJSEngine *) override;
void objectCreated(QJSEngine *, QObject *) override;
- void setStatesDelegate(QQmlDebugStatesDelegate *) override;
+ QQmlDebugStatesDelegate *statesDelegate()
+ {
+ if (!m_statesDelegate)
+ m_statesDelegate = createStatesDelegate();
+ return m_statesDelegate;
+ }
signals:
void scheduleMessage(const QByteArray &);
diff --git a/src/qml/debugger/qqmldebugserviceinterfaces.cpp b/src/qml/debugger/qqmldebugserviceinterfaces.cpp
index 3df1a21bda..3357b0237c 100644
--- a/src/qml/debugger/qqmldebugserviceinterfaces.cpp
+++ b/src/qml/debugger/qqmldebugserviceinterfaces.cpp
@@ -50,6 +50,18 @@ const QString QQmlEngineControlService::s_key = QStringLiteral("EngineControl");
const QString QQmlNativeDebugService::s_key = QStringLiteral("NativeQmlDebugger");
const QString QQmlDebugTranslationService::s_key = QStringLiteral("DebugTranslation");
+static QQmlDebugStatesDelegate *(*statesDelegateFactory)() = nullptr;
+void QQmlEngineDebugService::setStatesDelegateFactory(QQmlDebugStatesDelegate *(*factory)())
+{
+ statesDelegateFactory = factory;
+}
+
+QQmlDebugStatesDelegate *QQmlEngineDebugService::createStatesDelegate()
+{
+ return statesDelegateFactory ? statesDelegateFactory() : nullptr;
+}
+
+
QT_END_NAMESPACE
#include "moc_qqmldebugserviceinterfaces_p.cpp"
diff --git a/src/qml/debugger/qqmldebugserviceinterfaces_p.h b/src/qml/debugger/qqmldebugserviceinterfaces_p.h
index df1ed68c7b..a58a075848 100644
--- a/src/qml/debugger/qqmldebugserviceinterfaces_p.h
+++ b/src/qml/debugger/qqmldebugserviceinterfaces_p.h
@@ -91,7 +91,7 @@ class QQmlEngineDebugService
{
public:
void objectCreated(QJSEngine *, QObject *) {}
- virtual void setStatesDelegate(QQmlDebugStatesDelegate *) {}
+ static void setStatesDelegateFactory(QQmlDebugStatesDelegate *(*)()) {}
};
class QQmlInspectorService {
@@ -158,7 +158,8 @@ public:
static const QString s_key;
virtual void objectCreated(QJSEngine *engine, QObject *object) = 0;
- virtual void setStatesDelegate(QQmlDebugStatesDelegate *) = 0;
+ static void setStatesDelegateFactory(QQmlDebugStatesDelegate *(*factory)());
+ static QQmlDebugStatesDelegate *createStatesDelegate();
protected:
friend class QQmlDebugConnector;
diff --git a/src/quick/.prev_CMakeLists.txt b/src/quick/.prev_CMakeLists.txt
index 87c2949f60..fa968dbe9d 100644
--- a/src/quick/.prev_CMakeLists.txt
+++ b/src/quick/.prev_CMakeLists.txt
@@ -37,6 +37,7 @@ qt_add_module(Quick
items/qquickflickable_p_p.h
items/qquickflickablebehavior_p.h
items/qquickfocusscope.cpp items/qquickfocusscope_p.h
+ items/qquickgraphicsconfiguration.cpp items/qquickgraphicsconfiguration.h items/qquickgraphicsconfiguration_p.h
items/qquickgraphicsdevice.cpp items/qquickgraphicsdevice.h items/qquickgraphicsdevice_p.h
items/qquickgraphicsinfo.cpp items/qquickgraphicsinfo_p.h
items/qquickimage.cpp items/qquickimage_p.h
@@ -88,7 +89,7 @@ qt_add_module(Quick
items/qquickwindowattached.cpp items/qquickwindowattached_p.h
items/qquickwindowmodule.cpp items/qquickwindowmodule_p.h
items/qquickwindowmodule_p_p.h
- qtquick2.cpp qtquick2_p.h
+ qtquick2.cpp
qtquickglobal.h qtquickglobal_p.h
scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp scenegraph/adaptations/software/qsgabstractsoftwarerenderer_p.h
scenegraph/adaptations/software/qsgsoftwareadaptation.cpp scenegraph/adaptations/software/qsgsoftwareadaptation_p.h
diff --git a/src/quick/CMakeLists.txt b/src/quick/CMakeLists.txt
index 3fc9110d0c..4eb0738c8d 100644
--- a/src/quick/CMakeLists.txt
+++ b/src/quick/CMakeLists.txt
@@ -89,7 +89,7 @@ qt_add_module(Quick
items/qquickwindowattached.cpp items/qquickwindowattached_p.h
items/qquickwindowmodule.cpp items/qquickwindowmodule_p.h
items/qquickwindowmodule_p_p.h
- qtquick2.cpp qtquick2_p.h
+ qtquick2.cpp
qtquickglobal.h qtquickglobal_p.h
scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp scenegraph/adaptations/software/qsgabstractsoftwarerenderer_p.h
scenegraph/adaptations/software/qsgsoftwareadaptation.cpp scenegraph/adaptations/software/qsgsoftwareadaptation_p.h
diff --git a/src/quick/qtquick2.cpp b/src/quick/qtquick2.cpp
index f380aeed4b..1aebf70c24 100644
--- a/src/quick/qtquick2.cpp
+++ b/src/quick/qtquick2.cpp
@@ -37,7 +37,6 @@
**
****************************************************************************/
-#include "qtquick2_p.h"
#include <private/qqmlengine_p.h>
#include <private/qquickvaluetypes_p.h>
#include <private/qquickitemsmodule_p.h>
@@ -60,11 +59,7 @@ Q_DECLARE_METATYPE(QKeySequence::StandardKey)
QT_BEGIN_NAMESPACE
-#if !QT_CONFIG(qml_debug)
-
-class QQmlQtQuick2DebugStatesDelegate : public QQmlDebugStatesDelegate {};
-
-#else
+#if QT_CONFIG(qml_debug)
class QQmlQtQuick2DebugStatesDelegate : public QQmlDebugStatesDelegate
{
@@ -179,9 +174,14 @@ void QQmlQtQuick2DebugStatesDelegate::resetBindingForInvalidProperty(QObject *ob
}
}
+static QQmlDebugStatesDelegate *statesDelegateFactory()
+{
+ return new QQmlQtQuick2DebugStatesDelegate;
+}
+
#endif // QT_CONFIG(qml_debug)
-void QQmlQtQuick2Module::defineModule()
+static void defineQtQuickModule()
{
QQuick_initializeProviders();
@@ -195,15 +195,12 @@ void QQmlQtQuick2Module::defineModule()
QAccessible::installFactory(&qQuickAccessibleFactory);
#endif
- QQmlEngineDebugService *debugService = QQmlDebugConnector::service<QQmlEngineDebugService>();
- if (debugService)
- debugService->setStatesDelegate(new QQmlQtQuick2DebugStatesDelegate);
+#if QT_CONFIG(qml_debug)
+ QQmlEngineDebugService::setStatesDelegateFactory(statesDelegateFactory);
+#endif
}
-void QQmlQtQuick2Module::undefineModule()
-{
- QQuick_deinitializeProviders();
-}
+Q_CONSTRUCTOR_FUNCTION(defineQtQuickModule)
QT_END_NAMESPACE
diff --git a/src/quick/qtquick2_p.h b/src/quick/qtquick2_p.h
deleted file mode 100644
index 9a775888ba..0000000000
--- a/src/quick/qtquick2_p.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQuick module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QTQUICK2_P_H
-#define QTQUICK2_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <private/qtquickglobal_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class Q_QUICK_PRIVATE_EXPORT QQmlQtQuick2Module
-{
-public:
- static void defineModule();
- static void undefineModule();
-};
-
-QT_END_NAMESPACE
-
-#endif // QTQUICK2_P_H
diff --git a/src/quick/qtquickglobal_p.h b/src/quick/qtquickglobal_p.h
index 80e59563c7..142e29ea83 100644
--- a/src/quick/qtquickglobal_p.h
+++ b/src/quick/qtquickglobal_p.h
@@ -66,7 +66,6 @@ void Q_QUICK_PRIVATE_EXPORT qml_register_types_QtQuick();
QT_BEGIN_NAMESPACE
void QQuick_initializeProviders();
-void QQuick_deinitializeProviders();
Q_DECLARE_LOGGING_CATEGORY(DBG_TOUCH)
Q_DECLARE_LOGGING_CATEGORY(DBG_MOUSE)
diff --git a/src/quick/quick.pro b/src/quick/quick.pro
index c117ed7a29..6eb6575326 100644
--- a/src/quick/quick.pro
+++ b/src/quick/quick.pro
@@ -44,8 +44,7 @@ qtConfig(accessibility) {
HEADERS += \
qtquickglobal.h \
- qtquickglobal_p.h \
- qtquick2_p.h
+ qtquickglobal_p.h
SOURCES += qtquick2.cpp
diff --git a/src/quick/util/qquickglobal.cpp b/src/quick/util/qquickglobal.cpp
index 6896d3d3e4..9d97280061 100644
--- a/src/quick/util/qquickglobal.cpp
+++ b/src/quick/util/qquickglobal.cpp
@@ -926,11 +926,4 @@ void QQuick_initializeProviders()
QQml_setGuiProvider(getGuiProvider());
}
-void QQuick_deinitializeProviders()
-{
- QQml_removeValueTypeProvider(getValueTypeProvider());
- QQml_setColorProvider(nullptr); // technically, another plugin may have overridden our providers
- QQml_setGuiProvider(nullptr); // but we cannot handle that case in a sane way.
-}
-
QT_END_NAMESPACE