Frage

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.

War es hilfreich?

Lösung

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))
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top