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

QHeaderView performance when changing the background role

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.13.0 Alpha 1
    • 5.9.4
    • Widgets: Itemviews
    • None
    • All
    • b53f997d8f20938d46b755eca54b4ec9a40e4ffe (qt/qtbase/dev)

    Description

      • Create a table model, with several columns. set SVG icons in the first column (to make the perf issue more visible)
      • Set a header with header->setSectionResizeMode(QHeaderView::ResizeToContents)
      • In the model emit dataChanged(star, end, {Qt::Backgroundrole}) for the full table (to make the perf issue more visible)

      Even though only the background color is changed we enter in an heavy loop that requests the full cell data because the header recompute the width of the column.

      Stack:

       	Qt5Svgd.dll!QSvgHandler::parse() Line 3604	C++
       	Qt5Svgd.dll!QSvgHandler::init() Line 3583	C++
       	Qt5Svgd.dll!QSvgHandler::QSvgHandler(QIODevice * device) Line 3560	C++
       	Qt5Svgd.dll!QSvgTinyDocument::load(const QString & fileName) Line 184	C++
       	Qt5Svgd.dll!loadDocument<QString>(QSvgRenderer * const q, QSvgRendererPrivate * const d, const QString & in) Line 316	C++
       	Qt5Svgd.dll!QSvgRenderer::load(const QString & filename) Line 343	C++
       	qsvgicond.dll!QSvgIconEnginePrivate::loadDataForModeAndState(QSvgRenderer * renderer, QIcon::Mode mode, QIcon::State state) Line 148	C++
       	qsvgicond.dll!QSvgIconEngine::pixmap(const QSize & size, QIcon::Mode mode, QIcon::State state) Line 168	C++
       	qsvgicond.dll!QSvgIconEngine::actualSize(const QSize & size, QIcon::Mode mode, QIcon::State state) Line 119	C++
       	Qt5Guid.dll!QIcon::actualSize(QWindow * window, const QSize & size, QIcon::Mode mode, QIcon::State state) Line 925	C++
       	Qt5Guid.dll!QIcon::actualSize(const QSize & size, QIcon::Mode mode, QIcon::State state) Line 869	C++
       	Qt5Widgetsd.dll!QStyledItemDelegate::initStyleOption(QStyleOptionViewItem * option, const QModelIndex & index) Line 318	C++
       	Qt5Widgetsd.dll!QStyledItemDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) Line 411	C++
       	Qt5Widgetsd.dll!QTableViewPrivate::widthHintForIndex(const QModelIndex & index, int hint, const QStyleOptionViewItem & option) Line 941	C++
       	Qt5Widgetsd.dll!QTableView::sizeHintForColumn(int column) Line 2329	C++
       	Qt5Widgetsd.dll!QHeaderViewPrivate::viewSectionSizeHint(int logical) Line 3807	C++
       	Qt5Widgetsd.dll!QHeaderViewPrivate::resizeSections(QHeaderView::ResizeMode globalMode, bool useGlobalMode) Line 3441	C++
       	Qt5Widgetsd.dll!QHeaderView::resizeSections() Line 1840	C++
       	Qt5Widgetsd.dll!QHeaderViewPrivate::executePostedResize() Line 243	C++
       	Qt5Widgetsd.dll!QHeaderView::sectionPosition(int logicalIndex) Line 683	C++
       	Qt5Widgetsd.dll!QHeaderView::sectionViewportPosition(int logicalIndex) Line 699	C++
       	Qt5Widgetsd.dll!QTableView::columnViewportPosition(int column) Line 2430	C++
       	Qt5Widgetsd.dll!QTableView::visualRect(const QModelIndex & index) Line 2690	C++
       	Qt5Widgetsd.dll!QAbstractItemView::update(const QModelIndex & index) Line 3278	C++
      >	Qt5Widgetsd.dll!QAbstractItemView::dataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight, const QVector<int> & roles) Line 3309	C++
      
      

      Attachments

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

        Activity

          People

            chehrlic Christian Ehrlicher
            cassan Claire Cassan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes