2022-06-06 10:56:29 +08:00

14 lines
398 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from PySide6 import QtWidgets
def get_sub_classes(class_):
"""递归地显示某一类的所有子类"""
for subclass in class_.__subclasses__():
print(subclass)
if len(class_.__subclasses__()) > 0:
get_sub_classes(subclass)
# 查看QAbstractButton抽象基类的所有子类了解Qt6提供了哪些按钮控件
get_sub_classes(QtWidgets.QAbstractButton)