开发者

Qt application not resizing properly

开发者 https://www.devze.com 2023-02-01 20:35 出处:网络
I am having a problem with resizing my gui\'s made from Qt. In full screen basically they don\'t scale to the available 开发者_开发百科space.

I am having a problem with resizing my gui's made from Qt.

In full screen basically they don't scale to the available 开发者_开发百科space.

Here is what i did.

1. Created a gui from Qt Designer.

Qt application not resizing properly

2. When i preview it and try to maximize it, it scales badly. The same thing happens when i use this generated code for my application(it scales badly when maximized)

Qt application not resizing properly

Qt application not resizing properly

Question: What am i doing wrong? Thanks.


You need to set a layout for your your main window and then add spacers in the main layout to keep things floating nicely.

http://doc.qt.nokia.com/4.7-snapshot/designer-manual.html

http://doc.qt.nokia.com/4.7-snapshot/designer-layouts.html


Give the whole widget a grid layoutso it knows how to resize.

0

精彩评论

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

关注公众号