2020-11-08 06:57 AM
Hi Guys,
Please I facing problem to have a QT application fitting the DSI screen,
it sounds like it is 400x240 and not 800x480. I`m probably missing something on QT
or on the STM32MP157C-DK2.
Can someone please help-me to correct the resolution and how to use it landscape ?
Thanks [ ]
2020-11-16 02:49 AM
Hi @FBoar.1 ,
A wiki page will be soon published with some help related to this :
https://wiki.st.com/stm32mpu/wiki/How_to_build_and_use_an_SDK_for_QT
In the meantime I copy here a small extract that can probably help you further :
2.2.1 Select display resolution and size in EGLFS↑
When using a display that accepts multiple resolutions, it is possible to specify the preferred resolution by editing the board file /usr/share/qt5/cursor.json. For example, for an HDMI display, change the line
{ "name": "HDMI1", "mode": "1280x720" },
and enter one of the valid resolutions reported by the command
Board $> modetest
If the current display resolution is higher than the resolution requested by the QT application, QT will expand the application to run it in full screen. This can produce blurred images on the display and can impact the system performance.
It is possible to configure QT to use only one part of the overall display. For example, to use only an area of 400x300 pixels, add:
{ "name": "HDMI1", "mode": "1280x720", "size": "400x300" },
Olivier
2020-11-17 08:47 AM
Hi Olivier,
Thank you for your comments.. I guess found the answers, or at least a workaround:
A) For Rotate the Screen the system the system variable QT_QPA_EGLFS_ROTATION only affects WIDGETS and
not QML based applications, and if applied to QML apps. it really messy with de scale and orientation :
QT SAYS:
"Specifies the rotation applied to software-rendered content in QWidget-based applications. Supported values are 180, 90, and -90. This variable does not apply to OpenGL-based windows, including Qt Quick. Qt Quick applications can apply transformations in their QML scene instead. The standard
eglfs mouse cursor always takes the value into account, with an appropriately positioned and rotated pointer image, regardless of the application type. However, special cursor implementations, such as the KMS/DRM backend's hardware cursor, may not support rotation."
So my simple solution was create a UI and use this UI as a component on the main screen adding "rotation: -90". I sound like "Do whatever you need in a separate screen and after import it to draw with opengl -90. "
B) For the discrepancy of resolution QT as default start the code with : QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
that HighDpiScaling turn the resolution messy, removing it I had my app in the correct scale.
...
So far not sure I`m doing the right thing but it is now running as should be.
Thanks [ ]