<< to CrossControl homepage

Support & Service Center

Rotate a Qt4 application

Printer-friendly versionPrinter-friendly versionPDF versionPDF version

To be able to rotate an application, it must be started with the "transformed" display driver. This is done by adding the "-display transformed" command line option to your application, or by setting the QWS_DISPLAY environment variable.

export QWS_DISPLAY=transformed

By adding the extra option :rot90, it will by default be rotated 90 degrees. Other valid options are rot180 and rot270.

export QWS_DISPLAY=transformed:rot90

To rotate the application in runtime from the source code, use this code:

#include <QWSDisplay>
#include <QTransformedScreen>
 
QWSDisplay::setTransformation(QTransformedScreen::Rot90, 0);
whatever