Details
-
Suggestion
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.3.0 Beta3
-
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
- duplicates
-
QTBUG-35936 rendering named glyphs (dingbats)
- Reported
- is duplicated by
-
QTBUG-103873 Add font icons support for QQC2 Buttons
- Closed
- relates to
-
QTBUG-35936 rendering named glyphs (dingbats)
- Reported
-
QTBUG-51021 Stock icons
- Open