qt5base-lts/examples/widgets
Gabriel de Dietrich 909d3f5c73 Font Database: Add support for private, system UI font families
We introduce QPlatformFontDatabase::isPrivateFontFamily() to allow
testing for private, system UI font families. Both QFontComboBox
and QFontDialog need to filter out those private font families
which, by definition, should be hidden from the end user.

(The textedit example had to be updated to fix the issue where the
default font would be private. In 5.4, we will be adding an equivalent,
public API in QFontDatabase, and a better solution for the textedit
example and QTexEdit in general).

In particular, on OS X and iOS, private fonts are used for the system
UI font. Those have their font family name prefixed by a dot.
QCoreTextFontDatabase knows about this, and makes sure those are
tested positive as private font families. In order to have a cleaner
layer separation, we moved the QPA theme font resolution from the
platform theme classes into QCoreTextFontDatabase for both Cocoa and
iOS QPA plugins.

In both cases, we use CoreText's CTFontCreateUIFontForLanguage(), that
nicely maps to the HITheme API we were using so far on Mac. That means
one HITheme dependency less. We also cache the font descriptors we get
for these font for each time QCTFD::populateFamilies() gets called.
(While not common, this currently happens in auto-tests, like
tst_QFontDatabase, and could happen in actual applications -- specially
when adding and removing application fonts.)

Change-Id: Ic6f0b60f9f597afee1a43596a669742dc546b97f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2014-08-11 10:46:13 +02:00
..
animation Fix warning about unused member 2014-03-06 12:21:14 +01:00
desktop Remove warnings about examples not running in the Qt Simulator 2013-10-09 21:45:31 +02:00
dialogs Remove warnings about examples not running in the Qt Simulator 2013-10-09 21:45:31 +02:00
doc Merge remote-tracking branch 'origin/stable' into 5.3 2014-06-14 18:11:52 +02:00
draganddrop Remove warnings about examples not running in the Qt Simulator 2013-10-09 21:45:31 +02:00
effects Fix MSVC-warnings about stray */* in sources. 2014-01-24 18:50:05 +01:00
gestures Polish the image gestures example. 2014-03-28 12:59:13 +01:00
graphicsview expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
itemviews Address Book example: Fix QTableView column sorting 2014-07-02 08:41:11 +02:00
layouts expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
mac fix qmaccocoaviewcontainer example 2014-06-05 17:11:58 +02:00
mainwindows Save using a window-modal sheet on Mac OS X. 2014-03-20 12:53:31 +01:00
painting purge vestiges of opengl es 1 support 2014-04-04 19:32:21 +02:00
richtext Font Database: Add support for private, system UI font families 2014-08-11 10:46:13 +02:00
scroller Fix warning about float truncation in scroller example (CLANG). 2013-03-06 21:50:28 +01:00
statemachine Remove warnings about examples not running in the Qt Simulator 2013-10-09 21:45:31 +02:00
tools Doc: correction link, example and parameter issues qtbase 2014-03-10 16:02:19 +01:00
tutorials Update AddressBook Example 2014-04-28 13:54:44 +02:00
widgets Polish the image viewer example. 2014-06-12 14:23:48 +02:00
windowcontainer Introducing QWidget::createWindowContainer() 2013-01-25 14:11:07 +01:00
widgets.pro purge vestiges of opengl es 1 support 2014-04-04 19:32:21 +02:00