QT UI里控件germetry不可设置
时间: 2023-05-26 20:06:13 浏览: 458
Germetry是一个拼写错误,正确的单词是geometry。在Qt UI中,控件的geometry属性是可以设置的。它定义了控件在窗口内的位置和大小。您可以通过设置控件的坐标和尺寸来调整它在UI中的位置和大小。要设置控件的geometry属性,您可以使用QWidget类中的setGeometry()方法。例如,下面的代码将一个QPushButton放在窗口的左上角:
```python
button = QPushButton("Click me", window)
button.setGeometry(0, 0, 100, 30)
```
这将在窗口的左上角创建一个100x30像素的QPushButton。您可以根据需要修改这些参数以适合您的UI布局。
阅读全文
相关推荐
![-](https://img-home.csdnimg.cn/images/20241231044955.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![7z](https://img-home.csdnimg.cn/images/20241231044736.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![7z](https://img-home.csdnimg.cn/images/20241231044736.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![rar](https://img-home.csdnimg.cn/images/20241231044955.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)