def __init__(self, *args, **kwargs):
if len(args) == 2:
self.width, self.height = args
elif len(args) == 1 and isinstance(args[0], (QtCore.QRect, QtCore.QRectF)):
self.width = args[0].width()
self.width = args[0].height()
elif len(args) == 1 and len(args[0]) == 2:
self.width, self.height = args[0]
elif len(kwargs) == 2 and "width" in kwargs and "height" in kwargs:
self.width = kwargs["width"]
self.height = kwards["height"]
else:
raise TypeError
评论列表
文章目录