diff options
| author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-08-28 13:56:38 +0200 |
|---|---|---|
| committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2023-08-28 16:26:14 +0200 |
| commit | 74a2ec0202af250828c10dfb10b71036a3af9dd8 (patch) | |
| tree | f0012397eda0f8d6f6460bea7ef02a2faa7e0082 /sources/pyside6/libpyside/pysideutils.h | |
| parent | bc7a9bf038aece007c2b1184ddef436ee8b9a16a (diff) | |
libpyside: Add QDebug operators for PyTypeObject/PyObject
Complement the operators std::ostream in libshiboken which are
very verbose, outputting all flags and refcounts, by simple
operators for QDebug which basically output a simple type: value.
Change-Id: Icf99c55cd64d63eb9d2e47b40fdc6df88e9119e3
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'sources/pyside6/libpyside/pysideutils.h')
| -rw-r--r-- | sources/pyside6/libpyside/pysideutils.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sources/pyside6/libpyside/pysideutils.h b/sources/pyside6/libpyside/pysideutils.h index 4a4062bfc..d35905104 100644 --- a/sources/pyside6/libpyside/pysideutils.h +++ b/sources/pyside6/libpyside/pysideutils.h @@ -10,6 +10,7 @@ #include <QtCore/QtGlobal> +QT_FORWARD_DECLARE_CLASS(QDebug) QT_FORWARD_DECLARE_CLASS(QString) QT_FORWARD_DECLARE_CLASS(QStringView) @@ -36,6 +37,24 @@ PYSIDE_API QString pyPathToQString(PyObject *path); PYSIDE_API bool isCompiledMethod(PyObject *callback); +struct debugPyTypeObject +{ + PYSIDE_API explicit debugPyTypeObject(const PyTypeObject *o) noexcept; + + const PyTypeObject *m_object; +}; + +PYSIDE_API QDebug operator<<(QDebug debug, const debugPyTypeObject &o); + +struct debugPyObject +{ + PYSIDE_API explicit debugPyObject(PyObject *o) noexcept; + + PyObject *m_object; +}; + +PYSIDE_API QDebug operator<<(QDebug debug, const debugPyObject &o); + } //namespace PySide #endif // PYSIDESTRING_H |
