Pergunta

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.

Foi útil?

Solução

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))
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top