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

Support Font Icons in QtQuick Controls

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.3.0 Beta3
    • Quick: Controls 2
    • None

    Description

      Currently there is no builtin support for font icons in QtQuick Controls. Font icons are an incredibly popular and convenient way to display scalable graphics. Flutter, another cross-platform UI framework, uses them by default in their examples.

      The wiki article https://wiki.qt.io/Icons_In_Qt_Quick_Controls (2015) concludes that using differently sized bitmap files for icons (i.e. icons/48x48/pencil.png, icons/24x24/pencil.png) was the best choice at the time. I believe the popularity, convenience, and efficiency of font icons deserves consideration in comparison to bitmaps and SVGs.

      Trying to use an icon set like Material Icons or FontAwesome using bitmaps is not convenient or space efficient. You have to download hundreds of different files and place them in the correct directories. Using SVG is slightly better but SVGs are not known for their performance and you still have to download separate files. Loading all of these different files also decreases startup and compilation speed.

      Using an icon font you can bundle hundreds of icons in a few dozen kilobytes. In my own experiments, font icons using Qt's distance field rendering out perform SVGs and look better on HiDPi displays at certain sizes. Qt's font rendering has also seen many improvements since 2015 and I think some of the arguments raised in the article have been invalidated.

      Possible solutions:

      • Glyph: a new QQuickItem that bypasses document layouting to render a single glyph
      • Image provider: an image provider that uses QPainter to paint text

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              jeremykim232323 Jeremy Kim
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes