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

QWidget initial resize event size is wrong on Android

    XMLWordPrintable

Details

    • Android

    Description

      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)

      Attachments

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

        Activity

          People

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

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes