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

The width of the rect returned by QFontMetrics::boundingRect(QString) is to small on Mac OS X

    XMLWordPrintable

Details

    • macOS

    Description

      The boundingRect() overloads return rects with different widths. Reproduced on OS X Leopard with Qt 4.5-main

      Code:
      QString string = QString::fromUtf8("ششسييبزشسيث");
      QFontMetrics fm((QFont()));
      qDebug() << fm.boundingRect(string);
      qDebug() << fm.boundingRect(0,0,0,0,0, string);
      qDebug() << fm.boundingRect(QRect(),0, string);

      Output:
      QRect(0,-13 39x16)
      QRect(0,0 74x17)
      QRect(0,0 74x17)

      QFontMetrics:width() also returns 39.

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            sorvig Morten Sørvig
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes