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

QHeaderView state incompatible between Qt5/6

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.15.7, 6.2.2
    • Fix Version/s: 6.4.0 Beta1
    • Component/s: Widgets: Itemviews
    • Labels:
      None
    • Platform/s:
      All
    • Commits:
      07d80deeab (qt/qtbase/dev) 07d80deeab (qt/tqtc-qtbase/dev)

      Description

      QByteArray objects created from QHeaderView::saveState() in Qt6 create impossibly wide headers when opened by QHeaderView::restoreState() in Qt5. This creates problems for applications migrating from Qt5 to Qt6.

      There is a project included with this bug which can (and should) be built both on Qt5/6.

      Steps to reproduce:

      1. If it already exists, remove the QSettings file that is made when the application has these values:
        a.setOrganizationDomain("com.example.GadgetTableView"); a.setApplicationName("GadgetTableView"); 
      2. Build project against Qt5 and run the binary. You should see a table with some data.
      3. Adjust the table header width so the sizes aren't what they are when you started.
      4. Quit the app and restart it. The table headers should be in the same place as when you quit.
      5. Quit the app again.
      6. Build project against Qt6 and run the binary. You should see a table with some data. The table headers should be in the same place as when you quit the Qt5 version.
      7. Quit the app.
      8. Start the Qt5 version of the app. The table headers are very very wide because it read the Qt6 table header data incorrectly.

      Expected Behavior:

      Either:

      • The Qt5 application doesn't recognize the Qt6 table header data and so uses the default state
      • The Qt5 application correctly interprets the Qt6 table header data.

        Attachments

        For Gerrit Dashboard: QTBUG-99487
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            mbishop Michael Bishop
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews