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/PySide6/glue/qtqml.cpp | |
| 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/PySide6/glue/qtqml.cpp')
| -rw-r--r-- | sources/pyside6/PySide6/glue/qtqml.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sources/pyside6/PySide6/glue/qtqml.cpp b/sources/pyside6/PySide6/glue/qtqml.cpp index eab6eab95..99a1c441a 100644 --- a/sources/pyside6/PySide6/glue/qtqml.cpp +++ b/sources/pyside6/PySide6/glue/qtqml.cpp @@ -57,6 +57,11 @@ int %0 = PySide::qmlRegisterSingletonType(nullptr, %ARGUMENT_NAMES, false, true) %PYARG_0 = %CONVERTTOPYTHON[int](%0); // @snippet qmlregistersingletontype_qjsvalue +// @snippet qmlregistersingletoninstance +int %0 = PySide::qmlRegisterSingletonInstance(%ARGUMENT_NAMES); +%PYARG_0 = %CONVERTTOPYTHON[int](%0); +// @snippet qmlregistersingletoninstance + // @snippet qmlregisteruncreatabletype int %0 = PySide::qmlRegisterType(%ARGUMENT_NAMES, false); %PYARG_0 = %CONVERTTOPYTHON[int](%0); |
