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

QLabel::setFont() strange behavior

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.3, 5.15.0
    • Fix Version/s: None
    • Component/s: GUI: Font handling
    • Labels:
      None
    • Environment:
      Windows 10 1809 Pro x64
      Qt 5.12.3 MSVC 2017 x64, Qt 5.12.3 mingw 7.3 x64
    • Platform/s:
      Windows

      Description

      QLabel::setFont() has different behavior depending on how and when  it called. It works correctly only after selecting font using QFontDialog, in other cases (font was deserialized from config, for example) - it looses some font attributes even these attributes are present in deserialized font.

      Applying deserialized font (read from config) from constructor looses `styleName` font attribute, but doing the same on button click (but NOT doing it from constructor, i.e. label has default font) lead to visually correct effect, but QLabel::font() reports NO styleName field set...

      see comments in attached sample app and screenshots.

        Attachments

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

          Activity

            People

            Assignee:
            esabraha Eskil Abrahamsen Blomfeldt
            Reporter:
            nick-korotysh Nick Korotysh
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes