How to rotate a Qt5 application using the linux framebuffer? How to rotate a Qt5 application using the linux framebuffer? linux linux

How to rotate a Qt5 application using the linux framebuffer?


You could handle it on application level. With QML thats easy, but with QWidgets the best I could come up with is to render the Widget on a QGraphicsScene and rotate it like this:

#include "mainwindow.h"#include <QApplication>#include <QGraphicsScene>#include <QGraphicsView>int main(int argc, char *argv[]){    QApplication a(argc, argv);    MainWindow w;    QGraphicsScene *scene = new QGraphicsScene();    QGraphicsView *view = new QGraphicsView();    view->setGeometry(w.geometry());    view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);    view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);    scene->addWidget(&w);    view->setScene(scene);    view->show();    view->rotate(180);    //w.show();    return a.exec();}

It seems a bit glitchy, but you could give it a try.

Also I think the correct syntax is -platform linuxfb:fb=/dev/fb0:rotation=180 note the = instead of :Edit: but that did not make a difference for me either.