Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.3.2, 5.9
-
None
-
Linux 4.3.0-1-amd64
Debian 4.3.3-7 (2016-01-19) x86_64 GNU/Linux
Description
The change of orientation is not detected during the execution of the program.
I run the program output Qt::ScreenOrientation(LandscapeOrientation) QSize(1920, 1200) I execute > xrandr -o 1 output Qt::ScreenOrientation(LandscapeOrientation) QSize(1200, 1920) I quit the program I execute > xrandr -o 1 I run the program output Qt::ScreenOrientation(PortraitOrientation) QSize(1200, 1920) I execute > xrandr -o 0 output Qt::ScreenOrientation(PortraitOrientation) QSize(1920, 1200) I quit the program
untitled.pro :
QT += core gui widgets TARGET = untitled TEMPLATE = app SOURCES += main.cpp
main.cpp :
#include <QApplication> #include <QWidget> #include <QScreen> #include <QDebug> class Widget : public QWidget { public: Widget() { m_s = QApplication::screens().first(); startTimer(1000); } private: void timerEvent(QTimerEvent*) { qDebug() << m_s->orientation() << m_s->size(); } QScreen* m_s; }; int main(int argc, char *argv[]) { QApplication a(argc, argv); Widget w; w.show(); return a.exec(); }