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

QWidget::render() works very slow if placed in stacked layout with item views that have QHeaderView (e.g. QTableView or QTreeView)

    XMLWordPrintable

Details

    • All
    • 4422a9bd88602c8dfde8648ad39692d968295cfc (qt/qtbase/5.14)

    Description

      In our applications we add shadows to buttons using QWidget::render() method.

      After upgrade from Qt 5.9 to 5.12 we found, that frames/layouts that contain such shadowed buttons are slow to be shown or re-painted if such frames/layouts are placed together in some kind of UI hierarchy (e.g. stack) with (even empty) item views (e.g. QTableView/QTreeView) that have QHeaderView (even invisible).

      After time profiling of QWidget::render() code we found that root of slowness is calling 'sendPendingMoveAndResizeEvents' for application top level window (and as result for all its children, even invisible) in QWidgetPrivate::prepareToRender.
      This code is quite debatable as we don't see the reason to push resize events to invisible widgets and looks like main root of the problem. Could you explain why it is so?
      But this code was the same even in Qt 5.9.

      The actual root of explained regress is the fix for QTBUG-67532/QTBUG-34095, that introduces emitting 'geometryChanged' on reacting on QEvent::Resize in QHeaderView::viewportEvent. Earlier this event type was ignored in this place.

      Please find attached sample project demonstrating problem.

      Do you think QWidget::render function could be reviewed in part of sending resize events to invisible top level application window children?

      Attachments

        Issue Links

          Activity

            People

              chehrlic Christian Ehrlicher
              viktor.kolesnyk Viktor Kolesnyk
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: