diff options
| author | Maximilian Goldstein <max.goldstein@qt.io> | 2020-07-15 10:54:47 +0200 |
|---|---|---|
| committer | Maximilian Goldstein <max.goldstein@qt.io> | 2020-07-23 07:47:32 +0000 |
| commit | 0864de0b26888a795808faa234d9717066e821b5 (patch) | |
| tree | 92436abc623b241b82d9560dff89ba3003b9b954 /sources/pyside2/PySide2/glue/qtqml.cpp | |
| parent | 6fcccf20dab907aa037cd9737b6349b2cad3323f (diff) | |
Implement qmlRegisterSingletonType
Task-number: PYSIDE-574
Change-Id: I8828e22da42a5a47b207bb2e02d2f4fe67746a0b
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside2/PySide2/glue/qtqml.cpp')
| -rw-r--r-- | sources/pyside2/PySide2/glue/qtqml.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sources/pyside2/PySide2/glue/qtqml.cpp b/sources/pyside2/PySide2/glue/qtqml.cpp index 1913204c3..b1d043cf8 100644 --- a/sources/pyside2/PySide2/glue/qtqml.cpp +++ b/sources/pyside2/PySide2/glue/qtqml.cpp @@ -42,6 +42,21 @@ int %0 = PySide::qmlRegisterType(%ARGUMENT_NAMES); %PYARG_0 = %CONVERTTOPYTHON[int](%0); // @snippet qmlregistertype +// @snippet qmlregistersingletontype_qobject_callback +int %0 = PySide::qmlRegisterSingletonType(%ARGUMENT_NAMES, true, true); +%PYARG_0 = %CONVERTTOPYTHON[int](%0); +// @snippet qmlregistersingletontype_qobject_callback + +// @snippet qmlregistersingletontype_qobject_nocallback +int %0 = PySide::qmlRegisterSingletonType(%ARGUMENT_NAMES, nullptr, true, false); +%PYARG_0 = %CONVERTTOPYTHON[int](%0); +// @snippet qmlregistersingletontype_qobject_nocallback + +// @snippet qmlregistersingletontype_qjsvalue +int %0 = PySide::qmlRegisterSingletonType(nullptr, %ARGUMENT_NAMES, false, true); +%PYARG_0 = %CONVERTTOPYTHON[int](%0); +// @snippet qmlregistersingletontype_qjsvalue + // @snippet init PySide::initQmlSupport(module); // @snippet init |
