cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to zoom out the GUI of a Qt application?

SomeForumUsername
Associate

Hi,

I am successfully able to cross-compile a Qt application and run it on a STM32MP157F-DK2 using the various tutorials on this site.

Problem is, I want to view the application using the internal LCD of the board (800*480), but the application is designed for a 1920*1080 screen.

It runs, but only half of the window is visible. I tried to run it on Weston and EGLFS, same result.

Is it possible to zoom out/rescale the application using some Weston/EGLFS parameters, so that the whole window is visible? I am aware that the contents are gonna be tiny, that's not a problem.

I tried QT_SCALE_FACTOR=0.5 using EGLFS, but that didn't work.

3 REPLIES 3
liaifat85
Senior III

In your main application code, you can set the window size explicitly to match the display resolution:

QWidget *window = new QWidget;
window->resize(800, 480);
window->show();

This resizes the size of the window, but not the contents there (bitmaps in my case, using QLabels).

PPAGE.13
ST Employee

Hello @SomeForumUsername 

you cannot use some external environment parameters to resize your application. You need to do it inside the application code.

If the application has been well designed (layout, image to fit, ...), this should be quite easy to migrate it to a lower resolution.

As a first trial, you can adjust the main window size (width/height) and check what you got.

 

Philippe.

 

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.