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

QTableView auto-section-resize broken since Qt 6.9

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.9.0
    • Widgets: Itemviews
    • None
    • Linux/X11

    Description

      It seems that as a result of 9e3a96189d9db8a458e65cd5078509afe7a160db, the sections of a QTableView are no longer automatically resizing when their size hint is changed before calling QAbstractItemView::scheduleDelayedItemsLayout and optionally QAbstractItemView::executeDelayedItemsLayout.

      Some debugging revealed that this is likely due to QHeaderViewPrivate::hasAutoResizeSections returning false since its contentsSections value remains on 0 rather than reflecting the number of actual sections (since it now only updates QHeaderViewPrivate::countInNoSectionItemsMode). This in turn causes QHeaderView::updateGeometries not to call QHeaderViewPrivate::doDelayedResizeSections, which means that eventually in executePostedResize the delayedResize.isActive() check fails.

      I don't have a small example to reproduce this problem, but I do have an application which is now broken on Arch Linux and Fedora since they've already updated to Qt 6.9 and users are now running into this issue: https://github.com/mapeditor/tiled/issues/4191

      Attachments

        1. CMakeLists.txt
          0.6 kB
          Thorbjørn Lindeijer
        2. main.cpp
          4 kB
          Thorbjørn Lindeijer
        For Gerrit Dashboard: QTBUG-136453
        # Subject Branch Project Status CR V

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            bjorn Thorbjørn Lindeijer
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes