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

QWidget initial resize event size is wrong on Android

XMLWordPrintable

    • Android

      When the program starts, the last initial QResizeEvent is not correct on Android. I have to rotate the phone before I get the right dimensions. I have tested this on Debian 9, iOS and MacOS, all return the correct last initial QResizeEvent except Android. This issue happens with both a QWidget or QMainWindow as the primary window. A QBoxLayout is added via the QWidget's installEventFilter() to grab the resize. (example code attached.)

      Output from attached code on Android....
      // start app (should be portrait dimensions)
      D libRotate.so: ../rotate/mylayout.cpp:15 (virtual bool myLayout::eventFilter(QObject*, QEvent*)): QSize(48, 48)
      // last initial QResizeEvent - should be portrait dimensions
      D libRotate.so: ../rotate/mylayout.cpp:15 (virtual bool myLayout::eventFilter(QObject*, QEvent*)): QSize(48, 48)
      // then rotate to landscape
      D libRotate.so: ../rotate/mylayout.cpp:15 (virtual bool myLayout::eventFilter(QObject*, QEvent*)): QSize(1776, 1008)
      // then rotate to portrait
      D libRotate.so: ../rotate/mylayout.cpp:15 (virtual bool myLayout::eventFilter(QObject*, QEvent*)): QSize(1080, 1704)

        1. mylayout.cpp
          0.4 kB
          Jon
        2. mylayout.h
          0.2 kB
          Jon
        3. rotate.pro
          0.3 kB
          Jon
        4. main.cpp
          0.4 kB
          Jon
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qtandroidteam Qt Android Team
            drwho Jon
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes