Commit Graph

42857 Commits

Author SHA1 Message Date
Giulio Camuffo
b15ed929f3 Fix memory leak
When creating a new QColorSpacePrivate it must be reffed otherwise in
the destructor the deref() will bring the count to -1 which is true
and will not delete the d_ptr.

Change-Id: Id569bae22134b56bf6ad37158d7079b495599fd7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 20eabb72de)
2020-03-25 01:15:51 +01:00
Morten Johan Sørvig
1d5eb202b9 wasm: Add OpenGL version check
QtQuick3D probes for the supported OpenGL level by testing
multiple OpenGL versions in descending order. Context creation
must fail for versions not supported by WebGL. It does not
appear that Emscripten does this for the 3.x minor versions,
at least.

Add version check which allows OpenGL (ES) 3.0 and 2.0.

Change-Id: Ide8745dd79e69af86812a8d6f5d6cc16ecdd099a
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2020-03-24 21:08:54 +00:00
Morten Johan Sørvig
d00f28afda Revert "wasm: support emsdk >= 1.39.4"
This reverts commit bcdf49bcc6.

This was a 5.14-only commit which accidentally found its
way to 5.15.

Change-Id: Iaef6f05fce20ab61d3afb8cb3c359a037e4c0b28
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2020-03-24 21:50:55 +01:00
Allan Sandfeld Jensen
5e1e4b9d52 Extend tiled optimization in 64-bit painting to 64-bit sources
Change-Id: I74b88781d631ee68822cd08f9cb0aca03f7b688e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-03-24 21:29:22 +01:00
Liang Qi
08fff0cb55 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-03-24 21:22:40 +01:00
Timur Pocheptsov
4561370661 More qOverload cleanups in qtbase
Task-number: QTBUG-82605
Change-Id: I1c3c14ed82911ed5483258c11e76f5dd7744fa12
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-03-24 20:58:13 +01:00
Allan Sandfeld Jensen
28a0f1ba79 Fix use of deprecated ::forcesign
Change-Id: I39322bcc0e24d0bfccf43c8700a166ce350208ea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-03-24 17:41:30 +01:00
Mårten Nordheim
fc1b5eac1a QAbstractSocket: Fix usage of deprecated error signal in example
Task-number: QTBUG-82605
Change-Id: I83a8777d32302607d48dd670b6c787ac05db88d2
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-03-24 17:40:40 +01:00
Kai Koehne
45a131d465 Fix whitespace in Qt5XXConfig files
Remove some unneeded empty lines, and fix indentation.

Change-Id: Ie35e95f35f9625cc75070074be96bdeb62d5fd4c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-24 17:40:40 +01:00
Kai Koehne
99ace38d22 CMake: Also import Qt plugins that are not literally named *Plugin
There are some plugins in qtlocation, qtdeclarative whose names are not
suffixed with 'Plugin', so the current logic fails to load the
corresponding QtModule_XXX.cmake file.

Work around this by just searching for

  Qt5$${CMAKE_MODULE_NAME}}_*.cmake.

Users can define QT5_STRICT_PLUGIN_GLOB
or Qt5$${CMAKE_MODULE_NAME}_STRICT_PLUGIN_GLOB
to change back to the old behavior.

[ChangeLog][cmake] Fixed an issue where some Qt location and
declarative plugins whose name did not end with "Plugin"
where not imported by the corresponding Qt component package.

You can force the old behavior by setting QT5_STRICT_PLUGIN_GLOB or
Qt5ModuleName_STRICT_PLUGIN_GLOB before the find_package(Qt5 ...)
call.

Fixes: QTBUG-58812
Change-Id: Ic8adf9562841ed49eabc4f7fb2b5ae257ca606cd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-24 17:40:40 +01:00
Liang Qi
576dc2c701 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/plugins/platforms/xcb/qxcbdrag.cpp

Change-Id: I0b47324b70b0b4894e54b21aa3e7a5041f9bd5e3
2020-03-24 14:36:02 +01:00
Sze Howe Koh
6a972f44f3 QXcbCursor: Replace deprecated QCursor API
Align with e79a625381 in qtbase.

Task-number: QTBUG-48701
Change-Id: Ia3ca2de6bbf4e9c1738f77193351dd95a14dd2dc
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-03-24 06:26:33 +00:00
Volker Hilsheimer
34fe5f75bc Deprecation warnings: replace qrand with QRandomGenerator
Change-Id: I80fe6f611b367c6c8a1b77e82dc791493f88929b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-03-23 20:24:58 +01:00
Alexander Volkov
cc1d891b8e xcb: Add support for XdndActionList property
This allows to pass and receive possible drop actions from other
processes, including GTK applications.

Fixes: QTBUG-75744
Change-Id: I944edc6fa00f8801a25912e70eb104a647a9fc0e
Reviewed-by: JiDe Zhang <zccrs@live.com>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-03-23 19:35:19 +03:00
Mitch Curtis
3f744be923 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-03-23 13:55:35 +01:00
Timur Pocheptsov
da1d6bccd2 Fix the name in invokeMethod
Task-number: QTBUG-82605
Change-Id: If21d9c25d607e8a363fe703b4ffa1e2d207eef39
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-03-23 12:58:06 +01:00
Ulf Hermann
94c564a082 Fusion Style: Use qobject_cast rather than dynamic_cast
We want to avoid RTTI.

Fixes: QTBUG-82287
Change-Id: Ib034094d4035d6dfa99d00ac198c93cc9572755b
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-03-23 12:00:46 +01:00
Jean-Michaël Celerier
b4b8ffb233 rhi: gles2: fix uniform gathering after struct-type member in UBOs
Given:

    struct Light { vec4 foo; };
    layout(std140, binding = 2) uniform material {
      Light light;
      int lightCount;
    };

the previous code would keep "light" appended for the prefix and look for
`light.lightCount`.

Change-Id: Ia8deacd0cb4833f45151e922fa7b5970169332eb
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-03-23 10:59:30 +01:00
Lorn Potter
50c6882e9f wasm: Boost emscripten 1.39.8 as recommended
[ChangeLog][WebAssembly] Updated emscripten to version 1.39.8

Change-Id: I8d19f851eb0c0dd912792cee0db69e61cf4fd5f6
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-03-23 03:29:41 +00:00
Joni Poikelin
cb509f3aee Doc: fix copy paste errors in border-*-style documentation
Change-Id: I442513ec87e25610898c2102170a5f2bfec5ee77
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-03-21 11:36:04 +02:00
Christian Ehrlicher
1e03015d55 QTableView: Make sure to repaint all needed cells during resizing
Don't try to update the scrollarea geometry while resizing a row or
column since this may lead in flickering and artifacts, esp when the
scroll mode is scrollPerItems. Instead do the calculation only when the
resize is finished.

Fixes: QTBUG-72870
Fixes: QTBUG-82595
Change-Id: Id6903c00485b3be6ed54bd5f9bcafdda6da21598
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-03-21 07:05:27 +01:00
Thiago Macieira
d55dad94f9 64-bit atomics: fix bad copy/paste in macro definitions
Fixes: QTBUG-82864
Change-Id: I35d5bcc92b2e4bddaacbfffd15fc42d054fcb2b1
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-03-20 17:12:58 -05:00
Christian Ehrlicher
bd75c87e0e Doc: replace deprecated references to QGLWidget
Remove references to the deprecated QGLWidget and replace it with
QOpenGLWidget.

Change-Id: Ia31df42ab61c25e9ce46f4491267d2c64910f55c
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-20 22:27:29 +01:00
Volker Hilsheimer
580e9eedf7 QDateTimeEdit: with keyboardTracking off, allow values outside the range
QDateTimeEdit very aggressively prevents user input that would result in
values that are outside the dateTimeRange. While keyboardTracking is on
this makes sense, as otherwise the dateTimeChanged signal would be
emitted after each section, with a value that is outside the range.

However, this prevented users from entering a date that is allowed, but
where sections of the date are above or below the respective section in
the maximum or minimum value.

If keyboardTracking is off, QDateTimeEdit only emits the dateTimeChanged
signal at the end of editing, when focus is lost or the return key is
pressed, and then it enforces that the value is within the range anyway.
This change makes the parser ignore the range during editing if
keyboardTracking is off, thus allowing the user to enter a date where
temporary values are outside the range.

The test makes sure that we don't get signals emitted with out-of-range
values, testing both with and without keyboard tracking.

Change-Id: I00fb9f1b328a3477163f890c4618b40878657816
Fixes: QTBUG-65
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-20 22:18:00 +01:00
Thiago Macieira
30a0787907 Fix binary compatibility issue in QJson{Array,Object} initializer_list
The rewrite using CBOR internals replaced one of the two naked pointers
that were members of QJsonArray and QJsonObject with a
QExplicitlySharedDataPointer. The problem is that its operator= will
read the current value to decrement the refcount and possibly delete the
pointed object.

But QJson{Array,Object}::initialize() are called from inlined code,
without initialization. So we can't call operator=. We need to memcpy to
write a nullptr.

This is not unit-testable because it requires compiling against 5.14 or
earlier, then running against 5.15.

Fixes: QTBUG-82700
Change-Id: Iaa63461109844e978376fffd15f98c62656d197c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-03-20 13:18:00 -08:00
Thiago Macieira
c798b286bd Doc: update QJsonObject::operator[] non-const to say it creates key
the non-const QJsonArray::operator[] requires a valid index and all the
const operator[] say that it returns Undefined if the key or index
doesn't exist. This is the exception.

Task-number: QTBUG-39864
Change-Id: Iaa63461109844e978376fffd15f9716f0cc66cca
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-20 21:18:00 +00:00
Giuseppe D'Angelo
d41d8297c8 OpenSSL: bump the minimum supported version to 1.1.1
We don't support 1.0 any more, and 1.1.0 has reached EOL.
Bump to 1.1.1 so we can freely use its APIs.

[ChangeLog][QtNetwork][SSL] The minimum required version
of OpenSSL is now 1.1.1.

Change-Id: I5cfb6672fadfa48aedaefbcd6a954aa9eb85bfa5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-20 18:23:55 +01:00
Robin Burchell
2af04860f6 qtimezoneprivate_tz: Apply a cache over the top of timezone data
Constantly re-reading the timezone information only to be told the exact
same thing is wildly expensive, which can hurt in operations that cause
a lot of QTimeZone creation, for example, V4's DateObject - which
creates them a lot (in DaylightSavingTA).

This performance problem was identified when I noticed that a
QDateTime binding updated once per frame was causing >100% CPU usage
(on a desktop!) thanks to a QtQuickControls 1 Calendar (which has a
number of bindings to the date's properties like getMonth() and so
on).

The newly added tst_QTimeZone::systemTimeZone benchmark gets a ~90%
decrease in instruction count:

--- before
+++ after
 PASS   : tst_QTimeZone::systemTimeZone()
 RESULT : tst_QTimeZone::systemTimeZone():
-     0.024 msecs per iteration (total: 51, iterations: 2048)
+     0.0036 msecs per iteration (total: 59, iterations: 16384)

Also impacted (over in QDateTime) is
tst_QDateTime::setMSecsSinceEpochTz(). The results here are - on the
surface - less impressive (~0.17% drop), however, it isn't even
creating QTimeZone on a hot path to begin with, so a large drop would
have been a surprise.

Added several further benchmarks to cover non-system zones and
traverse transitions.

Done-With: Edward Welbourne <edward.welbourne@qt.io>
Task-number: QTBUG-75585
Change-Id: I044a84fc2d3a2dc965f63cd3a3299fc509750bf7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-20 16:58:09 +02:00
Mauro Persano
d535dfea1f Doc: replace QFileInfo::created with birthTime
Change-Id: Ia497febcbf28e4b3babe50fc6f05e12f3d686b91
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-03-20 09:20:54 -03:00
Mitch Curtis
69a5be7ef0 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ib2a2e3a292af43be3a980c2ccc943c08f4bbf72f
2020-03-20 11:28:14 +01:00
Allan Sandfeld Jensen
aa5855847c Add SSE2 optimized solid source composition
Very similar to source-over, but have traditionally been inlined.

Change-Id: I211f0b1c91c1a00c4769fbbfe2e3d0c7b22d7048
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-03-20 09:56:15 +01:00
Laszlo Agocs
6c5b42b678 rhi: gl: Reduce state changes
...between setGraphicsPipeline() calls with different
QRhiGraphicsPipeline instances within the same pass.

Also adds similar logic for the GL_ARRAY_BUFFER (vertex buffers)
as that is a hotspot as well.

This is not intended to be a 100% avoiding any redundant call solution,
but rather to take care of the most common hotspots, so that bad OpenGL
implementations with a larger API call overhead will not cause us to
regress compared to the direct OpenGL rendering path in Quick and
Quick3D.

What we have here reduces the number of GL calls in the view3d example
by ~200 within one frame, which is a pretty good start.

Task-number: QTBUG-78603
Change-Id: I6aeab9c1c43b148ea6ef05d0284990a996c7ba28
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-03-20 09:43:04 +01:00
Volker Hilsheimer
e7cff5bca7 Fix keypad navigation within a button group for push buttons
Keypad navigation within a group should work for auto-exclusive buttons,
or for checkable buttons that are in a button group. Since the code
already tests whether the button should be treated like an exclusive
(which implies checkable) button, use the result of that test when
finding the candidate button to move focus to, and not only when
actually changing the checked button and the focus.

Change-Id: I4dc41a90d51a8304483046252ceff0ebfe2a2e52
Fixes: QTBUG-27151
Done-with: david.faure@kdab.com
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-03-20 08:20:00 +01:00
Cristian Adam
40f4b3de1a qeasingcurve/tst_qeasingcurve: Fix for MinGW 8.1 x86
Test fails on MinGW 8.1 x86, but not on MinGW 8.1 x86_64.

Task-number: QTQAINFRA-3304
Task-number: QTBUG-69947
Change-Id: Ie9a35bd6d5a8481028cd0ea426d1cf00bd7cf093
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-03-20 07:56:53 +01:00
Nico Vertriest
0359a82e6e Doc: make Qt Sql snippets compilable
Task-number: QTBUG-81496
Change-Id: Id6206e9179c2e8157c99e777a3de35bd83d49e34
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-03-20 06:53:59 +01:00
Mitch Curtis
fcbbe7ff21 Merge "Merge remote-tracking branch 'origin/5.14.2' into 5.14" 2020-03-19 16:14:25 +01:00
Mitch Curtis
1480922511 Merge remote-tracking branch 'origin/5.14.2' into 5.14
Change-Id: I34ca28c75b88e882c3f35f182bf01acb22b77637
2020-03-19 16:10:31 +01:00
Mårten Nordheim
b77e239c5e Fix perl script warning
The apache logs are filled with warnings about this when it's used.

https://blog.gerv.net/2014/10/new-class-of-vulnerability-in-perl-web-applications/

Change-Id: I977d2b022d706d9587c033fd8e80f129e60c439c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-03-19 14:15:04 +00:00
Tor Arne Vestbø
45fe7adcb8 widgets: Clarify backingstore resize logic by removing cruft
Change-Id: I0a449068a0d4557b7bd6581ddf71c590b72d76a1
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-03-19 15:14:29 +01:00
Tor Arne Vestbø
5f3c071ee3 widgets: Remove unused member QTLWExtra::inTopLevelResize
It was introduced in Qt 4.4 (e150f6a6e619) to work around slow resizes
on Windows and X11 due to excessive painting, but has since been removed
when old dead code never ported to QPA was removed in a2337f79ff.

Change-Id: Ic14e714a02edb4194a445a6bb0759b601799fdc6
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-03-19 15:14:29 +01:00
Allan Sandfeld Jensen
cfbe481838 QDrawHelper cleanups
We don't need to handle solid SourceOver logic directly, this was
already handled by getOperator and changed composition to Source.

Also removes some dead code and changes an assert in unreachable
code to Q_UNREACHABLE.

Change-Id: I66a6c1248bd34e31096023f1acb20385099932c9
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-03-19 15:14:29 +01:00
Timur Pocheptsov
ad68ecf1d9 q_getTimeFromASN1: fix invalid access
No sanitizer is needed, just looking at the code is enough.
It was wrong.

Change-Id: I9df417c137d6b3361c3161865e099a8be40860de
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-03-19 14:48:08 +01:00
Eskil Abrahamsen Blomfeldt
1a18e138f4 Android: Fix deployment on Windows host
The paths in the build properties require forward slashes
apparently. On Windows, we would default to native backslashes
and they would be stripped from the path. Converting to forward
slashes fixes the problem.

Issue was introduced by dd04fb639b,
since before that, the NDK path was retrieved from the environment.

Fixes: QTBUG-82944
Change-Id: I6c51113efcf671461a5871991b3225a52b95266c
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-03-19 10:23:07 +01:00
Lars Knoll
5eb492fb95 Move the default arguments of fromPath away from the deprecated overload
Move the default arguments to the overload that is not deprecated. This
is fully source and binary compatible.

Change-Id: I0d2eb491faf8c2164b80c33c4c4f749173b690f5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-03-19 09:27:18 +01:00
Fabian Kosmale
fd72ed794d Consider qml dependencies from qrc files in static builds
qmlimportscanner already has support for qrc files, however the rule in
qt.prf did not pass the required arguments to it so far. In combination
with the declarative registration of types, this broke static linking.

Fixes: QTBUG-82873
Change-Id: I4462645e0b353265f9953807dee73f94923dab9f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-03-18 13:23:24 +01:00
Qt Forward Merge Bot
2329580411 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-03-18 11:45:01 +01:00
Qt Forward Merge Bot
22daba4ff9 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Iaab37b633a8286c2c21425aaac34d30529a3ea82
2020-03-18 11:44:49 +01:00
Timur Pocheptsov
05dd80871c tst_QMenu: make QSKIP message truthful
Since the test was refactored and QCursor::setPosition() replaced
with QTest::mouseMove(), the test is completely crippled on macOS,
since it relies on the parts in widget's code, ifdefed with condition
!Q_OS_OSX and commented as "Cocoa tracks popups". Yes it does,
but not for "fake" events generated by QTest. The original test
was introduced when fixing different problems on non-Apple platform(s)
anyway. Let's make QSKIP message saying the truth.

Task-number: QTBUG-63031
Change-Id: If54f195ccc0d4409cc2e7f4ae0b0fbf43989b286
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-03-18 10:02:29 +00:00
Fabian Kosmale
6db55e3451 QSequentialIterable: Treat sets as appendable
QSet and std::(unordered_)set were so far not treated as appendable, as
they lack a push_back method. We do however need support for this in
declarative to enable converting back from QJSValue arrays to sets.
We achieve this by testing for and using the insert method. While vector
has also such a method, it doesn't take a single value, but rather a
position or iterator + value, so the template specialization is not
ambiguous.

Task-number: QTBUG-82743
Change-Id: I74fc7b1b856d9bcd38100b274ba2b69578ea8bbb
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-03-18 09:54:19 +01:00
Volker Hilsheimer
943cb0999d Header-review: add Q_DECL_DEPRECATED_X macro to deprecated method
Change-Id: I486d479b2e07042b397869aab117f44e65539f1e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-17 18:20:04 +01:00