문제

Can I use pixel positioning for widgets in PyQt? I mean like in Visual Studio - you can set positions of your widget (interface object).

It's so uncomfortably to position this widgets using some grids and layers. It's not just uncomfortably, I can't make simple interface.

도움이 되었습니까?

해결책

Yes, you can set their position with pixels.

widget.setGeometry(QtCore.QRect(x_pos, y_pos, x_size, y_size))
# A button located at (300, 425) of size 500 by 100
self.btn_example.setGeometry(QtCore.QRect(300, 425, 500, 100))
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top