Set widget in center in QDesigner
Is it possible to set widget in center of dialog or windows in QDesigner, sa开发者_运维知识库y I have a widget contain 3 line edits and labels and I want to set this widget in center of window.
In latest Qt Designer, right-click a widget in the Object Inspector and choose your preference under Layout Alignment.
It should be quite simple:
- Insert horizontal spacer
- Set Horizontal layout
- Insert Vertical layout
Insert another horizontal spacer
Add Vertical spacer to Horizontal spacer (drag to widget tree)
- Add your widgets .... labels, textedits
- Add another vertical sapcer to Horizontal space
Works in my QtCreator, should also in Your Designer :)
Good luck.
Add a layout to your windows and add the widgets in the layout. Then you can set the position policy in the properties panel of the layout.
精彩评论