How to rotate screen in Qt5
Mobile and Embedded
5
Posts
3
Posters
3.1k
Views
1
Watching
-
[quote author="jseeQt" date="1413804978"]Take a look at QScreen and its transformBetween() function.
This will work as long as you have no desktop enviroment and just one window to show.
You can get a QScreen with QWindow::screen()....[/quote]Thanks.I get a QScreen width qAp->screens(),and get a QTransform with QScreen::transformBetween.I take a look at QTransform ,this class can be used to rotate a pixmap,but how to rotate screen by this QTransform.
-
QScreen *s = app.primaryScreen();
qDebug() << "nativeOrientation: " << s->nativeOrientation(); qDebug() << "orientation: " << s->orientation(); qDebug() << (s->isLandscape(s->nativeOrientation()) ? "nativeOrientation lanscape" : "nativeOrientation not lanscape"); qDebug() << (s->isLandscape(s->orientation()) ? "orientation lanscape" : "orientation not lanscape"); qDebug() << (s->isPortrait(s->nativeOrientation()) ? "nativeOrientation portrait" : "nativeOrientation not portrait"); qDebug() << (s->isPortrait(s->orientation()) ? "orientation portrait" : "orientation not portrait");