开发者

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.

Set widget in center in QDesigner


It should be quite simple:

  1. Insert horizontal spacer
  2. Set Horizontal layout
  3. Insert Vertical layout
  4. Insert another horizontal spacer

  5. Add Vertical spacer to Horizontal spacer (drag to widget tree)

  6. Add your widgets .... labels, textedits
  7. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜