Qt6 QScreen setOrientationUpdateMask()
-
I use b2qt distro.
My app is QML based. I need rotate context of the screen by 90degree. I have not accelerometer in my system and screen must be rotated all time.
After googling I found such example codeQScreen* screen = QGuiApplication::primaryScreen(); if(screen){ screen->setOrientationUpdateMask(Qt::PortraitOrientation); }
but it not compile on QT6.
What is a proper way to hardcode screen orientation for QT6 app? -
I use b2qt distro.
My app is QML based. I need rotate context of the screen by 90degree. I have not accelerometer in my system and screen must be rotated all time.
After googling I found such example codeQScreen* screen = QGuiApplication::primaryScreen(); if(screen){ screen->setOrientationUpdateMask(Qt::PortraitOrientation); }
but it not compile on QT6.
What is a proper way to hardcode screen orientation for QT6 app?After some research I do
Window {
id: root
contentOrientation: Qt.InvertedLandscapeOrientation
visible: trueRectangle{ id: root_w width: 1920 height: 1200 transform: Rotation { angle: 270 origin.x: root.height / 2 origin.y: root.height / 2 }
// code here
} -