qt5base-lts/examples
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
..
aggregate install a sane top-level examples.pro file 2012-12-11 13:37:57 +01:00
dbus doc: Updated Qt D-Bus Examples. 2014-05-28 16:52:04 +02:00
embedded expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
gui purge vestiges of opengl es 1 support 2014-04-04 19:32:21 +02:00
ipc Doc: Move IPC example documentation 2014-03-27 15:16:20 +01:00
json Add json/savegame example. 2013-08-22 19:14:03 +02:00
network Use QCommandLineParser in example dnslookup. 2014-03-15 10:44:41 +01:00
opengl purge vestiges of opengl es 1 support 2014-04-04 19:32:21 +02:00
qmake Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
qpa skip gui-needing examples with -no-gui 2013-10-11 21:03:34 +02:00
qtconcurrent remove remaining non-concurrent branches from concurrent samples 2013-10-29 15:37:30 +01:00
qtestlib Whitespace cleanup: remove trailing whitespace 2013-03-16 20:22:50 +01:00
sql Doc: Moved Books SQL Example documentation 2013-12-05 14:56:29 +01:00
threads Updated outdated README for thread examples 2014-03-31 12:46:38 +02:00
tools Doc: Fix broken links 2013-11-05 00:29:01 +01:00
touch expand tabs and related whitespace fixes in *.{cpp,h,qdoc} 2014-01-13 22:46:50 +01:00
webkit/webkit-guide Changed digia contact details to */legal, updated licenses 2013-07-20 11:21:46 +02:00
widgets Font Database: Add support for private, system UI font families 2014-08-11 10:46:13 +02:00
xml Doc: moved saxbookmarks example files 2014-07-09 12:17:34 +02:00
examples.pro Doc: corrected link/example errors 2014-01-31 16:18:07 +01:00
README Remove more references to demos. 2011-07-08 15:36:26 +02:00

Qt is supplied with a number of example applications that have been
written to provide developers with examples of the Qt API in use,
highlight good programming practice, and showcase features found in each of
Qt's core technologies.


Documentation for examples can be found in the Examples section
of the Qt documentation.