Darkn3ss
Darkn3ss

Reputation: 151

Qt Needs to Scale Entire Application Easily

My problem is that we have developed a product using 480x800 on a 10" LCD display, and we want to "give the idea" to a customer who has a PC.

No modestly-priced laptop has a vertical resolution of 800 these days, probably because of 720p standards, but I digress.

Basically, I want to take a suggestion back to the designer, who used Qt, and suggest something that will work. He has already stated that it is impossible, but I suspect that is laziness talking.

As a .NET developer, I know how easy it is to scale a WinForms application, but I don't want to suggest something where I have no expertise, and while searching StackOverflow and Google for tips with scaling and Qt have yielded no results.

Is there something easy to cause an entire application to scale downwards in Qt?

Thanks for any help you can provide.

Upvotes: 3

Views: 1244

Answers (1)

Tamás Szelei
Tamás Szelei

Reputation: 23941

If you mean normal scaling where some widgets retain their sizes and some scale, then yes, it's really easy (like what a WinForms developer achieves with anchors if I remember correctly). Just a matter of using layouts and spacers. Grid and form layouts are very flexible but in case a more complicated layout is needed it's easy to add a subcontainer that has a different layout. This layout concept is similar to Java SWING and AWT layouts.

Also, if he used Qt Creator to design the ui, then selecting the container and applying grid layout often yields the desired results (it's on the toolbar).

If you mean proportional scaling of all widgets then it's not simple. One would need to override the resizeEvent and scale all widgets accordingly, plus fonts are tricky to scale well.

Upvotes: 2

Related Questions