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

Creating a QSettings instance before QApplication breaks unicode input

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Not Evaluated
    • Some future release
    • 4.5.0
    • Core: Locales (i18n)
    • None
    • Linux, gentoo linux x86, kernel 2.6.28.6, glibc 2.9, xorg server 1.5.3, KDE 3.5

    Description

      I compiled the example application from the attached archive which displays a QLineEdit, started it and entered äöäö.

      This is the example app:

      #include <QLineEdit> 
      #include <QSettings> 
      #include <QApplication> 
       
      int main(int argc, char ** argv) 
      { 
          // swapping the next two lines fixes the bug 
          QSettings qs; 
          QApplication app(argc, argv); 
       
          QLineEdit edit; 
          edit.show(); 
          return app.exec(); 
      } 
      

      The problem is that when a QSettings object is created before QApplication is created, it breaks input of non-latin characters like umlauts ÄÖÜ in many widgets (tried with QLineEdit, QTableView).

      Unicode characters that are not inputted by the user are displayed normally.

      Except for this bug, QSettings works as expected.

      If QSettings requires QApplication to be already created, a corresponding runtime warning and/or a note in the documentation would be very helpful.

      Expected to see:
      Correctly displayed unicode characters

      Got instead:
      Garbage. See screenshot in the archive

      Attachments

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

        Activity

          People

            dzyubenk Denis Dzyubenko (Inactive)
            janichol Andy Nichols
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes