Commit Graph

30094 Commits

Author SHA1 Message Date
Sergio Martins
72a1a72776 docs: Don't mark qDrawBorderPixmap() as overload
Because it doesn't overload anything.

Change-Id: I871df10b4a0a46da238a5d1061cfb1aa34ccee03
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-10-05 06:22:45 +00:00
Tor Arne Vestbø
f2b90b4e82 Apple OS: Resolve QStandardPaths test data locations based on real locations
Instead of the manual logic for computing test data locations, we use the
locations from baseWritableLocation, but make sure to put them all under
'.qttest' in the home directory. This approach handles more cases for test
data, and also plays nice with locations that are not in the home directory
due to being containerized (and hence do not need a separate test data scope).

Change-Id: Iea4f21acb75c0191be35a3619c05143e8929bd6e
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 21:22:05 +00:00
Tor Arne Vestbø
6c8f32388b tst_QSettings: Detect if Apple platforms support writing to SystemScope
A fair amount of tests are skipped if we can't write to the system scope,
eg on iOS. Without this detection they will fail.

Change-Id: I8257f1f24e69dae88925c20d2bff851e81701405
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 21:21:20 +00:00
Oswald Buddenhagen
0fcd842cec remove unnecessary references to $$QMAKE_CFLAGS_DBUS
it does not appear that the tests actually use these flags in any way;
they don't include any (actual) d-bus headers and have no ifdefs.

and the qdbus module already pulls in the flags via QMAKE_USE (in the
case where they are defined at all, i.e., dbus-linked).

Change-Id: Ie6bc6da7d1dd96da7b73f2d0fe45576936715874
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-04 20:21:28 +00:00
Oswald Buddenhagen
66b73172c9 remove redundant QMAKE_USE += xcb
the gl_integrations_plugin_base.pri included by this file already does
it.

Change-Id: I172401a431081da903b82e97829c2517ef6204df
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 20:21:21 +00:00
Oswald Buddenhagen
7b4c52c7e6 remove stray dbus/-menu dependency from xcb plugin
amends 26a05fc09 (which in turn was a cleanup of 38abd6537).

Change-Id: I6159a3cfe468db048faf1c396143dd3869f7e72b
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 20:21:15 +00:00
Oswald Buddenhagen
72fe67353d rely on module include paths for qpa includes
Change-Id: I9a28a5ec9b0050786c4abc39c6ac298e95cf8fad
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-10-04 20:21:09 +00:00
Oswald Buddenhagen
db732a07c0 remove apparently useless egl include
this file does not directly access egl.

Change-Id: I8b52aef9ee3a69a12370c3c6a1f9e2bb23051603
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-10-04 20:21:03 +00:00
Oswald Buddenhagen
5976fbf5e0 convert apparently forgotten QT_CONFIG/fontconfig reference to qtConfig()
Change-Id: I69d7247747c6e5a7b29051ba7b86b29c27936e65
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 20:20:56 +00:00
Oswald Buddenhagen
9d8f7bcaa1 clean up freetype conditionals
there is no point in testing !win32 explicitly any more, as configure
will take this into account already.

Change-Id: Idfca46feece6451509b405a4afc2b7205667c5bb
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 20:20:51 +00:00
Oswald Buddenhagen
57987ad571 fix freetype/fontconfig configure system
convert the ugly config.tests/[...]/freetype.pri file into a custom
callback in configure.pri, and reinstate pkg-config use for freetype.
subsequently, use QMAKE_USE for the actual library references.

this fixes in particular cross-builds, as the new configure was not
passing the necessary information to the test any more, so the old .pri
file misbehaved.

Task-number: QTBUG-54911
Change-Id: I5fc9c254334a2675f7db4d54df4c77637e8e2487
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-10-04 20:20:39 +00:00
Oswald Buddenhagen
cd8b7fb865 make QMAKE_USE parameterizable
it's now possible to declare references which don't cause linking (or
cause only linking).

make use of this in the xcb-static library.

Change-Id: Ic429e0a1200b3a333738ea8d8e576ff64b6cac21
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-10-04 20:20:18 +00:00
Oswald Buddenhagen
1e97037ed9 factor out QMAKE_USE* processing to a separate prf file
this makes it possible for features added via CONFIG to use QMAKE_USE*,
as default_post.prf is processed before all features in CONFIG.

Change-Id: Id0812a0fb1aa5e658548bd2bc6003234085545e7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-10-04 20:20:06 +00:00
Gabriel de Dietrich
9ab60b9c0d QCocoaEventDispatcher: Save interrupt state between embedded calls
Since QCocoaEventDispatcher::processEvents() resets the interrupt
state, this may prevent a higher level event loop from returning.

For example, calling QMenu::exec() and, as a result of an action
being triggered, the application calls QCoreApplication::processEvents()
after QMenu::hideEvent(). In this case, the menu event loop can be
stuck until we run another event loop.

Task-number: QTBUG-53947
Change-Id: If7efe1c3c07f7222c695195cbb4f41715e49b02e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Wayne Arnold <wayne.arnold@autodesk.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-10-04 18:38:19 +00:00
Jake Petroules
0059bf944d Don't add -spec XXX more than once to system command in xcodebuild.prf
The "args" variable would contain the original -spec XXX flags in
addition to the -spec macx-xcode passed in the system command invocation
below. The last use of -spec takes effect, so this code was entirely
ineffective. Consequently, uikit/default_post.prf in the nested qmake
call thought it's still the top-level call and thus added xcodebuild
again, which caused an infinite recursion.

Change-Id: Ie98d8a7f3c1cd875f4a4146af9a66a66b48cc6cb
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-10-04 18:33:34 +00:00
Peter Varga
37ad51a44e Revert "Doc: Added enums in qnamespace.qdoc"
Remove duplicated enum values from doc.

This reverts commit dfb55da5d6.

Change-Id: I27c85f66123731e0106bd702e843a24d7e9b5931
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-10-04 17:58:57 +00:00
Marc Mutz
bf595c4e78 QFileSystemModel: Plug leak on file renaming
In setData(), the old code both called Private::addNode(),
which creates a QFileSystemNode and adds it to the parent's
QHash of children, and also re-purposed the old node by
taking it out of the children hash, adjusting the fileName
member of the node and putting it back into the children
hash under the new name, where it would overwrite the node
just added under the same (new) name in addNode(). Since
the hash stores naked pointers, no-one deletes the node
that was put into the hash first.

Fix by dropping the addNode() call completely.

Change-Id: I0c37917fd0ffd74716393786c69b5bb172aa372e
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-04 17:12:26 +00:00
Eskil Abrahamsen Blomfeldt
4d552815cf Fix plain text QStaticText with line breaks
The layout isn't actually created until endLayout() or setLineWidth() is
called. So in the case where this was not done, the height of the line
would be 0, thus multiple lines would be placed on top of each other, at
y == 0.

[ChangeLog][QtGui][Text] Fixed QStaticText when manually breaking lines
and no text width was set.

Task-number: QTBUG-56346
Change-Id: I7f6ed6260545882f05fe39b21134315eca7401b9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2016-10-04 14:30:13 +00:00
Allan Sandfeld Jensen
f3d19244cd Fix PrintScreen mapping on macOS and more
Fixes the mapping of the rare multimedia Print key, adds the real
mapping of the Print Screen key.

Also adds a mapping for few other short-cut keys that were added in 5.6

Change-Id: I931bf1eed062536e1be2aa6aa6f19d773bb5ec55
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-10-04 12:53:08 +00:00
Oswald Buddenhagen
546191b03f fix parsing of -system-proxies
this is, in fact, not the same as --proxies=system, and the old
configure handles this by putting special cases before the catch-all
patterns. we achieve this by trying the verbatim names (of all options,
which is admittedly a tad inefficient) before applying the -qt/-system
transformation.

Change-Id: Ic85a9d76d6e8ca95b2e1b5566f047f4b7ac38b98
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-10-04 08:26:49 +00:00
Oswald Buddenhagen
0872b62b2e make command line parsing more compliant with configure script
- generic --* options are defined to be booleans, without the
  possibility of having an additional parameter
- -qt and -system options don't exist in the --* form
- --foo=bar options exist only in the --* form

Task-number: QTBUG-55610
Change-Id: Ib0480ac6f479df48045c9de8e854a525862ee363
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-10-04 08:26:39 +00:00
Oswald Buddenhagen
d01133a7fc remove redundant load(qt_build_config)
every repo's .qmake.conf is expected to do it already.

Change-Id: I87ed75d80493d8f1c4548c5b9dadfdaf07b86d7e
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 08:25:40 +00:00
Oswald Buddenhagen
05786de946 remove obsolete module warning
this is a relic from the early times of the modularization.

Change-Id: I9ca46fa6457bf9ca207b6be1f0637f0349569ddf
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 08:25:34 +00:00
Oswald Buddenhagen
4a561c6baf remove redundant conditionals regarding ssl
this actually fixes the build when ssl is not enabled, as the openssl
features are in the not included network-private module.

Change-Id: Ibafae9867af493da184a45cf3981628d475d37a6
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 08:25:24 +00:00
Oswald Buddenhagen
5a4d469dcb rename configure.exe => configureapp.exe
now that the bat file is responsible for displaying the help in addition
to bootstrapping configure, the exe file should not shadow it any more.

amends c027cffbe.

Change-Id: I5c8a52f59ff455575e646fae55cd214db98a3736
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 08:25:08 +00:00
Oswald Buddenhagen
9e048799b8 fix msvc build in dirs with spaces
Change-Id: I2df71cce68e59b8d7565fb43953947a9a84970b3
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-04 08:24:58 +00:00
Marc Mutz
d6b6c15d33 QFileSystemModel: fix unused variable with QT_NO_FILESYSTEMWATCHER
The QFileInfo 'info' is only used in code conditional on
QT_NO_FILESYSTEMWATCHER, so move the definiton into the
conditionally-compiled block, too.

Turn it into an rvalue while at it.

Change-Id: I9983bfdcd0b32d0abecf7c588973a60df9de8cbc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-04 07:37:12 +00:00
Marc Mutz
a4fc6a3047 QXmlAttributes: mark as shared-come-qt6
Requires adding a member-swap() function.

Change-Id: I47f9fac84a6f41bb1e487c27fdcf6879b5a771d1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-10-04 06:25:54 +00:00
Tor Arne Vestbø
e8c8c9fea7 Exclude tst_QSettings::rainersSyncBugOnMac() on all Apple OSes
It fails on iOS as well, and likely also tvOS and watchOS.

Change-Id: Idfce98a5aeccb5680f6b4c6e66b526dd7922156d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-03 21:40:33 +00:00
Marc Mutz
3b5107a118 Speed up compilation of tst_qgraphicsview_2.cpp
Turn the list of newRow() calls into a for loop over a constexpr
data structure.

Fixes the GCC note:

   tst_qgraphicsview_2.cpp:47:13: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without

and speeds up compilation of the file from 13s to 2.5s on my
machine.

Task-number: QTBUG-38890
Change-Id: I4f0b3565c7df64b286d1d32eb3f3d6bf4df92609
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-10-03 14:59:56 +00:00
Albert Astals Cid
c62f717226 Fix signal code generation
The old code is broken because it was passing signal.outputArgs as inputArgs
variable of writeArgList, fix can not be passing signal.outputArgs as outputArgs
of writeArgList since that ignores the first of the list, so i added a new function
that does the right thing

Change-Id: If54484e04880d5dcebfedb9d478ee0e9faf37baa
Task-number: QTBUG-21577
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-03 14:01:33 +00:00
Morten Johan Sørvig
d5e3dca8c5 Cocoa: Don’t send tablet events as mouse events
Re-apply change 6e850af09d,
the code for which has gone missing.

This prevents sending tablet events as both mouse
and tablet events, which confuses the double-click
detection code in QGuiApplication::processMouseEvent()
when tablet->mouse event synthesis is enabled.

Task-number: QTBUG-54399
Task-number: QTBUG-51617
Task-number: QTBUG-47007
Change-Id: I6183906d4ce2b8cdc617d34e22a9dcf999eef51d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-10-03 10:18:49 +00:00
Milla Pohjanheimo
b8a469af64 BIC data files for QtBase for Qt 5.7
Added the binary compatibility test data files for Qt 5.7 for QtBase

Change-Id: I5b19571f5e266c52622027d820062afa5fd4fbf3
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
2016-10-03 09:38:59 +00:00
Tor Arne Vestbø
be7f671ac9 Round to nearest millisecond in QDateTime::fromCFDate()
CFAbsoluteTime is measured in seconds, represented by a double,
so when converting milliseconds to CFAbsoluteTime we may get a
slight error due to missing precision in double to represent
the milliseconds exactly. By rounding to the closest millisecond
when converting back, we avoid truncating and being one ms off.

Change-Id: If1e99f97b000fb8cb893ddfc5d7ba81096c0ea88
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-10-02 13:07:18 +00:00
Marc Mutz
ad1555be7f Plug remaining leaks in tests/auto/widgets/util
In tst_QCompleter, two completers were leaked because they
had no parent and setCompleter() calls don't reparent.

Fixed by giving them parents.

In tst_QUndo*, fix lots of leaked QActions by storing them
in a QScopedPointer. There were some half-hearted attempts
to clean them up with manual deletes, but I ported these to
scoped pointers, too, to make the code more robust in the
face of failures.

This fixes the remaining errors in GCC 6.1 Linux ASan runs of
tests/auto/widgets/util.

Change-Id: Icc5248cc9cf4514540915924df1c4d9e09c071fa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-10-02 11:28:23 +00:00
Marc Mutz
f43c9697bc Plug QMimeData leaks in QXcbClipboard
QXcbClipboard failed to delete the various QMimeData instances
it owns.

For m_xClipboard, where the two QXcbClipboardMime instances are
never the same, fix the leak by using a scoped instead of a
naked pointer.

For m_clientClipboard, where the two QMimeData could be identical
objects, keep the naked pointers, but delete the objects manually
in the QXcbClipboard destructor, paying attention to the case
where they're the same object.

Change-Id: I5ce0e3e8fcec068aeb344ca806cdf2667378e946
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-02 11:28:00 +00:00
Liang Qi
3e949b75fd Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
	mkspecs/features/mac/default_pre.prf
	mkspecs/macx-ios-clang/features/resolve_config.prf
	qtbase.pro

Change-Id: I65b5ebca4942a4f295bdd4ac1568e5c347333aea
2016-10-01 22:15:55 +02:00
Alex Trotsenko
4518345b80 QIODevice: add CHECK_MAXBYTEARRAYSIZE macro
It unifies handling of QByteArray's size limit in read(), readLine()
and will be used in a follow-up change which optimizes the performance
of QIODevice::peek() function.

Change-Id: Idb9fbbe14d9632ee267d2a0e47c8a88603c024a2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-10-01 17:36:50 +00:00
Tor Arne Vestbø
c6fa0222e2 Remove QCocoaWindowPointer in favor of QCocoaWindow inheriting QObject
As already done by the iOS, Mir, and Haiku platform plugins.

Change-Id: I449f396dbf234e27206625b178c7d20e3f5b956f
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-10-01 13:12:29 +00:00
Jake Petroules
d2b4a789c3 Fix explicit -sdk iphoneos builds
The order in which exclusive builds are added affects the order of
values in SUBTARGETS. xcodebuild.mk parses the value of SUBTARGETS in
the Makefile and selects the first entry, which would always be
release-iphonesimulator regardless of the build type. This obviously
caused -sdk iphoneos builds to fail.

This patch switches the order of in which exclusive builds are added so
that the entries which are not present in a particular build type are
always added last.

Change-Id: I306d6f7430c1dff3d741a8c5182b7af81d000e7f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-10-01 07:37:16 +00:00
Marc Mutz
1bde907a23 QFileSystemNode: simplify three loops over the children hash
In the dtor, simply call qDeleteAll(children) instead of looping
manually.

In updateIcon() and retranslateStrings() replace a manual loop
with C++11 ranged for. At least I only saw 'iterator' everywhere
(who names an iterator 'iterator' instead of 'it'??).

Change-Id: Ib0047dece3c88244bb4364cd4491cd04514a91bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-30 23:17:02 +00:00
Marc Mutz
8a25006fad QFileSystemModel: add an assert to prevent leaks
Private::addNode() adds the new node to the parent's hash without
checking whether a node already exists. If it does, then the old
node is leaked.

Add an assertion to check for this condition.

Change-Id: Ib949d71c86c28d1152a538756c0efc283c793c24
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-30 23:16:45 +00:00
Marc Mutz
b5662ba603 QFileSystemModel: reuse an existing variable
... to improve readability.

The variable 'oldName' was defined one line up from the same
expression as the RHS of the if, so use the variable instead.

Change-Id: Ifcd119317e8c9594f5280f294bc3301f681b94be
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-09-30 23:16:18 +00:00
Jake Petroules
156e3981db Reorder arguments to qmake self-invocation in xcodebuild.prf
26d44fce3d added support for passing the
configure options to qmake following a "--" argument. This interacted
badly with xcodebuild.prf as the "args" variable would contain the
standard qmake arguments AND the extra arguments following "--"... which
were placed prior to -spec macx-xcode and the path of the .pro file,
causing them to be ignored and thus qmake to print its usage when
attempting to generate Xcode projects for Qt apps on UIKit platforms.

Amends 6a9f38a11d, which fixed the same
issue inside qmake itself.

Change-Id: I3056bd811c2ce958952fec8e05ddef7a063c0646
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-09-30 18:26:49 +00:00
Richard Moe Gustavsen
3f8843f18d iOS: (crash fix) ensure we don't clear focus object in a text responder transition
(Backport of 5.7/8586ccc).

The original patch was implemented to handle crashes after e78ca787ae.
But the former was pushed to 5.7, and the latter to 5.6. So we need to
backport it, otherwise the same crashes will still happen in 5.6
(e.g when transferring focus from a text edit to a (picker) menu).

Change-Id: I13037735dc316bceadb571e67f38a310c8a1bfae
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-09-30 12:18:43 +00:00
Richard Moe Gustavsen
b19280753d iOS: hide shortcuts bar on iPad when showing menus
On iPad, a shortcuts bar with extra controls are shown
on top of the keyboard with opertions like cut and copy.
This is unwanted when using the keyboard to show menus.

This patch will add extra private information to IM
platform data when using menus, so that we hide the
shorcuts menu when showing the custom input panel.

Task-number: QTBUG-49893
Change-Id: Iaa8e1ff18acebec8be69699b3fd9470c69ab34d7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-09-30 12:18:37 +00:00
Allan Sandfeld Jensen
116e7a267e Fix qt_blend_rgb32_on_rgb32_avx2
The order of the arguments to testc was wrong, it should have been the
other way. Replaced with testz to also get rid of setzero.

Change-Id: Iff968c140f9ca34c6bd7c7f04a3623fd8ec42e1c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-09-30 11:41:38 +00:00
Milla Pohjanheimo
be13081dd4 Data files for binary compatibility tests updated for Qt 5.6
The generated data files for the binary compatibility test
updated for QtBase.

Change-Id: Idae703c83f55ff17cada4419db742ea12b22bf86
Reviewed-by: Sergio Ahumada <sahumada@texla.cl>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2016-09-30 10:55:59 +00:00
Marc Mutz
7d47c97360 Plug remaining leaks in tests/auto/widgets/style
The usual:

- delete styles

Either by using QScopedPointer.

This fixes the remaining errors in GCC 6.1 Linux ASan runs of
tests/auto/widgets/styles.

Change-Id: Ifba59085c057d474bf964cbb93010c408d773a61
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-09-30 10:45:34 +00:00
Eskil Abrahamsen Blomfeldt
22bf1f28f9 Freetype: Fix wrong line spacing for Courier New
The regular variant of Monotype's "Courier New" font, the one
which is included by default on Windows, has an EBLC table, which
overrides the ascent and descent for certain sizes. The Freetype
engine doesn't automatically respect this, so there is a hack
in place to fetch the correct values for us.

But there were two issues with that code, which lead to us getting
the wrong line spacing for that particular font: The first was that
we did not update the height metric for the font. This is used,
together with the ascent and descent, to calculate the leading of
the font. So when we set the height of text lines in a layout, we
would get a leading based on the height for the scalable font
and the ascent/descent from the EBLC table, and this would not match
up.

Also, as reported elsewhere on the Internet, the descent value in
the EBLC table for Courier New is set to a positive value instead
of a negative one. This must be a bug in the font, so we special
case it and fix the value to avoid bogus line spacing later.

[ChangeLog][Qt Gui][Text] Fixed line spacing with some scalable fonts
containing bitmaps with the Freetype font engine.

Task-number: QTBUG-50090
Change-Id: I95165dde7b8ffac6d7f9ac43baadb3eb75d28abe
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-09-30 10:32:55 +00:00