Let the Qt control change the size adaptively with the window [VS+Qt project development series] (7)

In the previous blog post [VS+Qt project development] (6) Creating and using custom Qt plugins in the project , we spent a lot of space to introduce.

This blog post will be short.

Welcome to view the VS+Qt project development experience sharing

The project source code has been uploaded, please click to download

1. Control settings

I will emphasize a few points:

(1) The horizontal and vertical strategies are set to Preferred

(2) Set the minimum value: make sure that when you shrink the window, your controls are still not deformed too ugly, and there is an acceptable size lower limit (can't be infinitely reduced)

(3) Set the maximum value: Make sure that when you zoom in on the window, your controls are still not deformed too ugly, and there is an acceptable upper size limit (not infinitely larger)

(4) Make sure that the outermost periphery of all controls in your UI is a vertical or horizontal layout

As shown below:


2. Use a grid layout

Select the outermost border and click [Grid Layout].


After clicking~


Zoom out


Zoom in on the interface


OK, let's introduce these first~ I will add more when I encounter others~

Welcome to my GitHub homepage to download the project source code ~

Return to " Visual Studio 2015 Development Qt Project Practical Experience Sharing "

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324849432&siteId=291194637