Commit Graph

31917 Commits

Author SHA1 Message Date
Tor Arne Vestbø
5ad2e1cea1 Populate application fonts via font descriptors on Apple platforms
Instead of registering the font via CTFontManagerRegister we just create
a font descriptor for the data/URL and populate that like normal system
fonts. This makes the code more similar to how we deal with other fonts,
shaves off a ms during font registration due to not registering the font,
and fixes an issue on iOS where CTFontManagerRegister would invalidate
earlier populated system font descriptors.

Task-number: QTBUG-56765
Change-Id: I002a65075b15837c9a2d22573020d4c834111837
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-04-11 09:23:44 +00:00
Eskil Abrahamsen Blomfeldt
17fc188aec Implement maxCharWidth() for DirectWrite engine
This is used to create the bounding box in QFontEngine::properties(), which
in turn is used for the FontBBox when generating PDFs. The result was that
the bounding width in the output was 0 and Adobe Reader complained that the
PDF was malformed. We could implement the proper bounding rect in properties()
at some point, instead of assuming an origin at x = 0 for instance. The
metrics for that are in the head table. But for silencing the warning in
Reader, just implementing the maxCharWidth() function is sufficient.

[ChangeLog][Windows][PDF] Fixed a bug in PDF output when using high-dpi
scaling which was causing the display of warnings when opening the
file in Adobe Reader.

Task-number: QTBUG-58954
Change-Id: I2540571863d4dd0f85af533b591f75dad3f0d75b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-04-11 08:01:44 +00:00
Marc Mutz
da1be671cf QtTest: add toString(QUuid)
[ChangeLog][QtTest] QUuids are now printed on failure.

Change-Id: I39a7b9169aef8ab6ef5ce0790920547af23bd1b9
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2017-04-11 07:34:38 +00:00
Thiago Macieira
d5f62f7bc7 Ask MS runtime to reload the timezone details if they've changed
POSIX documents that localtime() ensures that tzset() has been called,
but the wording could be understood to mean that it only needs to do so
the first time. Anyway, we're sure that the MS runtime only gets the
timezone information from the Control Panel once. That means Qt-based
applications will not react to a change in the timezone.

Attempt to do that by moving tzset() out of the #if, to apply to all
operating systems.

Task-number: QTBUG-60043
Change-Id: I6ab535fb61094af19fc1fffd14b413541fe5a64c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-11 06:45:41 +00:00
Thiago Macieira
dbea118f12 gtk3: Mark the minimum version we support
This suppresses warnings for API that is deprecated. Gtk often marks API
like:

GDK_DEPRECATED_IN_3_22_FOR((gtk_menu_popup_at_widget, gtk_menu_popup_at_pointer, gtk_menu_popup_at_rect))
void	   gtk_menu_popup		  (GtkMenu	       *menu,

Which generates this (found with ICC, accidentally an error):
 qgtk3menu.cpp(449): error #1786: function "gtk_menu_popup" (declared at line 138 of "/usr/include/gtk-3.0/gtk/gtkmenu.h") was declared deprecated ("Use '(gtk_menu_popup_at_widget, gtk_menu_popup_at_pointer, gtk_menu_popup_at_rect)' instead")

The warning is generated by GDK_DEPRECATED_IN_xxxx_FOR when
GDK_VERSION_MIN_REQUIRED is higher than xxxx. And by default,
unlike the Qt equivalent macros, the minimum version required
is equal to the current version.

The minimum version our support requires is 3.6, as we depend
on gtk_accel_label_set_accel, which was first introduced in
that version.

Change-Id: I27b55fdf514247549455fffd14b1c47e470510b2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-11 06:44:20 +00:00
Thiago Macieira
e7493c8b54 tst_qhashfunctions: Test non-zero seeds too
Change-Id: Ib0e40a7a3ebc44329f23fffd14b2e927021a1a2e
Reviewed-by: David Faure <david.faure@kdab.com>
2017-04-11 06:38:14 +00:00
Oliver Wolff
2019e78d87 qmake: Do not mix canonical and non canonical paths
When having Qt sources in a symbolic link "shadowed" did not work
because _PRO_FILE_PWD_ used canonical path, while source_root did not.
Due to this mix it was possible that shadowedPath did not find any
"common denominator" and always returned and empty string. The first
place where things broke was while running config.tests.

Task-number: QTBUG-59319
Change-Id: If73ecbc58290ee9113f887a73c312ebfb5e20a33
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-11 05:37:52 +00:00
Marc Mutz
46c66bce5d Optimize QLoggingSettingsParser
Factor the line parsing into a separate function, parseNextLine(),
taking a QStringRef.

In setContent(QTextStream&), use the new readLineInto() function to
re-use the capacity of a single QString for all lines.

In setContent(QString), use splitRef() to split the lines.

In either function, pass each line to parseNextLine().

In order to port all the parsing to QStringRef, I needed to make some
semantic changes: the old code removed all whitespace right at the
beginning. This is not possible with QStringRef. It also didn't feel
right, since a line like

   [    r u  l e s ]

would successfully parse as the section named "rules".

I added trimmed() calls at the beginning, and around the valueStr and
pattern extraction, which should be good enough.

Also, when a section is found, don't store it anymore. Instead, only
store whether it was the [rules] section, because that's all we'll
test for. That way, we don't have to convert QStringRefs to QString
just to store them across parseNextLine() calls.

Replace the setSection() function with setImplicitRulesSection(),
because "rules" is all that was ever passed.

This is private API, we can bring back some of the dropped flexibility
later, as needed.

[ChangeLog][Important Behavior Changes] Logging rules can no longer
contain arbitrary whitespace such as within a category identifier.

Change-Id: Ic26cd23c71f5c810b37ef4b972354ac31d3408fe
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2017-04-10 14:54:31 +00:00
Marc Mutz
db29042588 QQnxWindow: replace QUuid::toString().toLatin1() with QUuid::toByteArray()
UUIDs are always US-ASCII.

Change-Id: I335882a2df179204d8eca1cf9f02bc6473bac700
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-10 14:30:07 +00:00
Daniel Teske
88d3195164 QWindowsPrintDevice: Handle 0 from DocumentProperties correctly
Task-number: QTBUG-55090
Change-Id: I5fadd0f007c826ab6747f319dbf3eaee5f208a44
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
2017-04-10 14:27:46 +00:00
Ulf Hermann
49fea13e6d Load android-specific target override in resolve_target
Otherwise, in separate_debug_info.prf, we try to process the original
target, which is not what we actually build.

Task-number: QTBUG-59779
Change-Id: I2b2d2e7b5f87041cc51075da7c3a5b690f94f1f3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-10 10:41:44 +00:00
David Faure
c0ecfc08e3 QTextDocument: improve import of DIV tags
<div>1<br/></div>2 was inserting two newlines between 1 and 2, while all
tested web browsers only insert one newline - as long as there is nothing
between the <br/> and the </div>.

This was the cause for extra newlines being inserted in KMail when
replying to HTML emails, such as those generated by gmail.

Change-Id: I5145d977701e68913264357bba22780e7cdd3f7d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-04-10 09:44:01 +00:00
Maurice Kalinowski
45862976b7 winrt: Fix build for Windows 10 Creators Update
Phone specific UI colors have been removed from the windows headers.
Continue to use the enum values does not gain anything as the native
calls return errors for those. Actually they did that already with
14393.

Change-Id: I4b04d3af319766216ae7c550af704aab488c1d15
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2017-04-10 07:02:06 +00:00
Heiko Becker
43a5fe258b Update attribution file for changed command line param
47c4d1378c changed the configuration
command line parameter back to pcre, omitting the "2" which has
been added after porting to PCRE2.

Change-Id: Iadbd57725ab706cb4bae89c2decf8259bcad46b5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2017-04-07 21:05:47 +00:00
Thiago Macieira
23d08ce2ed Fix QDir::mkpath() when the path contains "symlink/../"
It is incorrect to collapse a "symlink/.." segment because the parent
directory of the symlink's target may not be the directory where the
symlink itself is located.

[ChangeLog][QtCore][QDir] Fixed a bug that caused QDir::mkpath() to
create the wrong directory if the requested path contained a symbolic
link and "../".

Change-Id: Iaddbecfbba5441c8b2e4fffd14a3e367730a1e24
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2017-04-07 20:26:02 +00:00
J-P Nurmi
49163ca689 Android: fix Menu and Back key handling
Don't quit on Back key release when Back shortcut was accepted and
likewise for the Menu key, don't trigger the platform menubar if Menu
shortcut was accepted.

Change-Id: Ifde87cbc2d95be1beb90ca59f55889b83a90ff02
Task-number: QTBUG-59670
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-07 18:08:58 +00:00
Thiago Macieira
3d7c4e064f Support different job counts also for ICC LTO
Change-Id: I27b55fdf514247549455fffd14b1cdbd2980d5d6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-07 17:45:04 +00:00
Thiago Macieira
795a54ff96 QDataStream: add operator<< and >> for std::nullptr_t
std::nullptr_t is nullary: it accepts only one value, nullptr. So we
don't need to read or write anything. This commit simply adds the two
operators that allow generic code to operate on std::nullptr_t if
required.

This commit also adds the actual use to QMetaType::load/save, even
though there's no change in behavior.

[ChangeLog][QtCore][QDataStream] Added operator<< and operator>>
overloads that take std::nullptr_t, to facilitate generic code.

Change-Id: Iae839f6a131a4f0784bffffd14aa37e7f62d2740
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-07 17:41:06 +00:00
Marc Mutz
25d1bbb849 examples: remove some unneeded QStringRef::toString() calls
- when appending to another string
- when just comparing
- when just calling toInt()

Change-Id: I6960784569b83bfd3e3640a8c04f2f909c293449
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-07 14:35:04 +00:00
Friedemann Kleint
f497dea730 Doc: Clarify the porting notes from QRegExp to QRegularExpression
Add a small table to illustrate the results exactMatch() and split
out the part on partial matching to a separate section since it
is less common.

Change-Id: Ifbd5c3cbd1d8c0ee9e8b2d58ed13f40776b03762
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2017-04-07 11:52:01 +00:00
Sami Nurmenniemi
ac76b2424d tst_qmessagehandler: fix qMessagePattern for arm
Backtrace logging tests were not passing for arm. Added compile option
-funwind-tables to support backtrace on arm.

Task-number: QTBUG-59966
Change-Id: I5e2443b1e3a644a239dab68db990e75ae8fade24
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-07 08:12:14 +00:00
Sami Nurmenniemi
c7e7a785c6 tst_QFocusEvent: Fix checkReason_ActivateWindow for offscreen and minimal platforms
Widgets in platforms offscreen and minimal don't get focus back
automatically after hiding focused window. Extra activateWindow
is needed.

Task-number: QTBUG-59966
Change-Id: Iaf3d4e60483c4b2600472af199f7a7cd51b3fa6e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2017-04-07 08:11:54 +00:00
Sami Nurmenniemi
bbb67ca32c Fix tst_Collections for gcc/arm
- Alignment test was not compiling or passing on GCC / arm
- Using C++11 alignas() enforces maximum limit for the alignment, which
  at least on GCC / arm is __BIGGEST_ALIGNMENT__ multiplied by 8
- On GCC 6.2.0 / x86_84, maximum alignment accepted by alignas is 128
- On GCC 5.3.0 / arm, maximum alignment accepted by alignas is 64
- This change calculates biggest tested alignment on ARM targets
  and compilers supporting alignas() to the value calculated
  from __BIGGEST_ALIGNMENT__

Task-number: QTBUG-55492
Change-Id: If2b70000ff9cdc5ae8c5a00e39f79efcc6ba1221
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-07 05:54:04 +00:00
Sami Nurmenniemi
5c6d132408 Fix tst_QDirModel for qemu
QTBUG-43818 does not affect only Android, it can be reproduced also
with qemu.

Change-Id: I6364c09b3c7f860b34899e26056ad562b7c338f2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-04-07 05:53:47 +00:00
Sami Nurmenniemi
0624085b73 Don't set margin on offscreen window if it has a parent
Offscreen platform had window frame margins set to 2 by default unless
Qt::FramelessWindowHint had been set. Margins must not be set to 2 if
the window has a parent. This change fixes two tests in
tst_QWindowContainer for offscreen platform.

Change-Id: Ib1577c301ea3a3b240bfa7c46ff12510dd2bcef0
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2017-04-06 13:29:01 +00:00
Liang Qi
c50f6a8329 Merge "Merge remote-tracking branch 'origin/5.8' into 5.9" into refs/staging/5.9 2017-04-06 14:35:54 +00:00
Sami Nurmenniemi
60f6e4428f Fix tst_QFile for qemu
Qemu does not report /proc/self/maps size correctly. Added expected
failure for it

Change-Id: I4019884702b8f9a33717b02e79c9e0c042b2449f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-06 12:19:55 +00:00
Sami Nurmenniemi
42b3ed763f Fix network tests on qemu/arm
Function if_indextoname fails on qemu because SIOCGIFNAME is not
supported. Expect failure if emulation is detected.

Change-Id: I53b41286d82458661e7fa723af385f323582ce7e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-06 12:19:46 +00:00
Liang Qi
0fc569184c Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
	src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
	src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp
	src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp
	src/widgets/widgets/qtabbar.cpp

Change-Id: Iaa9daee5f7a6490d56257a3824730a35751ceb05
2017-04-06 14:16:31 +02:00
Rainer Keller
4387202f31 eglfs: Show error details when JSON parsing failed
Change-Id: I1a92da5b2ed0b8064efa37c43d7894c212073b60
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2017-04-06 08:47:03 +00:00
Kai Koehne
65a551816f Replace last occurrences of LGPL3, LGPL3-COMM headers
Change-Id: I0e967120d7bdfa00f110b49e6c65d8c6f9b329aa
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2017-04-06 08:13:54 +00:00
Thiago Macieira
280e321e52 Fix detection of F16C for the Intel compiler (again) and Visual Studio
Neither the Intel compiler nor Visual C++ have a dedicated switch to
enable F16C support, like GCC and Clang do. So we used the AVX switch
for that in commit 8241d51f70, as it was
the closest, lowest denominator. That was incorrect and insufficient.

The Intel compiler silently miscompiles the intrinsics with -xAVX,
making calls to out-of-line functions like _mm_cvtps_ph, which don't
exist. So we actually have to use AVX2 support to generate correct code.
That might be a problem later, since Ivy Bridge supports F16C but not
AVX2.

Visual C++ is able to generate F16C code with just -arch:AVX.

Either way, since there's no dedicated command-line switch, there's also
no dedicated preprocessor macro. We're using __AVX2__ for both
compilers, as that's a sufficient condition to indicate a processor that
supports F16C.

Change-Id: I27b55fdf514247549455fffd14b205b8d8b86da7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-04-06 04:15:07 +00:00
Thiago Macieira
c817b33b45 f16c: Use the packed intrinsics instead of scalar ones
MSVC, Apple's Clang and Clang prior to 3.9 do not recognize _cvtss_sh
and _cvtsh_ss. So expand the operation to use directly the packed
intrinsics.

Change-Id: I27b55fdf514247549455fffd14b2046fd638593d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2017-04-06 04:15:04 +00:00
Thiago Macieira
264d814773 Fix GCC warning about dereferencing type-punned pointers
GCC is wrong. Type-punning is when you read something of a given
type as something else. We're not doing that, as it's only read
as integer.

 qnativesocketengine_unix.cpp:1011:79: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]

Too bad my plan for a good C++ solution was foiled by glibc
developers.

Change-Id: I27b55fdf514247549455fffd14b1a27667745e94
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-06 04:14:58 +00:00
Thiago Macieira
b3f474d620 QSysInfo: update the ICC warning that needs to be suppressed
qsysinfo.h(235): error #1786: enum "QSysInfo::MacVersion" (declared at line 156) was declared deprecated ("Use QOperatingSystemVersion")

Take this opportunity to merge the two groups.

Change-Id: I27b55fdf514247549455fffd14b1c2a1d8eab869
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-04-06 04:14:55 +00:00
Thiago Macieira
71649e2168 Fix build when SCTP is enabled
c0157a9f03 was incomplete.

Change-Id: I27b55fdf514247549455fffd14b158f54403663d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2017-04-06 04:14:41 +00:00
Tor Arne Vestbø
fb38db29e1 Consider ENXIO (No such device or address) reason to check isatty()
Aligns with EPERM (Operation not permitted) and ENOENT (No such file
or directory), and is what errno is set to on macOS when opening the
/dev/tty device when running inside e.g. Xcode, where isatty() will
return true.

Change-Id: I09b88eaa3ff611d95ab37f0ff4df9aaaca52747d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2017-04-05 11:51:15 +00:00
Allan Sandfeld Jensen
efb84b6189 Copy stretch to multifont fontDef
If we do not the fontDef of the multifont will be the default 0.

Task-number: QTBUG-59443
Change-Id: Ib223517975b2a57b2371e309d12cd8f918d30825
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-04-05 11:27:15 +00:00
Tony Sarajärvi
63ef26d583 Extend blacklisting of a tst_QMenuBar's test to cover Ubuntu 16.04
tst_QMenuBar::taskQTBUG4965_escapeEaten() already failed on
Ubuntu 14.04 and reproduces in 16.04.

Task-number: QTBUG-24326
Change-Id: I46170c9ce397f4042b308ca485b19364e6ee0663
Reviewed-by: Liang Qi <liang.qi@qt.io>
2017-04-05 10:31:00 +00:00
Allan Sandfeld Jensen
b67b80b715 Fix stretch of QRawFonts
Set stretch to always have no transform on raw fonts.

Task-number: QTBUG-59799
Change-Id: Ibfacc5c247e0b4a8410572e207f09f6e67b74f9d
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2017-04-05 10:26:14 +00:00
Marco Martin
9ae028f507 Environment variable enabling the workaround FBO readback bug
On some ARM devices the font glyph generation is broken
Add an environment variable to enable workaround_brokenFBOReadBack
in QOpenGLContext, to fix font rendering on such devices as
Mali and Adreno

Change-Id: I9cc99ecb8b71a35bc369ec9dd11b877016b1179e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2017-04-05 10:04:54 +00:00
Samuli Piippo
3096e0fbd9 qnx: make alloca config test pass on QNX 7
Test failed on QNX 7, even though alloca is available. On QNX7,
it's a macro that expands to a line with NULL, but without define
for it.

alloca.cpp:44:5: error: 'NULL' was not declared in this scope

Task-number: QTBUG-59700
Change-Id: I3631d139990020a3adbab8b72e49929b6e721e80
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2017-04-05 05:02:42 +00:00
Timur Pocheptsov
ce2771c71c QNetworkRequest - do not set ManualRedirectPolicy
If QNAM's general policy is 'Manual' and QNetworkRequest has neither
policy set not FollowRedirectAttribute - do NOT set this 'Manual' policy -
its implicitly implied. This fixes previously unnoticed auto test failure
(was blacklisted) and also makes QNetworkRequest::operator == work correctly.

Change-Id: If17c9af4baf8a470659f82d1a40488078ea8ede0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-04-04 16:42:10 +00:00
Hendrick Melo
6b52039866 qbmphandler fix: use qint64 for caching QIODevice file position
Changed the file position and offset types so they can properly handle
files larger than the 32bit limit

Task-number: QTBUG-59493
Change-Id: I00e1741c7682c4c79f35fef808fe1ea26e67c8b5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Hendrick Melo
2017-04-04 16:25:33 +00:00
Jesus Fernandez
83486f362b Adds a note to QSqlDatabase::~QSqlDatabase documentation
When the last QSqlDatabase object is destroyed the destructor implicitly
calls close() to release the database connection.

Task-number: QTBUG-59919
Change-Id: I04c15c4999cdaaa8800a44a1a1006f977a90d8a6
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2017-04-04 15:52:33 +00:00
Tor Arne Vestbø
1b2234c4e7 macOS: Remove un-needed fontDef assignment in QCoreTextFontDatabase
The QCoreTextFontEngine constructor already sets the member (like it should).

Change-Id: I6e59ff36c439857418a636de4056c20d2f65e8d4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-04-04 15:14:35 +00:00
Tor Arne Vestbø
5b41b34958 macOS: Use NSURL to resolve FreeType font names instead of CoreFoundation
Change-Id: I4b397361c483fa07e4e95288f66d7f7ea2df8d9f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-04-04 15:14:22 +00:00
Tor Arne Vestbø
a7fe6ab891 macOS: Use shared code path for creating FreeType font engine for QRawFont
The round trip via a CGFontRef to a CTFontRef so that we could pull out
the kCTFontURLAttribute of the font makes no sense, as the input is just
raw font data. None of the tst_QRawFont tests are able to pull out a
URL, and none of the other platforms where FreeType is available resolve
a filename from raw fonts.

Without this change the tst_QRawFont test has 13 failed test cases and
spits out 1250 QWARNs. With the patch all tests pass without warnings.

Change-Id: I17965e7405d7161958ff0870825ce8190598288f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-04-04 15:02:13 +00:00
Tor Arne Vestbø
6c547142d5 Move FreeType font engine creation for QRawFont into factory function
So that the logic can be used without subclassing the FreeType font database.

Change-Id: Ib1ac0e1948ce18003b8eda0c1e8fbb3c7e6c8360
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-04-04 15:01:43 +00:00
Tor Arne Vestbø
2b9ecfe69c macOS: Split out font engine creation from QCoreTextFontDatabase
The Core Text font database can produce both Core Text and FreeType font
engines. Refactor the code a bit so that the actual factory methods that
differ between the two stand out, and do not require a granular runtime
check in each method.

Change-Id: Ib70f76f4a9001a8108d87c1101a50699a6ea8f55
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2017-04-04 15:01:38 +00:00