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

QHeaderView state incompatible between Qt5/6

    XMLWordPrintable

Details

    • All
    • 07d80deeab (qt/qtbase/dev) 07d80deeab (qt/tqtc-qtbase/dev) 22c19f95d3 (qt/qtbase/6.3) 22c19f95d3 (qt/tqtc-qtbase/6.3) 22c19f95d3 (qt/qtbase/6.3.1) 22c19f95d3 (qt/tqtc-qtbase/6.3.1)

    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

        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
            mbishop Michael Bishop
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews