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

[regression 5.12.3 - > 5.12.4] crash in qwidgetbackingstore (qt_scrollarea_viewport) in QListView

    XMLWordPrintable

Details

    • All
    • deac052a40c93633041da058d5c73c9e91aa76c7

    Description

      Qt crashes if a QListView (or QListWidget) is scrolled when the containing window (QWidget) is opened another time. Opening the containing QWidget the first time scrolling a QListView (or QListWidget) works fine.

      Crash in class: QWidgetBackingStore
      function: markDirtyOnScreen(const QRegion &region, QWidget *widget, const QPoint &topLevelOffset)
      line: 727

      from QWidgetBackingStore.cpp

              QWidget *nativeParent = widget->nativeParentWidget();        // Alien widgets with the top-level as the native parent (common case).
              if (nativeParent == tlw) {
                  if (!widget->testAttribute(Qt::WA_WState_InPaintEvent))
                      dirtyOnScreen += region.translated(topLevelOffset);
                  return;
              }        
      
              // Alien widgets with native parent != tlw.
              QWidgetPrivate *nativeParentPrivate = nativeParent->d_func();
      

      nativeParent seems to be null.

       

      from QWidget (nativeParentWidget might return 0):

      QWidget *QWidget::nativeParentWidget() const
      {
          QWidget *parent = parentWidget();
          while (parent && !parent->internalWinId())
              parent = parent->parentWidget();
          return parent;
      }
      /*! 
          \fn QWidget *QWidget::parentWidget() const 
      
          Returns the parent of this widget, or 0 if it does not have any parent 
          widget. 
      */
      

       

      steps to reproduce with attached example (scrollview-example.zip)
      (tested on macos, windows):

      1) run the project with Qt 5.12.4
      2) click on "Open Window"
      3) in the new window press button "add" multiple times until the listview scrolls
      4) verify scrolling works fine
      5) close the window
      6) press button "Open Window"
      7) try to scroll -> crash

       

      Attachments

        1. stack.tasks
          4 kB
        2. scrollview-example.zip
          4 kB
        3. backtrace.rtf
          54 kB

        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
              i.n.g.o. Ingo Randolf
              Votes:
              4 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes