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

Qt 5 and Qt 6 both use QtProject.conf, but in an incompatible way

    XMLWordPrintable

Details

    • Linux/X11

    Description

      As discussed in this forum post, Qt 6 writes unicode characters to QSettings verbatim, whereas Qt 5 tries to backslash-escape them.

      This causes a problem when there are setting files shared by Qt 5 and Qt 6, e.g. ~/.config/QtProject.conf which is used by QFileDialog. Let’s suppose you have a directory called Música and want to add it to bookmarks in QFileDialog.

      • If you open a Qt 5 app (e.g. Vlc or Krita) and drag that directory to bookmarks, the file will have the following line:
        shortcuts=file:, file:///home/dmitry, file:///home/dmitry/M\xfasica

        After that, if you launch a Qt 6 app (e.g. Kate), it recognizes it correctly but on exit it will change it to

        shortcuts=file:, file:///home/dmitry, file:///home/dmitry/Música
      • However if after opening Qt 6 app you launch a Qt 5 app again, it will not recognize the line, in the dialog it will be grayed out and displayed as Música. And on exit Qt 5 will rewrite that line to
        shortcuts=file:, file:///home/dmitry, file:///home/dmitry/M\xc3\xbasica
      • If you run Qt 5 app, then Qt 6 app, then Qt 5 app again, and repeat this cycle, you will end up with something like
        shortcuts=file:, file:///home/dmitry, file:///home/dmitry/M\xc3\x83\xc2\x83\xc3\x82\xc2\x83\xc3\x83\xc2\x82\xc3\x82\xc2\xbasica

        after a Qt 5 iteration, or

        shortcuts=file:, file:///home/dmitry, file:///home/dmitry/MÃ<U+0083>Â<U+0083>Ã<U+0082>Â<U+0083>Ã<U+0083>Â<U+0082>Ã<U+0082>ºsica

        after a Qt 6 iteration.

      In Debian, I got a bug report with similar content in the file. The file size was 530M and Qt crashed when trying to load it.

      Attachments

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              mandriver Dmitry Shachnev
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There is 1 open Gerrit change