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

QFontInfo::fixedPitch() can report false value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P2: Important P2: Important
    • 4.6.0
    • 4.3.0
    • GUI: Font handling
    • None
    • 295250 295253

      QFontInfo::fixedPitch can return true for fonts which are not fixedPitch.

      On Windows (with a proportional default font) the following creates a UI with Courier New as expected, on X11 (SuSE Linux 10) this prints the debug statement instead.

      include <QtGui>

      int main(int argc, char *argv[])
      {
      QApplication a(argc, argv);

      QFont font;
      font.setFixedPitch(true);

      QFontInfo fontInfo(font);
      if (fontInfo.fixedPitch())
      qDebug() << "default font exists in fixed pitch";
      else

      { font = QFont("Courier New", font.pointSize()); a.setFont(font); }

      QTextEdit edit;
      edit.show();

      return a.exec();
      }

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

            esabraha Eskil Abrahamsen Blomfeldt
            admin Administrator
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes