Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.15.7, 6.2.2
-
None
-
-
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:
- 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"); - Build project against Qt5 and run the binary. You should see a table with some data.
- Adjust the table header width so the sizes aren't what they are when you started.
- Quit the app and restart it. The table headers should be in the same place as when you quit.
- Quit the app again.
- 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.
- Quit the app.
- 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 |
411851,1 | QtWidgets: restore Qt 5 compatibility for save/restore state | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: NEW | 0 | 0 |
411852,1 | QtWidgets: restore Qt 5 compatibility for save/restore state | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: NEW | 0 | 0 |
410627,3 | QHeaderView: bump version post QVector->QList change | dev | qt/qtbase | Status: ABANDONED | 0 | 0 |
411136,4 | QtWidgets: restore Qt 5 compatibility for save/restore state | dev | qt/qtbase | Status: MERGED | +2 | 0 |
411848,3 | QtWidgets: restore Qt 5 compatibility for save/restore state | 6.3 | qt/qtbase | Status: MERGED | +2 | 0 |