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

Using QDataStream to write and read QPalette objects, and the processing result is different in QT5.7 from Q5.12

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 5.12.4, 5.12.5, 5.13.1
    • 5.12.2
    • Core: Other
    • None
    • All
    • cc4c0b43a54d9606f491c193df381a424ae696bf (qt/qtbase/5.12)

    Description

      I write a QPalette object and save it in a file with QDataStream in Qt5.7. Then I need restore it in Qt5.12. But I found that the read result is wrong.
      I compared the file qpalette.cpp of Qt5.7 and Qt5.12, and I found that there is a problem with the code.
      In the qpalette.cpp of Qt5.12, a new member was inserted before the member NColorRoles of the enumerating variable ColorRole, which made the relationship between

      NColorRoles = ToolTipText + 1 not valid,
      but NColorRoles was used where ToolTipText + 1 should be used in the code.
      Line 1004 and 1042 in qpalette.cpp of Qt5.12:
      Int max = QPalette:: NColorRoles;           the value of max is 21;
      In version 5.7:
      Int max = QPalette:: ToolTipText + 1;       the value of max is 20.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            obsession0918 shenghong liu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes