dialog_position = main_center - dialog_size.center() AttributeError: 'QSize' object has no attribute 'center'
时间: 2023-11-08 16:01:40 浏览: 79
这个错误是因为你正在尝试使用 `center()` 方法,但是 `QSize` 对象没有该属性。`center()` 方法是用于 `QRect` 对象的,它返回矩形的中心点坐标。如果你想计算 `QSize` 对象的中心点坐标,你可以使用 `width()` 和 `height()` 方法来获取宽度和高度,然后计算中心点的坐标。
阅读全文
相关推荐
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![whl](https://img-home.csdnimg.cn/images/20250102104920.png)
![whl](https://img-home.csdnimg.cn/images/20250102104920.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![rpm](https://img-home.csdnimg.cn/images/20250102104920.png)
![rpm](https://img-home.csdnimg.cn/images/20250102104920.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231044955.png)