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

QFontDialog doesn't accept initial font styleName and return no styleName

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P3: Somewhat important
    • 5.9.0
    • 5.5.1, 5.6.0
    • GUI: Font handling
    • None
    • Ubuntu Linux x64; gcc (Ubuntu 5.3.1-14ubuntu2) 5.3.1 20160413; QMake version 3.0 for Qt 5.6.0 and Qt 5.5.1.

    Description

      QFontDialog called straight ahead or called via static method QFontDialog::getFont with given initial font ignores styleName parameter of passed font.

      It means that when QFontDialog appears, highlighted style differs from previously set fonts styleName.

      Also, when QFontDialog closes, returned font doesn't have selected styleName.

      To reproduce this problem one can do:
      1. Get default system font.
      2. Set some style to this font.
      3. Set this font as initial for QFontDialog.
      4. Verify if style set in (2) will be highlighted in QFontDialog.
      5. Click Ok in QFontDialog to get font.
      6. Verify if returned font contain styleName.

      There is source code in attachment, so anyone can try.

      On my side I got this output:


      Default system font: QFont( "DejaVu Sans,9,-1,5,50,0,0,0,0,0" )
      Available styles for system font: ("Book", "Condensed Bold Oblique", "Condensed Bold", "ExtraLight", "Condensed", "Bold", "Condensed Oblique", "Bold Oblique", "Oblique")
      Chosen style: "Condensed Bold Oblique"
      Bold: false
      Italic: false

      We expect that exactly this style will be selected in QFontDialog.


      Chosen font: QFont( "DejaVu Sans,9,-1,5,50,0,0,0,0,0" )
      Available styles for choosed font: ("Book", "Condensed Bold Oblique", "Condensed Bold", "ExtraLight", "Condensed", "Bold", "Condensed Oblique", "Bold Oblique", "Oblique")
      Chosen style: ""
      Bold: false
      Italic: false

      See a screenshot showing QFontDialog appeared with wrong style highlighted (according to output, expected Condensed Bold Oblique)

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            troyane Nazar Gerasymchuk
            Votes:
            3 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes