diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-08-26 11:56:45 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-08-31 07:06:10 +0000 |
commit | 5a59cbfee71907c47587a1e3d340d31abfdc01ba (patch) | |
tree | 33728e76ce100888fc4fad3c00e148cede04a2c8 /src/qml/qml | |
parent | cf6bbc0d65fed17c645d7a3b62d2676fec5b251c (diff) |
Remove superfluous namespace and exports
[ChangeLog][QtQml] The functions qmlExecuteDeferred, qmlContext and
qmlEngine are no longer available in the QtQml namespace. Use their
counterparts in the global namespace.
Change-Id: Ife1ea83ca1d474420c9ee697772b7115247cc400
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/qqml.h | 30 | ||||
-rw-r--r-- | src/qml/qml/qqmlengine.cpp | 28 |
2 files changed, 7 insertions, 51 deletions
diff --git a/src/qml/qml/qqml.h b/src/qml/qml/qqml.h index d346660987..4c3454e7b4 100644 --- a/src/qml/qml/qqml.h +++ b/src/qml/qml/qqml.h @@ -594,29 +594,13 @@ class QQmlEngine; class QJSValue; class QJSEngine; -#ifndef Q_QDOC -namespace QtQml { -#endif - // declared in namespace to avoid symbol conflicts with QtDeclarative - Q_QML_EXPORT void qmlExecuteDeferred(QObject *); - Q_QML_EXPORT QQmlContext *qmlContext(const QObject *); - Q_QML_EXPORT QQmlEngine *qmlEngine(const QObject *); - Q_QML_EXPORT QQmlAttachedPropertiesFunc qmlAttachedPropertiesFunction(QObject *, - const QMetaObject *); - Q_QML_EXPORT QObject *qmlAttachedPropertiesObject(QObject *, QQmlAttachedPropertiesFunc func, - bool create = true); -#ifndef Q_QDOC -} - -QT_WARNING_PUSH -QT_WARNING_DISABLE_CLANG("-Wheader-hygiene") - -// This is necessary to allow for QtQuick1 and QtQuick2 scenes in a single application. -using namespace QtQml; - -QT_WARNING_POP - -#endif // Q_QDOC +Q_QML_EXPORT void qmlExecuteDeferred(QObject *); +Q_QML_EXPORT QQmlContext *qmlContext(const QObject *); +Q_QML_EXPORT QQmlEngine *qmlEngine(const QObject *); +Q_QML_EXPORT QQmlAttachedPropertiesFunc qmlAttachedPropertiesFunction(QObject *, + const QMetaObject *); +Q_QML_EXPORT QObject *qmlAttachedPropertiesObject(QObject *, QQmlAttachedPropertiesFunc func, + bool create = true); //The C++ version of protected namespaces in qmldir Q_QML_EXPORT bool qmlProtectModule(const char* uri, int majVersion); diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp index f1c79fe8b3..5965431512 100644 --- a/src/qml/qml/qqmlengine.cpp +++ b/src/qml/qml/qqmlengine.cpp @@ -1490,8 +1490,6 @@ void QQmlEnginePrivate::doDeleteInEngineThread() delete d; } -namespace QtQml { - void qmlExecuteDeferred(QObject *object) { QQmlData *data = QQmlData::get(object); @@ -1563,32 +1561,6 @@ QObject *qmlAttachedPropertiesObject(QObject *object, QQmlAttachedPropertiesFunc return resolveAttachedProperties(func, data, object, create); } -} // namespace QtQml - -#if QT_DEPRECATED_SINCE(5, 1) -QT_WARNING_PUSH -QT_WARNING_DISABLE_DEPRECATED - -// Also define symbols outside namespace to keep binary compatibility with Qt 5.0 - -Q_QML_EXPORT void qmlExecuteDeferred(QObject *obj) -{ - QtQml::qmlExecuteDeferred(obj); -} - -Q_QML_EXPORT QQmlContext *qmlContext(const QObject *obj) -{ - return QtQml::qmlContext(obj); -} - -Q_QML_EXPORT QQmlEngine *qmlEngine(const QObject *obj) -{ - return QtQml::qmlEngine(obj); -} - -QT_WARNING_POP -#endif // QT_DEPRECATED_SINCE(5, 1) - class QQmlDataExtended { public: QQmlDataExtended(); |