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

QFontMetrics returns incorrect elided text

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.3.1
    • GUI: Font handling
    • None

    Description

      QFontMetrics returns the wrong elided text sometimes, perhaps when the original text only has one character.

      When the original text is "5" and give rect width is 5, it returns elided text "5", but it should return an empty string, because by calling `horizontalAdvance` to get the full width of text "5", it actually returns 10. 

       

      The minimal sample code is provided below, you can see that the elided text is truncated 

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            qihao Qihao Cheng
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes