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

Size of widgets in QTabWidget is 640x480 before shown the first time

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 5.8.0, 5.9
    • None
    • Archlinux

    Description

      With this example:

      #include <QApplication>
      #include <QString>
      #include <QTabWidget>
      #include <QWidget>
      #include <QTimer>
      #include <QDebug>
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
          QWidget w1;
          QWidget w2;
      
          QTabWidget tw;
          tw.show();
          tw.addTab(&w1, QString("widget 1"));
          tw.addTab(&w2, QString("widget 2"));
      
          QTimer timer;
          timer.setInterval(1000);
          QObject::connect(&timer, &QTimer::timeout, [&w1, &w2]() {
                  qDebug() << w1.size();
                  qDebug() << w2.size();
          });
          timer.start();
      
          app.exec();
          return 0;
      }
      

      the shown size for w2 is 640x480. When focusing it once and switching to w1 again, the correct size is shown.

      This causes this page showing the window size obtained via javascript to show that size in background tabs opened in a QtWebKit/QtWebEngine browser (like the simplebrowser example).

      In my application (which has QWebViews in a layout in a QTabWidget) I also see 100x30 as size, but I don't know where that is coming from.

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              the compiler Florian Bruhin
              Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes