diff options
author | Friedemann Kleint <[email protected]> | 2025-03-26 10:40:03 +0100 |
---|---|---|
committer | Friedemann Kleint <[email protected]> | 2025-03-26 22:06:53 +0100 |
commit | 33fed60cdf7e9d7811cd9e570df90bd77e1533c1 (patch) | |
tree | 222ddfffd8d55c2aa31e276640f65d69dd252757 | |
parent | 4febd798d535913d1c4a331897e112a46eef213a (diff) |
PySide6: Add support for std::chrono::seconds
Introduced by qtnetworkauth/58c92af6e870fde2718a2aa9a6631a9c7ab40fad.
Complements 2c3c5c0db5f1dbaafd23befc07633382b86e890d.
Task-number: QTBUG-124332
Task-number: PYSIDE-2862
Pick-to: 6.9
Change-Id: I9857e2ee5cabde02469f8c3a32d8a12ba05971a3
Reviewed-by: Cristian Maureira-Fredes <[email protected]>
3 files changed, 18 insertions, 4 deletions
diff --git a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml index b61698caa..eb6c49cc0 100644 --- a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml +++ b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml @@ -27,7 +27,7 @@ <overload-removal type="unsigned long" replaces="unsigned short"/> <overload-removal type="unsigned" replaces="unsigned short"/> <overload-removal type="unsigned long long" replaces="unsigned;unsigned int;unsigned long"/> - <overload-removal type="int" replaces="short;std::chrono::milliseconds"/> + <overload-removal type="int" replaces="short;std::chrono::milliseconds;std::chrono::seconds"/> <overload-removal type="long" replaces="short"/> <overload-removal type="long long" replaces="long;int"/> @@ -213,7 +213,20 @@ <native-to-target file="../glue/qtcore.cpp" snippet="chrono-to-pylong"/> <target-to-native> <add-conversion type="PyLong" file="../glue/qtcore.cpp" - snippet="pylong-to-chrono-milliseconds"/> + snippet="pylong-to-chrono"/> + </target-to-native> + </conversion-rule> + </primitive-type> + + <primitive-type name="std::chrono::seconds" target-lang-api-name="PyLong"> + <extra-includes> + <include file-name="chrono" location="global"/> + </extra-includes> + <conversion-rule> + <native-to-target file="../glue/qtcore.cpp" snippet="chrono-to-pylong"/> + <target-to-native> + <add-conversion type="PyLong" file="../glue/qtcore.cpp" + snippet="pylong-to-chrono"/> </target-to-native> </conversion-rule> </primitive-type> diff --git a/sources/pyside6/PySide6/glue/qtcore.cpp b/sources/pyside6/PySide6/glue/qtcore.cpp index e739e05eb..2ebec690e 100644 --- a/sources/pyside6/PySide6/glue/qtcore.cpp +++ b/sources/pyside6/PySide6/glue/qtcore.cpp @@ -1613,9 +1613,9 @@ return PyBytes_FromStringAndSize(%in.constData(), %in.size()); return PyLong_FromLong(%in.count()); // @snippet chrono-to-pylong -// @snippet pylong-to-chrono-milliseconds +// @snippet pylong-to-chrono %out = %OUTTYPE(PyLong_AsLongLong(%in)); -// @snippet pylong-to-chrono-milliseconds +// @snippet pylong-to-chrono // @snippet return-pylong return PyLong_FromLong(%in); diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py index ce2409794..5a8e46e8f 100644 --- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py +++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/mapping.py @@ -283,6 +283,7 @@ type_map.update({ "signed char": int, "signed long": int, "std.chrono.milliseconds": int, + "std.chrono.seconds": int, "std.list": typing.List, "std.map": typing.Dict, "std.nullptr_t": NoneType, |