Commit Graph

39787 Commits

Author SHA1 Message Date
Ville Voutilainen
4f116f00fc Fix GCC 4.8 build
Change-Id: I4994146b359e8e37f6c0fa1b27f03fb9e800fdd5
Fixes: QTBUG-77218
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-08-05 15:50:42 +03:00
Liang Qi
f3c816befe Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" 2019-08-05 10:03:24 +02:00
Liang Qi
f3b28e8021 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	qmake/generators/unix/unixmake2.cpp
	src/plugins/platforms/cocoa/qcocoawindow.mm

Change-Id: Iba7aa7324f35543e0297a3680956420058cd3630
2019-08-05 09:28:48 +02:00
Joerg Bornemann
8c0787cfa1 Fix dependency_libs entry of .la files
Libtool cannot cope with absolute paths in the dependency_libs entry.
We split absolute paths into -L and -l here.

Change-Id: I30bf11e490d1993d2a4d88c114e07bbae12def6d
Fixes: QTBUG-76625
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-08-03 21:47:55 +02:00
Tor Arne Vestbø
455963ce49 macOS: Don't require setting all three color buffer sizes in QSurfaceFormat
Change-Id: Iaa6eb4d64f549a31aa5c53145e8b37facec4ea78
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-02 18:59:24 +02:00
Pavel Artsishevsky
a22bb694ce Fix QPainter's ColorDodge and ColorBurn composition modes
Added checking corner cases (more specific formulas) in
color_dodge_op()/color_dodge_op_rgb64() and color_burn_op()/color_burn_op_rgb64()
to produce correct results for any input.

Task-number: QTBUG-77231
Change-Id: I274f80b356bd4236a9176a84a95604c2eb01787a
Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-08-02 12:46:53 +03:00
Timur Pocheptsov
ec62033bc2 tst_http2::connectToHost - add a fix for SecureTransport backend
One of the tests above was unsetting a variable that enforces
the use of a temporary keychain. We have to set it back, otherwise
the test is failing. What surprises me though - why I had this
problem only locally and not on CI? Apparently, SecureTransport
is not covered by our configurations ...

Change-Id: I0ff1e3e304632869391ed61213c245b949d8c778
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-01 17:37:53 +02:00
Tor Arne Vestbø
662798d785 macOS: Add system detection and version defines for macOS Catalina (10.15)
Change-Id: I127efe752ebb70825f1b31f0d64c4293d1c71820
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-01 15:25:01 +02:00
Tor Arne Vestbø
360000342a macOS: Improve screen positioning during window creation
Allow AppKit to resolve screen for NSWindow lazily in the case where the
position is outside any known screen. And explicitly set the style mask
if detecting the corner case of positioning a window in the unavailable
space on a rotated screen.

In testing the effect of creating the window with a borderless style mask
and then updating the mask did not seem to have any visual consequences,
but we try to limit this mode just in case by only enabling it in the
corner cases we detect.

Change-Id: I4b7fcc6755a1ad5ff2683bec79d80a78226edae0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-08-01 15:24:55 +02:00
Tor Arne Vestbø
89e97e9937 Pass qmake arguments when creating Xcode project from Makefile
Change-Id: I0020273b200465f44a135848b4fd505793e85c30
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-08-01 15:24:25 +02:00
Tor Arne Vestbø
a34b0855f1 macOS: Don't assume NSWindows will be created on the screen we request
The user may have assigned the application to start up on a specific
display, in which case the window's screen is nil after creation, and
the resulting screen will be delivered as a normal screen change once
the window is ordered on screen.

Fixes: QTBUG-77154
Change-Id: Idade6d833e31654db239243f2430166b5d86eca2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-01 15:23:56 +02:00
Timur Pocheptsov
bd8ef7fe24 Blacklist tst_http2::connectToHost
Test if flakey.

Change-Id: I1f956f47ab4cf0602f3631e4f7908df35f5ce83f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-01 13:18:02 +00:00
Marc Mutz
9ad8debe38 qlalr: fix compilation with C++20
std::not1 is deprecated in C++17, removed in C++20.

Use its replacement, std::not_fn.

Change-Id: I37d4929c81c2a5befeb44f954ae77b23960d2ff0
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2019-08-01 11:20:27 +00:00
Friedemann Kleint
174061f9f3 QHighDPI: Fix broken scaling of QPoint(F)
For some reason, the overload resolution of the
High DPI scale() functions introduced by
b6ded193ee chose the
wrong overloads for QPointF and/or QPoint; it fell
back to the generic template intended for qreal,
QSize, etc, ignoring the origin. Remove the
template and spell out all overloads.

Fixes: QTBUG-77255
Change-Id: I5661f16f7326f65156f646f430f5a0c71d5302d2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-01 13:20:23 +02:00
Volker Hilsheimer
3d7bd7ad19 Fix hit testing in non-client area of fixed-size windows, don't show resize cursors
The m_windowState member is never updated regarding active state;
isActive is instead reimplemented to query the window manager, so use
that.

To extend the area where the user can move the window over the entire
titlebar of fixed-height windows, just test whether the mouse position
is within the titlebar.

Change-Id: I6b87aacd0bdab511cfd4959df1114af5c6013852
Fixes: QTBUG-77220
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-07-31 20:13:49 +02:00
Christian Ehrlicher
4d7271087e QAbstractItemView: refine documentation for SingleSelection
Since Qt5.1 it is possible to deselect the current selected item in
SingleSelection mode when pressing the Ctrl key during the click but
this was not mentioned in the docs.

Change-Id: I86652308215bf218ea959f869334b6077e4634f9
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-07-31 18:03:22 +02:00
Simon Hausmann
2dddc1c9f4 Fix erroneous missing-cmake-tests errors
After commit 9c7ebd191b, qmake would
complain about missing cmake tests even for internal modules that have
no application side C++ linkage that needs testing.

Change-Id: I23b23c81dbe6be2b6da5672cbd7b8f8454ec2f66
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-07-31 16:37:28 +02:00
Eirik Aavitsland
697910e5fb Fix assert in QPainterPath after clear()
The newly introduced clear() method left the path in an undefined
state: d_ptr allocated, but no elements. The elements vector is
otherwise never empty, since ensureData() inserts a dummy initial
moveTo element.

Fix by making sure that clear() leaves the path in the same state as
ensureData() (i.e. "empty" but not "null"), except possibly more
capacity allocated in the elements vector.

Fixes: QTBUG-76534
Change-Id: I7ad8b312913f5eb6e22023f5d2fd873e54b1e23c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-07-31 12:05:54 +02:00
Qt Forward Merge Bot
a4567c9058 Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" 2019-07-31 10:30:56 +02:00
Qt Forward Merge Bot
241ccb7c83 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ifbaa4877051d93bcb0d58eed35bfe8dffa5634a3
2019-07-31 10:30:44 +02:00
Volker Hilsheimer
23e605cc5b Plug a memory leak introduced in e24a4976be
While it is correct not to call the functor when the context object has
been destroyed, we still need ot clean up the slotObj. It's a low-
probability memory leak: the context object has to disappear while
waiting for a host resolution, and for repeated requests for the same
host the cache takes over anyway.

Task-number: QTBUG-76276
Change-Id: Id9daf391353b8252443f3186a7d504d70c553b24
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-07-31 09:25:30 +02:00
Heikki Halmet
305f2c3aa6 BLACKLIST insert_remove_loop for msvc-2019
Task-number: QTBUG-77239
Change-Id: Ie1a08db0b4c4e1bbcb7981f24bcf12d5e6d33e48
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2019-07-30 14:11:02 +03:00
Oliver Wolff
652085c5c2 qfsfileengine_p.h: Un-inline processOpenModeFlags
An inlined exported function does not make sense and will cause a
warning.

Fixes: QTBUG-77242
Change-Id: I016b93d6b39c4db82148fdc5a8a92bc9d5751885
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-07-30 13:10:08 +02:00
Qt Forward Merge Bot
75f51d2f40 Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" 2019-07-30 01:00:32 +02:00
Qt Forward Merge Bot
409cc99896 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ibdbd88e11cd03d5ce558e67ad8e9a21436e7ef89
2019-07-30 01:00:19 +02:00
Tor Arne Vestbø
c2f041203f qmake: Keep -force_load with library when merging linker flags
Without treating -force_load as an option with an argument, we end up
leaving stray -force_loads in the linker line, resulting in build
failures when the following option is a random library then treated
as a file path.

Task-number: QTBUG-66091
Change-Id: I352c50ab67e32ef6b2b5c6a4f90455b20034e207
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-07-29 17:23:16 +02:00
Tor Arne Vestbø
080fbb55b5 qmake: Don't allow -framework without second argument when merging flags
The linker doesn't support -framworkFoo, so neither should we. The correct
syntax is -framework Foo.

Change-Id: I3f39ffc067871ce058542bf0068274b35f7b51f6
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-07-29 17:20:10 +02:00
David Faure
3e7463411e Fix crash when the focus widget gets a focus proxy after the fact
QApplicationPrivate::focus_widget became a dangling pointer
in the following scenario:

A widget first gets focus and later on gets a focus proxy.
QApplicationPrivate::focus_widget was still pointing to the initial widget.
Upon destruction, QWidget::hasFocus() [which follows to the focus proxy
and then compares with focus_widget] was therefore false for both
widgets. So QWidget::clearFocus() didn't call
QApplicationPrivate::setFocusWidget(0) for either of them. As a
result, focus_widget remained set, and became dangling.

In real life, this happened with a QWebEngineView, which the application
gave focus to upon creation. At that time it doesn't have a focus proxy
yet. That happens later, in QWebEngineViewPrivate::widgetChanged.

https://bugs.kde.org/show_bug.cgi?id=381793

Change-Id: Ifee610bb76a2d4d2797b98ece9bffe5fffe3c6a6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-29 17:15:02 +02:00
Qt Forward Merge Bot
f53fc76060 Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" 2019-07-29 15:33:37 +02:00
Tor Arne Vestbø
f4647b40ca macOS: Respect QSurfaceFormat color space when creating NSWindow
Task-number: QTBUG-47660
Change-Id: I90a2956bfaa52c361a3eba32f0ea19c0eca8c277
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-29 15:24:05 +02:00
Andre de la Rocha
c8bb8cb761 Windows QPA: Fix detection of the Surface Pen eraser button
The Surface Pen eraser button generates Meta+F18/19/20 keystrokes, but
when it is not touching the screen the Fn WM_KEYDOWN message is eaten
and only a Fn WM_KEYUP message with the previous state as "not pressed"
is generated, which would be ignored. With this patch we detect this
case and synthesize the expected key events to allow the button to be
used in applications.

Fixes: QTBUG-77153
Change-Id: I075f5cbb903cb36c9ec241ee1bb31d436b725e3a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-07-29 12:38:05 +02:00
Oliver Wolff
56b1cb0b04 Move processOpenModeFlags out of QFSFileEngine
The same logic is needed for QWinRTFileEngine. To be able to reuse the
code, it was moved out of the class.

Task-number: QTBUG-77095
Change-Id: If52b2fc8a0f3056d32fc693775565a1c3803b7d4
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-29 12:23:07 +02:00
Oliver Wolff
3fbb6a9572 QWinRTFileEngine: Handle QIODevice::Truncate when opening files
Fixes: QTBUG-77095
Change-Id: I45b38fab779518c49b22077c493d8640572d40d9
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2019-07-29 12:22:55 +02:00
Qt Forward Merge Bot
154155f588 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/corelib/io/qresource.cpp

Change-Id: I54917f72444a621bd08aeaa15f5d17415993144d
2019-07-29 11:56:00 +02:00
Orgad Shaneh
1061103890 qmake: Use a simple response file for ar on mingw
This change allows using custom flags for ar. For instance, it is
now possible to create a thin archive by setting QMAKE_LIB += -T.

This uses and extends commit d92c25b1b4
which served a similar purpose for the linker.

Change-Id: Ie1d6a0b957dc4809957726de00911c8d91647fab
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-07-29 08:41:27 +00:00
Volker Hilsheimer
fe8cd567dd Add IPv6 data to the reverseLookup test
Passes locally, and there is no reason why it shoulnd't. Use IPv6
addresses for Google and Cloudflare DNS servers, and as with the IPv4
tests, rely on Python and (as a fallback) nslookup to produce the
reference.

Change-Id: I584f8ae9bc89c66a1f59d7b1e7493d0ed8033e8a
Fixes: QTBUG-22287
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-07-29 09:35:30 +02:00
Oliver Wolff
7138d6fd6b QWinRTFileEngine: Implement setSize
Fixes: QTBUG-77132
Change-Id: Ic0410297a2215f1b7b656966cbe84b925706532f
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2019-07-29 09:13:38 +02:00
Lorn Potter
570fb55a33 wasm: fix wide character data download
Need to pass correct buffer size

Change-Id: I19cb65114f49decc225cd807d59f1f08ad6b70c9
Fixes: QTBUG-76212
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-29 09:25:48 +10:00
Volker Hilsheimer
e24a4976be QHostInfo: Always post results through the event loop to the receiver
Lookups performed via QHostInfoRunnable must not synchronously call
the user-code's receiver objects, as that would execute user-code in
the wrong thread. Instead, post a metacall event through the event
loop of the receiver object, or the thread that initiated the lookup.

This was done correctly for the trivial cases of empty host name or
cached results, so the code generally existed. By moving it from a
global function into a member function of QHostInfoResult, we can
simply access the required data to construct and post the event.

As we process that posted event, we need to check that the context
object (which is already guarded via QPointer) is still alive, if
we had one in the first place. If we had one, and it's deleted, then
abort.

[ChangeLog][QtNetwork][QHostInfo] Functors used in the lookupHost
overloads are now called correctly in the thread of the context object.
When used without context object, the thread that initiates the lookup
will run the functor, and is required to run an event loop.

Change-Id: I9b38d4f9a23cfc4d9e07bc72de2d2cefe5d0d033
Fixes: QTBUG-76276
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-07-26 17:59:47 +02:00
Tor Arne Vestbø
e6498362fd macOS: Respect color space set on NSWindow when flushing backingstore
By default Qt tries to avoid potentially costly color matching by
not assigning an sRGB color space to our backingstore, even if
that's what we in practice fill it with.

We used to do this by assigning the display's color space, which
effectively opts out of color matching, similar to the old behavior
of the device RGB color space (which nowadays implies sRGB).

By picking up the color space from the NSWindow instead, we allow
the user to override the color space to trigger color matching,
for example by explicitly setting it to NSColorSpace.sRGBColorSpace.

NSWindow will fall back to the screen's color space if the window
doesn't have one set.

Task-number: QTBUG-47660
Change-Id: Iac8177e85e86fe9044a41eb2c93fbf26bb83c248
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-26 15:33:27 +02:00
Timur Pocheptsov
5b3c09e35f QMacStyle - another slider fix
As a follow-up to fixed resize handling: the trick Gabriel wanted
to use to enforce a specific look on a slider's bar, never actually
worked due to misplaced statement which essentially is cancelling
the 'magic' before the bar is drawn. Now it's fixed: bar is centered
(between the rows of tickmarks above and below) + it's had a nice
blue filling back!

Change-Id: I3021c2b86e4c25981eeee015e32baa24ccebc3bd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-26 15:12:17 +02:00
Liang Qi
28af6e97e5 Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" 2019-07-26 13:29:27 +02:00
BogDan Vatra
698faf7b6d Android: Fix SSL 1.1 support on API-21
OpenSSL 1.1.x libs must be suffixed otherwise it will use the system ones which on API-21 are OpenSSL 1.0 not 1.1

Fixes: QTBUG-76884
Change-Id: I7d4052be68cf7dc65f74a48da8e1e37182056a5e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-26 12:20:15 +03:00
Marc Mutz
6bc7309135 QResource: fix nullptr-check gone tautological
Amends 136c5b9338.

Before that change, each of the three members was a separate
Q_GLOBAL_STATIC, so checking resourceList() for nullptr was the
correct thing to do to find out whether the static was already
destroyed.

After the change, the resourceList() function will never return
nullptr. Either resourceGlobalData.isDestroyed(), in which case
dereferencing it asserts, or it isn't, in which case resourceList()
returns a valid pointer.

An explicit isDestroyed() check was added to the unregister function,
but the register one was also checking resourceList() for nullptr,
and this was left unprotected.

Add the check and remove the now-tautological checks for nullptr
resourceList().

Change-Id: I41fe66939ce858a77802b8af04c1de6e4fafe048
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-26 12:18:47 +03:00
Liang Qi
bf08e0bbb2 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/network/access/qhttpthreaddelegate.cpp

Change-Id: Id47b977587e2d713c16ac17e63c5ec80c2f05ee9
2019-07-26 10:13:06 +02:00
Timur Pocheptsov
0ce3f7d62b QMacStyle: workaround NSSliderCell's cached/stale geometry
It's a bit cheesy solution, but works as I've noticed first on
QSlider's with a ticks direction 'both'. Works because we were
already using numberOfTickMarks property to trigger a special
behavior for HIG non-compliant widgets. Works for our case too
- we trigger a geometry update.

Fixes: QTBUG-76811
Change-Id: I2cbf00d42d98e78519b281d138a2f74227ef5449
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-25 10:15:41 +02:00
Michael Brasser
65cdd0f366 Enable shader cache for ES2 when GL_OES_get_program_binary is present
Change-Id: I4fb71471a7dd22441def1eb837857d245c3e3c5a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-07-25 01:49:48 -05:00
Timur Pocheptsov
e4c1feae5c Implement 'preconnect-https' and 'preconnect-http' for H2
QNetworkAccessManager::connectToHostEncrypted()/connectToHost()
creates 'fake' requests with pseudo-schemes 'preconnect-https'/
'preconnect-http'. QHttp2ProtocolHandler should handle this
requests in a special way - reporting them immediately as
finished (so that QNAM emits finished as it does in case of
HTTP/1.1) and not trying to send anything.
We also have to properly cache the connection - 'https' or
'http' scheme is too generic - it allows (unfortunately)
mixing H2/HTTP/1.1 in a single connection in case an attribute
was missing on a request, which is wrong.
h2c is more complicated, since it needs a real request
to negotiate the protocol switch to H2, with the current
QNetworkHttpConnection(Channel)'s design it's not possible
without large changes (aka regressions and new bugs introduced).

Auto-test extended.

Fixes: QTBUG-77082
Change-Id: I03467673a620c89784c2d36521020dc9d08aced7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-07-24 16:03:02 +02:00
Oliver Wolff
589d96b9b0 winrt: Remove QWinrtScreen::pixelDensity so that the default of 1.0 is used
Winrt does device independent scaling by default so that overwriting
pixelDensity for QWinrtScreen will break the use case of setting
Qt::AA_EnableHighDpiScaling. That mode is basically always active on
winrt.

Task-number: QTBUG-76363
Change-Id: Ib522201850d17757be4a80aa819c3f1245ca7147
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2019-07-24 08:49:09 +02:00
Allan Sandfeld Jensen
c21cc647e9 Fix lancebench results oddness
Imports were expanded in the list of commands every time they were
evaluated. This meant any test with imports ran slower and slower the
more iterations it got through.

Fixed by creating a new PaintCommands object every time and living with
initialization of it being part of the benchmark results.

Change-Id: Ib53a3a25f1393437452bc5aede04ccb63e8715a6
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-07-23 11:47:51 +00:00