From 46dd2c1bac73b766784de0cb2de0e4b29321c166 Mon Sep 17 00:00:00 2001 From: rainzee Date: Sun, 17 Nov 2024 17:59:59 +0800 Subject: [PATCH] feat(typing): add `T_WidgetParent` and `T_ObjectParent` --- siui/typing.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/siui/typing.py b/siui/typing.py index 80f8325..e033445 100644 --- a/siui/typing.py +++ b/siui/typing.py @@ -7,4 +7,14 @@ - [`PEP 526`](https://www.python.org/dev/peps/pep-0526/) """ +from typing import Optional + +from PyQt5.QtCore import QObject +from PyQt5.QtWidgets import QWidget from typing_extensions import TypeAlias + +T_WidgetParent: TypeAlias = Optional[QWidget] +"""Type of widget parent""" + +T_ObjectParent: TypeAlias = Optional[QObject] +"""Type of object parent"""