mirror of
https://github.com/muziing/PySide6-Code-Tutorial.git
synced 2025-01-15 18:02:53 +08:00
307945b3ab
按照注释的意思, 此处应该是修改为subclass
14 lines
400 B
Python
14 lines
400 B
Python
from PySide6 import QtWidgets
|
||
|
||
|
||
def get_sub_classes(class_):
|
||
"""递归地显示某一类的所有子类"""
|
||
for subclass in class_.__subclasses__():
|
||
print(subclass)
|
||
if len(subclass.__subclasses__()) > 0:
|
||
get_sub_classes(subclass)
|
||
|
||
|
||
# 查看QAbstractButton抽象基类的所有子类,了解Qt6提供了哪些按钮控件
|
||
get_sub_classes(QtWidgets.QAbstractButton)
|