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

QFontInfo::fixedPitch() can report false value

    XMLWordPrintable

Details

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

    Description

      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();
      }

      Attachments

        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
              admin Administrator
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes