Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-51012

QScreen orientation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.3.2, 5.9
    • QPA: X11/XCB
    • 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();
      }
      
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            paeglis Gatis Paeglis
            amnot Mario
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes