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

In some situation width of current widget shows zero

    XMLWordPrintable

Details

    • Windows

    Description

      If a QFrame having a QHBoxLayout with QWidget added to the Layout is set to QScrollArea, the width of added QWidget shows zero in showEvent()

      If the QWidget is set directly to QScrollArea it works but if it is being added through QFrame this does not.

      Attached example reproduces it: 

      Just run the example and in output it will say zero. If you enable #if in line 21 that will work.

      Entire idea to have QFrame is to insert other instances of QWidget (ReplayGroupWidget in example) at runtime in the containerLayout, in  ReplayGroupWidget::showEvent idea is to calculate new width and then call resize so that at run time when widget is added it can be resized accordingly.

      Attachments

        1. my_not_working_case.jpg
          my_not_working_case.jpg
          224 kB
        2. simple_working_case.jpg
          simple_working_case.jpg
          246 kB
        3. qtbug129139.zip
          7 kB
        4. replay2.zip
          4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vgt Eirik Aavitsland
            irfan.omair@digia.com Irfan Omair
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes