diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-01-26 14:51:08 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2024-03-19 00:33:16 +0100 |
commit | 6b6651f7e64926b114f3545d353393eab396c3c1 (patch) | |
tree | 1721778804dbbeef945aadf6b520c89acbbe5055 | |
parent | 5f79434e15c8091e3005cc7a5204733fc2df0f8e (diff) |
Adapt to glue code to namespaced Qt builds
Task-number: PYSIDE-2590
Change-Id: I7269b0f1c1758a9d26579267fc0b423c6a0422ac
Pick-to: 6.5
Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io>
(cherry picked from commit 102b7fffa1721430acbb17624bb216b80de5ae5a)
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
-rw-r--r-- | examples/scriptableapplication/mainwindow.h | 2 | ||||
-rw-r--r-- | examples/scriptableapplication/pythonutils.h | 2 | ||||
-rw-r--r-- | sources/pyside6/PySide6/QtCore/glue/core_snippets_p.h | 2 | ||||
-rw-r--r-- | sources/pyside6/PySide6/QtCore/glue/qtcorehelper.cpp | 4 | ||||
-rw-r--r-- | sources/pyside6/PySide6/QtDesigner/qpydesignercustomwidgetcollection.cpp | 4 | ||||
-rw-r--r-- | sources/pyside6/PySide6/glue/qtgui.cpp | 2 | ||||
-rw-r--r-- | sources/pyside6/PySide6/qpydesignerextensions.h | 8 | ||||
-rw-r--r-- | sources/pyside6/PySide6/qpyqmlparserstatus.h | 4 | ||||
-rw-r--r-- | sources/pyside6/PySide6/qpyqmlpropertyvaluesource.h | 4 | ||||
-rw-r--r-- | sources/pyside6/PySide6/qpytextobject.h | 3 | ||||
-rw-r--r-- | sources/pyside6/PySide6/qtcorehelper.h | 4 | ||||
-rw-r--r-- | sources/pyside6/PySide6/qtdbushelper.h | 3 | ||||
-rw-r--r-- | sources/pyside6/PySide6/qtguihelper.h | 2 |
13 files changed, 40 insertions, 4 deletions
diff --git a/examples/scriptableapplication/mainwindow.h b/examples/scriptableapplication/mainwindow.h index 476243f9b..8f8e2673b 100644 --- a/examples/scriptableapplication/mainwindow.h +++ b/examples/scriptableapplication/mainwindow.h @@ -6,7 +6,7 @@ #include <QtWidgets/QMainWindow> -class QPlainTextEdit; +QT_FORWARD_DECLARE_CLASS(QPlainTextEdit) class MainWindow : public QMainWindow { diff --git a/examples/scriptableapplication/pythonutils.h b/examples/scriptableapplication/pythonutils.h index 7f05cdedb..09e959159 100644 --- a/examples/scriptableapplication/pythonutils.h +++ b/examples/scriptableapplication/pythonutils.h @@ -6,7 +6,7 @@ #include <QtCore/QStringList> -class QObject; +QT_FORWARD_DECLARE_CLASS(QObject) namespace PythonUtils { diff --git a/sources/pyside6/PySide6/QtCore/glue/core_snippets_p.h b/sources/pyside6/PySide6/QtCore/glue/core_snippets_p.h index eeeed98e7..11e84b291 100644 --- a/sources/pyside6/PySide6/QtCore/glue/core_snippets_p.h +++ b/sources/pyside6/PySide6/QtCore/glue/core_snippets_p.h @@ -19,10 +19,12 @@ QT_FORWARD_DECLARE_CLASS(QObject) QT_FORWARD_DECLARE_CLASS(QRegularExpression) QT_FORWARD_DECLARE_CLASS(QVariant); +QT_BEGIN_NAMESPACE namespace QtCoreHelper { class QGenericArgumentHolder; class QGenericReturnArgumentHolder; } +QT_END_NAMESPACE // Helpers for QVariant conversion diff --git a/sources/pyside6/PySide6/QtCore/glue/qtcorehelper.cpp b/sources/pyside6/PySide6/QtCore/glue/qtcorehelper.cpp index 2517808c6..948c0ce5c 100644 --- a/sources/pyside6/PySide6/QtCore/glue/qtcorehelper.cpp +++ b/sources/pyside6/PySide6/QtCore/glue/qtcorehelper.cpp @@ -5,6 +5,8 @@ #include <QtCore/qdebug.h> +QT_BEGIN_NAMESPACE + namespace QtCoreHelper { // Data classes for the generic argument data classes. The argument is freed @@ -102,3 +104,5 @@ const void *QGenericReturnArgumentHolder::data() const } } // namespace QtCoreHelper + +QT_END_NAMESPACE diff --git a/sources/pyside6/PySide6/QtDesigner/qpydesignercustomwidgetcollection.cpp b/sources/pyside6/PySide6/QtDesigner/qpydesignercustomwidgetcollection.cpp index 22b76e131..31f8ec152 100644 --- a/sources/pyside6/PySide6/QtDesigner/qpydesignercustomwidgetcollection.cpp +++ b/sources/pyside6/PySide6/QtDesigner/qpydesignercustomwidgetcollection.cpp @@ -9,6 +9,8 @@ #include <shiboken.h> #include <bindingmanager.h> +QT_BEGIN_NAMESPACE + static QString pyStringToQString(PyObject *s) { const char *utf8 = _PepUnicode_AsString(s); @@ -217,3 +219,5 @@ void QPyDesignerCustomWidgetCollection::addCustomWidget(QDesignerCustomWidgetInt { instance()->m_customWidgets.append(c); } + +QT_END_NAMESPACE diff --git a/sources/pyside6/PySide6/glue/qtgui.cpp b/sources/pyside6/PySide6/glue/qtgui.cpp index e38684a7f..09d229448 100644 --- a/sources/pyside6/PySide6/glue/qtgui.cpp +++ b/sources/pyside6/PySide6/glue/qtgui.cpp @@ -6,7 +6,9 @@ ********************************************************************/ // @snippet gui-declarations +QT_BEGIN_NAMESPACE void qt_set_sequence_auto_mnemonic(bool); +QT_END_NAMESPACE // @snippet gui-declarations // @snippet qaccessible-pysidefactory diff --git a/sources/pyside6/PySide6/qpydesignerextensions.h b/sources/pyside6/PySide6/qpydesignerextensions.h index 04764c9a4..871fa8284 100644 --- a/sources/pyside6/PySide6/qpydesignerextensions.h +++ b/sources/pyside6/PySide6/qpydesignerextensions.h @@ -21,6 +21,10 @@ Q_DECLARE_INTERFACE(QDesignerTaskMenuExtension, "org.qt-project.Qt.Designer.Task Q_DECLARE_INTERFACE(QDesignerCustomWidgetCollectionInterface, "org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface") #endif +struct _object; // PyObject + +QT_BEGIN_NAMESPACE + // Extension implementations need to inherit QObject which cannot be done in Python. // Provide a base class (cf QPyTextObject). @@ -56,8 +60,6 @@ public: explicit QPyDesignerTaskMenuExtension(QObject *parent = nullptr) : QObject(parent) {} }; -struct _object; // PyObject - class QPyDesignerCustomWidgetCollection : public QDesignerCustomWidgetCollectionInterface { public: @@ -77,4 +79,6 @@ private: QList<QDesignerCustomWidgetInterface *> m_customWidgets; }; +QT_END_NAMESPACE + #endif // QPYDESIGNEREXTENSIONS_H diff --git a/sources/pyside6/PySide6/qpyqmlparserstatus.h b/sources/pyside6/PySide6/qpyqmlparserstatus.h index 897ebfb5e..24dcdda75 100644 --- a/sources/pyside6/PySide6/qpyqmlparserstatus.h +++ b/sources/pyside6/PySide6/qpyqmlparserstatus.h @@ -11,6 +11,8 @@ Q_DECLARE_INTERFACE(QQmlParserStatus, "org.qt-project.Qt.QQmlParserStatus") #endif +QT_BEGIN_NAMESPACE + // Inherit from QObject such that QQmlParserStatus can be found at // a fixed offset (RegisterType::parserStatusCast). class QPyQmlParserStatus : public QObject, public QQmlParserStatus @@ -21,4 +23,6 @@ public: explicit QPyQmlParserStatus(QObject *parent = nullptr) : QObject(parent) {} }; +QT_END_NAMESPACE + #endif // QPYQMLPARSERSTATUS_H diff --git a/sources/pyside6/PySide6/qpyqmlpropertyvaluesource.h b/sources/pyside6/PySide6/qpyqmlpropertyvaluesource.h index 8e8fc24c1..0b6a0b95c 100644 --- a/sources/pyside6/PySide6/qpyqmlpropertyvaluesource.h +++ b/sources/pyside6/PySide6/qpyqmlpropertyvaluesource.h @@ -10,6 +10,8 @@ Q_DECLARE_INTERFACE(QQmlPropertyValueSource, "org.qt-project.Qt.QQmlPropertyValueSource") #endif +QT_BEGIN_NAMESPACE + // Inherit from QObject such that QQmlPropertyValueSource can be found at // a fixed offset (RegisterType::valueSourceCast). class QPyQmlPropertyValueSource : public QObject, public QQmlPropertyValueSource @@ -20,4 +22,6 @@ public: explicit QPyQmlPropertyValueSource(QObject *parent = nullptr) : QObject(parent) {} }; +QT_END_NAMESPACE + #endif // QPYQMLPROPERTYVALUESOURCE_H diff --git a/sources/pyside6/PySide6/qpytextobject.h b/sources/pyside6/PySide6/qpytextobject.h index c667b2980..45bb0bd52 100644 --- a/sources/pyside6/PySide6/qpytextobject.h +++ b/sources/pyside6/PySide6/qpytextobject.h @@ -13,6 +13,7 @@ Q_DECLARE_INTERFACE(QTextObjectInterface, "org.qt-project.Qt.QTextObjectInterface") #endif +QT_BEGIN_NAMESPACE class QPyTextObject : public QObject, public QTextObjectInterface { Q_OBJECT @@ -20,6 +21,8 @@ class QPyTextObject : public QObject, public QTextObjectInterface public: QPyTextObject(QObject *parent = nullptr) : QObject(parent) {} }; +QT_END_NAMESPACE + #endif diff --git a/sources/pyside6/PySide6/qtcorehelper.h b/sources/pyside6/PySide6/qtcorehelper.h index 3579d83c9..589d0b295 100644 --- a/sources/pyside6/PySide6/qtcorehelper.h +++ b/sources/pyside6/PySide6/qtcorehelper.h @@ -9,6 +9,8 @@ #include <memory> +QT_BEGIN_NAMESPACE + namespace QtCoreHelper { using MutexLocker = QT_PREPEND_NAMESPACE(QMutexLocker<QMutex>); @@ -115,4 +117,6 @@ namespace QtCoreHelper { } // namespace QtCoreHelper +QT_END_NAMESPACE + #endif // QTCOREHELPER_H diff --git a/sources/pyside6/PySide6/qtdbushelper.h b/sources/pyside6/PySide6/qtdbushelper.h index b59d2db9c..7389ad815 100644 --- a/sources/pyside6/PySide6/qtdbushelper.h +++ b/sources/pyside6/PySide6/qtdbushelper.h @@ -8,6 +8,7 @@ #include <QtDBus/qdbuspendingcall.h> #include <QtDBus/qdbusreply.h> +QT_BEGIN_NAMESPACE namespace QtDBusHelper { // A Python-bindings friendly, non-template QDBusReply @@ -56,4 +57,6 @@ inline QDBusReply::QDBusReply() = default; } // namespace QtDBusHelper +QT_END_NAMESPACE + #endif // QTDBUSHELPER_H diff --git a/sources/pyside6/PySide6/qtguihelper.h b/sources/pyside6/PySide6/qtguihelper.h index dfb7b994a..e537cfefa 100644 --- a/sources/pyside6/PySide6/qtguihelper.h +++ b/sources/pyside6/PySide6/qtguihelper.h @@ -6,6 +6,7 @@ #include <QtGui/QGuiApplication> +QT_BEGIN_NAMESPACE namespace QtGuiHelper { class QOverrideCursorGuard @@ -29,5 +30,6 @@ namespace QtGuiHelper { }; } // namespace QtGuiHelper +QT_END_NAMESPACE #endif // QTGUIHELPER_H |