Commit Graph

39752 Commits

Author SHA1 Message Date
Giuseppe D'Angelo
a87adcaa8d QContiguousCache: add noexcept
Change-Id: I069842fe705d2e73222ffb095792d7e3e518cfd9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-15 04:59:53 +00:00
Giuseppe D'Angelo
92479ed9b7 QPrintSupport: do not bypass a base class' virtual
QAbstractPrintDialog (a QDialog subclass) has an interesting
override of exec(): a pure virtual, without a body.
The UNIX subclass was therefore forced to override it, but
since it did not need to do anything with it, it had to call
QDialog::exec (bypassing the direct base, otherwise it
would cause a pure virtual call).

Eliminate the pure virtual override. This should be BC;
the layout of the vtable does not change, merely its contents.

Change-Id: I84ac23c938f1934f699df032ef1bde0d6df77784
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-15 04:59:22 +00:00
Giuseppe D'Angelo
83971776c7 QFontMetricsF: add noexcept
Change-Id: I0b32ff72f22c4014441a86c135927e52ddc999cd
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-15 04:59:06 +00:00
Marc Mutz
68eea0196e QTableView: replace QLinkedList with std::list
The object is never copied, so there's no point in using a cow'ed list implementation.

Apart from the usual API adaptions (isEmpty() -> empty(), append() -> push_back()),
alse replaced two foreach-loops with ranged-for. The first one does not call into
out-of-line functions, and doesn't modify the container it iterates over, so is
safe.

The second does call into out-of-line functions, but they are const. The loop does
not modify the container it iterates over, either, so is also safe (except for some
fishy const_cast somewhere, or const being lost due to shallowness of const).

Also replaced explicit-iterator loops with ranged-for where possible.

Change-Id: I60b0f2d356846d527bfbaa6a0ecbb8395013b852
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-14 19:43:10 +00:00
Marc Mutz
b703279235 QFontEngine: replace QLinkedList with std::list
The object is never copied, so there's no point in using a cow'ed list implementation.

Also port two explicit-iterator loops to ranged-for, as one is necessary
(because of constBegin()) and the other is for consistency.

Change-Id: Ia7f080060d6b675a76b55d197af08161389082a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-14 19:41:49 +00:00
Giuseppe D'Angelo
2353cb00cb QPainterPath: amend a comment
Casting towards more derived classes is "downcasting",
not "upcasting".

Change-Id: I1373a073ba81fb2c2b77c35ac1916a53ce30b86c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-14 17:31:52 +00:00
Giuseppe D'Angelo
cfeb09fcc8 QSharedData: code tidies
Add noexcept and honor the RO3 to silence warnings.
In theory this could also be constexpred, but there might
still be compilers we support that do not have constexpr initialization
for atomics...

Change-Id: Ibb94a2f4392908451cf7985d48f999581f03398d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 17:31:44 +00:00
Giuseppe D'Angelo
1df98e6bb9 QSharedData: unexport in Qt 6
It's fully inlined anyhow.

Change-Id: I8cb78ad6f75d3cc3b27cf91a3ba271cf312c9555
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 17:31:35 +00:00
Giuseppe D'Angelo
7f35255d87 QByteData: use int to return the number of managed QByteArrays
The internal QByteArrays are kept in a QList, so we can use
int to get the count. This matches what operator[] takes,
and gets rid of a bunch of warnings when iterating over a QByteData
using a plain int as a index variable.

Change-Id: Ib44d4101612135b976979a8464442e94706f8736
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 17:31:15 +00:00
Marc Mutz
a73385e2cf Short live qExchange()!
This is a 1:1 replacement for std::exchange, and should be removed once
Qt fully depends on C++14. It's too versatile a tool to miss it, so
provide a copy.

[ChangeLog][QtCore][QtGlobal] Added qExchange(), a drop-in for C++14's std::exchange()

Change-Id: I31c4f1141e7a99f99ea65eb36ddf9d68b7847337
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 17:21:40 +00:00
Marc Mutz
969e60e075 QTypeInfo: move QLinkedlist declaration to qlinkedlist.h
This is in preparation of deprecating QLinkedList.

Change-Id: Id5018b7fbc89f8b76b86e97cd09d18b4b8cb6234
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 17:00:39 +00:00
Tasuku Suzuki
8b9ea7232a Fix build without features.itemmodel
The macro needed to avoid generating headers_*.o from the header files.

Change-Id: I4fc5ec2432661493e337e1779d79373dedff0132
Reviewed-by: David Faure <david.faure@kdab.com>
2019-05-14 14:31:12 +00:00
Steve Lhomme
02a14e6e1b Include MODULE_AUX_INCLUDES in the generated .pc files
QtANGLE is set on MODULE_AUX_INCLUDES so the headers can be found when
building with ANGLE (gui.pro) but the pkg-config file is missing this
header and the Qt headers cannot be compiled with the path from this
config.

Fixes: QTBUG-75495
Change-Id: I4d795b3495b8d08c65f9ddffad4fc838b4f04c31
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-05-14 11:07:14 +00:00
Michal Klocek
1e5deb0641 Add 'well-formated' JSON string values
Add support for surrogate code points U+D800 through U+DFFF,
represent them with JSON escape sequences.

https://github.com/tc39/proposal-well-formed-stringify

Change-Id: I84fea53a8ef400beebefdba10ea82dc510fe7dda
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 10:06:35 +00:00
Friedemann Kleint
fa59c4fd7d Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" into refs/staging/5.13 2019-05-14 12:21:38 +00:00
Joerg Bornemann
871b65ab10 Add the c++latest CONFIG value to select the latest C++ standard
[ChangeLog][qmake] The CONFIG value c++latest was added to select the
latest C++ standard the currently used toolchain supports.

Task-number: QTBUG-75653
Change-Id: I22ddc9d293109d99e652b7ccb19d7226fca4716d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 08:01:40 +00:00
Friedemann Kleint
00e1917f85 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Id3d16035c9692af42e9c1bf512218f3c836ae2eb
2019-05-14 08:23:41 +02:00
Marc Mutz
c493076a04 QDataStream: move QLinkedlist operators to qlinkedlist.h
This is in preparation of deprecating QLinkedList.

Change-Id: I7540b784736a48cf4857d1969440d35ec64457e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 05:29:59 +00:00
Marc Mutz
bd25689003 Clean up qtriangulator_p.h
Remove the bogus default constructor and copy special member function
of the structs there. They just disable move semantics and the
compiler will be happy to generate them for you when you let it.

These classes are all pure inline, so remove the export macros.

Last, not least, remove the broken assignment operator of
QVertexIndexVector. The copy constructor was implicitly declared, so
was doing something completely different (the correct thing, I might
argue), while the hand-rolled, useless op= checked this->t to check
which of the vectors to copy (instead of checking other.t, which it
later copies).

Change-Id: I696f01602e02c0ddb2e5348ec85fd2a622544226
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 05:29:45 +00:00
Marc Mutz
ac83032c60 tst_qrandomgenerator: replace QLinkedList with a std::list
In preparation of deprecating QLinkedList.

This actually simplifies the code, since std::list has a ctor from size,
which QLinkedList lacks, and which the code worked around by using
initializer_list.

Change-Id: I07f9d590f863d9e4e00de73339cdfa27079f6e03
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 05:28:14 +00:00
Marc Mutz
fdd2714999 QGradient: de-inline dtor
As exported classes, their dtors should be out-of-line, lest we
can never add something to them afterwards.

Change-Id: I706281ca3fb285f9f00152f2e3fb34795699d69f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 05:26:19 +00:00
Marc Mutz
4543357007 qopenwfdscreen.h: remove unused #include
Change-Id: Ia02c9d5a468bb97f11e4c431eb36b4ce3f5cf1b4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-14 05:25:54 +00:00
Giuseppe D'Angelo
9108a5b005 GLX convenience: fix typo
The code meant to extract GLX_SAMPLE_BUFFERS_ARB, not GLX_SAMPLES_ARB,
which is read a few lines below.

Change-Id: Id50a1863cab56ed6084d4a2359a956a9db1222fa
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-05-13 22:05:11 +00:00
Giuseppe D'Angelo
bb72dc217d QPointer: fix swap()
Make it noexcept and add an overload as a free function.

[ChangeLog][QtCore][QPointer] Added a free swap function.

Change-Id: I50744b9bae6a52db71b2da39e310619b3a0d6510
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-05-13 21:49:00 +00:00
Marc Mutz
7cba2acd2c qmake: replace QLinkedList with std::list
This is in preparation of deprecating QLinkedList.

There is but one substantial change: Instead of copying the linked list,
we move it now, and instead of copying items between these two lists, we
use std::list::splice(), which just relinks nodes. It is a bit surprising
that the comment on the ProValueMapStack suggests references into the
container must remain stable, and then some code changes addresses by
making copies of the elements.

This was probably a bug waiting to manifest itself.

Since nothing else in qmake is using QLinkedList now, remove qlinkedlist.o
from the qmake build.

Change-Id: I08a5b0661466bf50ad8f9f8abf58bc801aef4ddc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-05-13 19:18:59 +00:00
Frederik Gladhorn
ac4cf6e2b2 Handle missing enum value in test
Change-Id: I39ad53686b45a79105ccfd9938d79518e26dd5d5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-05-13 16:39:44 +00:00
Marc Mutz
04e4835a94 QTableView: don't convert QSet to QList just to iterate over it
Both in drawAndClipSpans(), as well as callee QSpanCollection::spansInRect(), a QSet is used
to ensure uniqueness of elements. In both cases, the QSet is converted to QList, and the list
is iterated over.

Just iterate over the QSet directly...

Change-Id: I8c7d17246a3cf836659026bfeadb987f37e476bb
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-13 16:39:28 +00:00
Marc Mutz
0d88721d77 qmake: use std names on a linked list
This is preparation of moving from QLinkedList to std::list, which is in
preparation of deprecating QLinkedList.

Change-Id: Ief259bc8c7178be5ca04812c6890cf65d86c069d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-05-13 16:39:22 +00:00
Tor Arne Vestbø
09504d484c macOS: Guard against display on non-main threads
AppKit will in some cases ask our view to display on secondary threads if
we call APIs that are only supposed to be called on the main thread, such
as -[NSOpenGLContext setView:] or -[NSOpenGLContext update].

Forwarding this display-request is bad, as QtGui expects all window system
events to come on the main thread, and we can easily deadlock client code
such as the Qt Quick threaded renderer.

Change-Id: I1daeabf1dca6ca8ba908d3998b444a2089681e3a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-13 15:19:35 +00:00
Friedemann Kleint
7eed1e40d4 Windows QPA: Fix resize loops when moving fixed size windows between screens
Postpone the screen change until the DPI changed event in case a move
between screens with different DPI is detected.

Task-number: QTBUG-65580
Change-Id: I356f144b243d7d1ce7feabf0434c3f534b903965
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
2019-05-13 14:46:57 +00:00
Friedemann Kleint
d2fd9b1b98 Windows QPA: Fix window frame calculation in multi-monitor setups
When introducing EnableNonClientDpiScaling() for QTBUG-53255, the window
frame calculation was not adapted. That is, window frames were calculated
from the style for the primary screen only, causing

- minimum size constraints not being calculated correctly for applications
  on secondary screens when populating the MINMAXINFO structure.
- warnings about not being able to apply a geometry when moving fixed
  size windows across screens.

The calculation of the frames for propagating size hints is also no longer
required after 3035400f36, which retrieves
them from the WM_NCCALCSIZE message; QWindowsWindow::fullFrameMargins() can
be used instead.

For newly created windows, use the newly added AdjustWindowRectExForDpi()
function to calculate the initial frame size.

Change QWindowsGeometryHint from a class to a collection of static functions
and add overloads to calculate the frame.

In checkForScreenChanged(), update the margins until WM_NCCALCSIZE is
received.

Task-number: QTBUG-67777
Task-number: QTBUG-65580
Task-number: QTBUG-53255
Change-Id: Iff2d382b2b316adec6c1a0622ae8015dba6de371
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Andre de la Rocha <andre.rocha@qt.io>
2019-05-13 14:46:48 +00:00
Morten Johan Sørvig
3af7b27917 Fix QWindow::mapToGlobal()/mapFromGlobal() for multi-screen windows
Make these functions handle the case where a window spans multiple
screens, and high-DPI scaling is enabled, and the local position (in the
window) is not on the window primary screen (as returned by
QWindow::screen()).

This is done by detecting the case, and then calculating
the correct position using the native coordinate system.

[ChangeLog][QtGui] QWindow::mapToGlobal()/mapFromGlobal() now handle
windows spanning screens correctly.

Done-with: Friedemann Kleint<Friedemann.Kleint@qt.io>
Task-number: QTBUG-73231
Change-Id: I3c31b741344d9e85e4f5d9e60bae75acce2db741
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-05-13 13:52:32 +00:00
Morten Johan Sørvig
56acf089c7 wasm: support setting the font DPI from JS
We have not really been able to determine what the
default DPI should be, so make it configurable with
API on qtloader.js:

  qtLoader.setFontDpi(72);

Also lowers the default DPI to the standard value of
96 (down from Qt default 100).

Task-number: QTBUG-75510
Change-Id: Ica1164c8d80bb06519233adebf2c9e400c0991ce
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-13 12:29:21 +00:00
Liang Qi
ffdcad9e40 Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" into refs/staging/5.13 2019-05-13 16:37:15 +00:00
Martin Smith
98cb9275d0 doc: clang reported two fake declarations to be the same
These declarations are provided for qdoc, but clang says they are the same:
template <typename Functor>
QMetaObject::Connection callOnTimeout(const QObject *context, Functor slot, Qt::ConnectionType connectionType = Qt::AutoConnection);
template <typename PointerToMemberFunction>
QMetaObject::Connection callOnTimeout(const QObject *receiver, PointerToMemberFunction slot, Qt::ConnectionType connectionType = Qt::AutoConnection);

clang accepts this one, but is it ok for the documentation?
template <typename MemberFunction>
QMetaObject::Connection callOnTimeout(const QObject *receiver, MemberFunction *slot, Qt::ConnectionType connectionType = Qt::AutoConnection);

Change-Id: I9d63b1bccfa8d73dbc17ab70c4415eb7891fbbe2
Reviewed-by: Martin Smith <martin.smith@qt.io>
2019-05-13 11:11:42 +00:00
Tor Arne Vestbø
3976df2805 macOS: Track screens via Quartz Display Services instead of NSScreen
Using NSScreen as the basis for tracking screens is not recommended, as
the list of screens can be added, removed, or dynamically reconfigured at
any time, and the NSScreen instance, or index in the NSScreen.screens array
may not be stable.

Quartz Display Services on the other hand tracks displays via a unique
display ID, which typically remains constant until the machine is restarted.
The lower level API also gives us earlier callbacks about screen changes
than the corresponding NSApplicationDidChangeScreenParametersNotification
does. By reacting to screen changes _before_ AppKit does, we can remove
workarounds for receiving window move and screen change notifications
before the screen was actually visibly reconfigured.

The new approach also handles changes to the primary screen, which
can happen if the user moves the menu bar in the macOS display
arrangement pane.

The device pixel ratio of the screen has been made into a cached
property, like all the other properties of QCocoaScreen. This is
more consistent, and allows us to qDebug the screen even when it
has been removed and we no longer have access to resolve the
properties from the associated Quarts display.

Change-Id: I2d86c7629ed3bf5fb8c77f174712633752ae4079
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-05-13 10:46:53 +00:00
Frederik Gladhorn
3da9d8a4fe Make sure QAccessibleTableCell is valid before reference
There are some cases (model resets in weird positions) where we would
crash due to accessing invalid model indices.

Fixes: QTBUG-61416
Fixes: QTBUG-71608
Change-Id: Ibfedcbd921a3145f3e1596ac424a77f2319a5c46
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-05-13 10:07:30 +00:00
Liang Qi
388fe97f2a Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	src/corelib/tools/qstring.cpp

Change-Id: I81dbf90fc936c9bf08197baefa071117bddb1c63
2019-05-13 08:04:58 +02:00
Qt Forward Merge Bot
f8212b87d9 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I0c00ffe0eabebc919f22d6faa4bf958b288e8fd9
2019-05-12 01:00:08 +02:00
Giuseppe D'Angelo
a0c4b6f345 QSharedPointer/QWeakPointer: fix swap()
Do not specialize std::swap, just add swap in Qt's namespace.
Also add swap() for QWeakPointer, and sprinkle noexcept.

Change-Id: Ifb06c214f1865d42f3f2cddf5f980aede6bde185
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-11 20:23:10 +00:00
Laszlo Agocs
45aa3c73f7 hellogles3: Request core profile context
...instead of compatibility, in order to play nice with systems
that have no compatibility profile support (macOS). Instancing
needs OpenGL 3.x so sticking with 2.x contexts is not an option.

The example looks fully compatible with core profile so its
functionality should not change.

Change-Id: If0d554a6208973aa8a4fb86757e246d170cd0e71
Fixes: QTBUG-75680
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-11 12:01:53 +00:00
Tor Arne Vestbø
a9246c7132 Reset QWidget's winId when backing window surface is destroyed
We already reset it though e.g. QWidget::destroy, but if the backing
window is destroyed spontaneously or via another API we need to catch
that and send a WinIdChange event so clients who pulled out the original
winId will not think the pointer is still valid

Change-Id: I8556940ee871e81a51f73daeb2064f95bf41371c
Fixes: QTBUG-69289
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-11 12:01:40 +00:00
Giuseppe D'Angelo
41aa78856e QSharedPointer: fix threadsafety docs
Try and explain better the situation around QSharedPointer:
it's reentrant, not thread safe.

Change-Id: Ief9d28be8ea3fbaa6014cb6b999626db1bab52ca
Reviewed-by: Martin Smith <martin.smith@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-11 10:16:40 +00:00
Ulf Hermann
1a0df46b98 Add qurlquery.cpp to the bootstrap library
This amends change 587bdd144b. As we have
added QUrl we should also add QUrlQuery because the former uses the
latter.

Change-Id: Iab3b0cb91ef65e673c6c2db4c30fad5660ff30fd
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-11 08:23:44 +00:00
Vova Mshanetskiy
341c910688 Android: Fix wrong height of text editor context menu in some locales
Combined width of all four buttons (cut, copy, paste, select all) is
greater than width of the screen in some locales and/or on some devices.
This was causing width of the last button to be set to zero and height
of the whole popup to grow too much due to word wrapping in the last
button. The context menu used to look something like this then:

  Cut    Copy    Paste    S
                          e
                          l
                          e
                          c
                          t

                          a
                          l
                          l

This commit disables word wrapping and enables text ellipsizing for
button labels. This fixes height of the popup. In the long term though
Qt will probably have to implement an overflow button like in Android's
built context menu.

The linked bug report contains before and after screenshots.

Fixes: QTBUG-72933
Change-Id: I8e270dbf8ca66f99748cdc531a77e11a5ab11c2b
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-05-10 20:24:07 +00:00
Vova Mshanetskiy
c905ff4392 QAndroidInputContext: Fix start value of Cursor attribute in longPress()
The value of start for a QInputMethodEvent::Cursor attribute must be
specified relative to the start of preedit string, but longPress() was
specifying it relative to start of surrounding text. This was causing
QQuickTextInput to return wrong values of cursor and anchor rectangles.
And this was causing invalid positioning of cursor selection handles
after a long press.

Change-Id: Ief67e86dd90b09ebf2ba191a2b0311ff803afdd9
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-05-10 20:23:55 +00:00
Allan Sandfeld Jensen
4d2ee7f358 Add unvectorized fallback in case FP exceptions are not masked
If an application enables FP exceptions our FP-based unpremul will
raise the INVALID exception. Since disabling them locally might be slow
just take a slow path when detected.

Fixes: QTBUG-75592
Change-Id: Ie22a032a4f62229f68ad21ede359c62291adc9bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-10 19:35:10 +00:00
Ville Voutilainen
2a1651cc16 Make moc grok binary literals with digit separators
Task-number: QTBUG-75656
Change-Id: I6011ef2fb07497cc2a055d6828a1b6356927c281
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-05-10 18:34:02 +00:00
Tor Arne Vestbø
c99678fb19 macOS: Deliver geometry changes when content view changes frame
This was disabled in 9f22ac0aa0 under the
assumption that the windowDidResize callback was sufficient, but in the
situation when macOS native tabs are enabled, AppKit will report the
wrong geometry for the first windowDidResize callback when a new tab
is created.

We could potentially remove the geometry change in windowDidResize,
as the viewDidChangeFrame callback should be enough for content
views, but this is something that needs more investigation.

Change-Id: I85045507da1a01b4a906e6f88301f3321c660943
Fixes: QTBUG-75482
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-10 17:15:29 +00:00
Tor Arne Vestbø
123053bba8 macOS: Don't clip menu item drawing to bounding rect when using CoreText
The bounding rect was computed based on the font metrics HarfBuzz gave
us, but those may not be 1:1 with what CoreText ends up using. When that
happens, drawInRect: will line-break the last word, which makes it fall
completely outside of the single line bounding rect. This is not a good
failure mode, so we prefer to draw the text at a point instead, allowing
the resulting text to draw slightly outside of the bounding rect. This
is preferable to adding a random padding to the width and hoping it will
be enough to solve the problem.

Change-Id: Ifa58a33bd9fad689ed4ee947327b7079f3c1b61d
Fixes: QTBUG-74565
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-05-10 17:15:27 +00:00