The importance of QT layout

Source: Internet
Author: User

Some time ago, when we started to learn QT, I tried to layout a serial communication form.

After the layout, also tried on different computers (laptops and working desktops), there is no problem: the layout is normal. But inadvertently, when you open this project on Surface 3, you find that the layout appears confusing. The following post describes:QT 5.3.1 dragged out of the UI layout, why on different computers show the difference so big?

As suggested by friends in this post, layout controls are laid out. Because there is no prior to the layout, the process also encountered a lot of problems. But at the end of the layout it is a result of achieving the desired effect as shown in the following:

Let's talk about the problems in the Layout process:

1) When Vertical Space is not placed, several vertival Layout on the left will change position with the size of the form. Finally abandoned this layout, the important layout.

2) After re-layout, the location of several Vertical layouts on the left no longer varies with the size of the form, but the size of the Edit on the right does not change depending on the size of the form. This is not the effect I want!

3) on the basis of the 2 layout, it is found that you want the Edit control on the right to change with the size of the form, you need to press the right mouse button on the form, then select: Layout, horizontal layout (or other layout). In this way, controls and Layout placed on the form will change "certain" depending on the size of the form.

4) Place Vertical space to make it occupy "superfluous" blanks.

The importance of QT layout

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.