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

If returned font is empty, QHeaderView clips lower part of letter g y p and q

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 4.8.5
    • None
    • windows

      Returning empty font for Qt::FontRole from Model::headerData() is causing header view to clip letter, g p q etc.
      If we return empty QVariant()it works good.

      Attached address book example reproduces this.
      I have simply replaced the headerData()of tableModel to see the issue.

      by the way following code does work good

      QFont fs;
          fs.setBold(true);
          QFont fs2 = qApp->font();
          fs2.setBold(true);
          QVariant v = QVariant::fromValue(fs);
          QVariant v2 = QVariant::fromValue(fs2);
          QFontMetrics fm(qvariant_cast<QFont>(v));
          QFontMetrics fm2(qvariant_cast<QFont>(v2));
          qDebug() << (qvariant_cast<QFont>(v) == qvariant_cast<QFont>(v2)) << (fm.size(0, "gggg") == fm2.size(0, "gggg"));
      
      

        1. addressbook.zip
          20 kB
        2. Tableviewhead.jpg
          Tableviewhead.jpg
          11 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes