Rotate the Application Window using QML
-
I am using Qtquick to create a GUI for an HMI application.
The display which I am using is Waveshare 8DP-CAPLCD. I am using Digi ConnectCore 8M Nano development board to connect to show the GUI on the display.
I want to have the freedom to rotate the GUI as per the display LCD orientation.
Currently, I can rotate the rectangle defined inside the application window. But the location of the virtual keyboard is staying the same. Assuming that the virtual keyboard is linked with the application window, I was looking to rotate the application window as well.
I taking two approaches here :
- Find a way to rotate the application window.
- Link the virtual keyboard with the rectangle defined inside the application window. The rectangle and keyboard should always be in the same orientation.
Could someone provide me guidance on any of the two approaches? If someone has the solution for both approaches that would be best.
I am using the open-source Qt version 6.7 for development and QtCreator 13.0.2.
-
A total guess; Screen QML contains 'orientation' and 'primaryOrientation'.
https://doc.qt.io/qt-5/qml-qtquick-window-screen.html#orientation-attached-prop
I'm using Qt5.15, so can't offer any real insight. I assume the monitor you are using is able to /does contain an accelerometer and should be able to rotate either dynamically or by code.