diff options
author | Cristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2021-07-15 14:09:44 +0200 |
---|---|---|
committer | Cristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2021-08-17 23:15:52 +0200 |
commit | 6d07b7256c350835917d30cf74c8180592b80452 (patch) | |
tree | c13d2ce473aa8a5c78936ef0119ccaddc8d61a7b /sources/pyside6/libpyside/pyside.h | |
parent | ea358c8fbb7a12369565d4f797a75738f7dd76ef (diff) |
Implement qmlRegisterSingletonInstance
Using a similar approach to the qmlRegisterSingletonType,
but wrapping the instance (QObject) into a SingletonFunctor
as described in Qt/C++.
Add helper function PySide::isQObjectDerived
Task-number: PYSIDE-487
Change-Id: Id0fd9da0351a9ba58eae006d7d882f9815f06742
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside6/libpyside/pyside.h')
-rw-r--r-- | sources/pyside6/libpyside/pyside.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sources/pyside6/libpyside/pyside.h b/sources/pyside6/libpyside/pyside.h index 1cb77b4c5..0c9ad92cf 100644 --- a/sources/pyside6/libpyside/pyside.h +++ b/sources/pyside6/libpyside/pyside.h @@ -105,6 +105,13 @@ PYSIDE_API void initQApp(); /// Return the size in bytes of a type that inherits QObject. PYSIDE_API std::size_t getSizeOfQObject(SbkObjectType *type); +/* Check if a PyTypeObject or its bases contains a QObject + * \param pyType is the PyTypeObject to check + * \param raiseError controls if a TypeError is raised when an object does not + * inherits from QObject + */ +PYSIDE_API bool isQObjectDerived(PyTypeObject *pyType, bool raiseError); + typedef void (*CleanupFunction)(void); /** |