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

Regression: Font changes depending on the first character

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P1: Critical
    • None
    • 5.2.0
    • GUI: Text handling
    • None
    • Windows 7, Qt 5.2.0, VS2012

    Description

      With Qt 5.2.0 the font of the text changes if a special character is the first one in the text. The code below can be used to reproduce the issue.

      This was working fine with Qt 5.1.0 (the attached image shows the difference between Qt 5.2.0 and Qt 5.1.0).

      The problem was introduced with sha 7b8f33fb78939a7564ce4d06cdbb6a13f00743ca

      #include <QApplication>
      #include <QLabel>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
      
          QLabel* label1 = new QLabel();
          QString text = QString("%1test Öö").arg(QChar(0x25B6));
          label1->setText(text);
          label1->show();
      
          QLabel* label2 = new QLabel();
          QString text2 = QString("test%1test Öö").arg(QChar(0x25B6));
          label2->setText(text2);
          label2->show();
      
          QPoint label1Pos = label1->pos();
          label1Pos.ry() -= 60;
          label1->move(label1Pos);
      
          QPoint label2Pos = label2->pos();
          label1Pos.ry() += 60;
          label2->move(label2Pos);
      
          return a.exec();
      }
      

      Attachments

        1. labels.png
          19 kB
          Qt Support

        Issue Links

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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              qtcomsupport Qt Support
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes