diff options
| author | Cristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2024-08-09 16:09:37 +0200 |
|---|---|---|
| committer | Cristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io> | 2024-08-16 17:13:01 +0200 |
| commit | 141d596d1bcf32314802d4269781d2f005ec2278 (patch) | |
| tree | 2811dbe4ef762a99fd7dd1120fe512f7c2beb5a2 /sources/pyside6 | |
| parent | 1e9ab846e7b59f98b57bd22c17840472619fa85e (diff) | |
pyi: improve findChild/findChildren type hints
Add a TypeVar that's bound to QObject in order to use
it as a generic QObject-based for the returns of
both findChild and findChildren.
Fixes: PYSIDE-2517
Pick-to: 6.7 6.5 6.2
Change-Id: I165cdc391bd7b57df95247202170d6fa9d2aa824
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/pyside6')
| -rw-r--r-- | sources/pyside6/PySide6/QtCore/typesystem_core_common.xml | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml index f4559fbfd..2fc68f005 100644 --- a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml +++ b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml @@ -1845,7 +1845,7 @@ </inject-documentation> <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-findchild-2"/> - <modify-argument index="return"> + <modify-argument index="return" pyi-type="Optional[PlaceHolderType]"> <parent index="this" action="add"/> </modify-argument> </add-function> @@ -1855,14 +1855,14 @@ Like the method *findChild*, the first parameter should be the child's type. </inject-documentation> <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-findchildren"/> - <modify-argument index="return"> + <modify-argument index="return" pyi-type="Iterable[PlaceHolderType]"> <parent index="this" action="add"/> </modify-argument> </add-function> <add-function signature="findChildren(PyTypeObject*@type@,const QRegularExpression&@pattern@,Qt::FindChildOptions@options@=Qt::FindChildrenRecursively)" return-type="PySequence*" > <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qobject-findchildren"/> - <modify-argument index="return"> + <modify-argument index="return" pyi-type="Iterable[PlaceHolderType]"> <parent index="this" action="add"/> </modify-argument> </add-function> |
