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

Incompatibility between QHeaderView saved state in Qt5 and Qt4 causes bad behavior

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Cannot Reproduce
    • Affects Version/s: 4.8.4, 5.0.1, 5.1.1, 5.2.1
    • Fix Version/s: None
    • Component/s: Widgets: Itemviews

      Description

      I save the state of QTreeWidget headers to the registry using QSettings, by calling QHeaderView::saveState(). On start up the application reload the state them if it is available.

      If the header view state is saved using a Qt4 version of the application and loaded using a Qt5 version of the application or vice-versa, the stored data is read incorrectly and the view misbehaves. E.g., some columns are badly sized, and locked (can't be resized or moved or sorted). The scroll area is miscalculated so scrollbars don't activate when they should so many columns can't even be accessed by the user. Wiping out the relevant information from the registry makes everything work properly again.

      The default behavior should be to ignore the byte array and not use it to load the state if it the state version is incompatible.

        Attachments

        1. main.cpp
          0.9 kB
        2. patch.diff
          0.7 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            qtcomsupport Qt Support
            Reporter:
            bchaudhuri bc
            Votes:
            2 Vote for this issue
            Watchers:
            11 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes