Commit Graph

37378 Commits

Author SHA1 Message Date
Alexey Edelev
6fb569af95 Unify QLibraryInfo settings
Exporting QLibraryInfo internals allows to reuse settings in
qmake/qtpath without having to keep its own instance.
Also there is no need to check setting groups in QLibraryInfo
except the 'Paths' group, since this logic belongs to qmake/qtpaths
only.

Change-Id: If762defba025ad7f7489f8a86ef5768a8628bd2f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-17 11:57:11 +01:00
Joerg Bornemann
a423c0d211 Merge "Fix installation of Find*.cmake files in shadow per-repo builds" 2021-03-17 10:39:14 +00:00
Kai Köhne
8dac535a87 Merge "MSVC: Build harfbuzz with -Zc:__cplusplus -permissive-" 2021-03-17 10:12:10 +00:00
Robert Löhning
bc5fecf948 Fix compiler warnings in 32-bit builds
comparison of integers of different signs: 'unsigned int'
and 'qsizetype' (aka 'int') [-Wsign-compare]

Pick-to: 6.1
Change-Id: Ia27f79ab4abca8b757b65ef5f1d30151842088fe
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-17 09:12:05 +00:00
Joerg Bornemann
7b4507d0be Fix qmake user projects for QT_LIBINFIX builds on Windows/iOS
QMake user projects could not be built on Windows or iOS if Qt was
configured with QT_LIBINFIX set. The code that generates
qt_lib_entrypoint_private.pri file did not take into account the lib
infix.

Pick-to: 6.1 6.0
Fixes: QTBUG-91511
Change-Id: Ibc40548a269238320f8f89a710d10e7f639246cb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-17 09:04:56 +01:00
Kai Köhne
78fee50e53 MSVC: Build harfbuzz with -Zc:__cplusplus -permissive-
harfbuzz includes QtCore/qatomic.h. But the Qt headers are expected
to be compiled with -Zc:__cplusplus.

Change-Id: I28847844e9a00f2b7c84f0d5d7d3257eb22e2e8e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-17 07:59:35 +00:00
Thiago Macieira
ae9e433753 Remove unnecessary int() casting in QRandomGenerator::bounded
Commit 21d3916817 added the 64-bit
version, so qsizetype now works cross-platform. The casts were added to
make qtbase compile on commit df853fed66.

Change-Id: I26b8286f61534f88b649fffd166c409c5c232230
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-17 06:21:52 +00:00
Oliver Eftevaag
57f752b30a Add nullptr check
Adding a nullptr check before dereferencing in case q is null.

Pick-to: 6.0 6.1
Change-Id: Ia440e2ed41cbaf06a5919930c2e1615bb3916ff3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-16 18:44:17 +01:00
Sona Kurazyan
2eec7db03d Merge "Mention QPromise in the QFuture docs" 2021-03-16 17:03:59 +00:00
Niclas Rosenvik
a03d0ba208 Merge "Enable X11 on other platforms than just Linux" 2021-03-16 15:54:26 +00:00
Morten Johan Sørvig
c48a5b2458 Merge "Round physical dpi when calculating scale factor" 2021-03-16 15:24:31 +00:00
Topi Reinio
bddad0079f Merge "Doc: Fix various documentation issues" 2021-03-16 15:03:27 +00:00
Sona Kurazyan
0477f6b15a Mention QPromise in the QFuture docs
Pick-to: 6.1 6.0
Change-Id: I5f6930116da534dd1dea41c4724c42104de38877
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-03-16 15:40:52 +01:00
Edward Welbourne
d0bf7f471b Merge "Use QFile directly instead of via QTextStream" 2021-03-16 13:12:40 +00:00
Niclas Rosenvik
05e4c8f2e9 Enable X11 on other platforms than just Linux
Set CMake variable X11_SUPPORTED for all systems that have X11.
Adjust _adjust_library_map() in util/cmake/helper.py to apply X11_SUPPORTED
condition around X11 related packages instead of just LINUX.
Adjust configure.cmake in src/gui based on this change.
Why, because X11 is not just Linux.

Change-Id: Ic3c04eaa55301d1237c7e74281eccd4f8e27e9ce
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-16 13:05:17 +00:00
Topi Reinio
00e10f62b5 Doc: Fix various documentation issues
- Document QIODeviceBase
- Document QPointerEvent::points
- Fix linking issues

Task-number: QTBUG-90662
Change-Id: Ib123d5708953b22e01f95c82626b39a49fff95b2
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
2021-03-16 13:17:39 +01:00
Morten Johan Sørvig
ad10fd2a6f Round physical dpi when calculating scale factor
(For the QT_USE_PHYSICAL_DPI use case)

The physical DPI is nominally computed from the physical
screen size, however when QT_USE_PHYSICAL_DPI is set
that size has typically been overridden with a fake
size by the user, such that the resulting DPI calculation
will yield some specific integer DPI.

Round this DPI value in order to arrive at a nice scale
factor, e.g. 144/96 = 1.5 instead of 144.01/96 = 1.5001

Change-Id: I665394e98a818b3a8f46408f3193cac4411f458d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-16 13:11:06 +01:00
Laszlo Agocs
0bd705d91b Merge "rhi: metal: Remove most availability guards" 2021-03-16 11:00:36 +00:00
Edward Welbourne
eefaf54d9e Use QFile directly instead of via QTextStream
Follows up on a TODO comment that says QTextStream is less efficient.
In any case, QFile has readLine() returning QByteArray, without
conversion to QString, and the parsing is uncomplicated.

Change-Id: I06e563df417692d3b6514a52a313a0ff55b0b52e
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-16 11:50:51 +01:00
Edward Welbourne
17bf553b76 Include minus sign in ImhFormattedNumbersOnly's available keys
UIKeyboardTypeDecimalPad only provides digits and decimal point, no
minus sign, but ImhFormattedNumbersOnly is documented to provide a
minus sign as well. UIKeyboardTypeNumbersAndPunctuation includes
punctuation, which should cover signs as well as decimal separator, so
use that - same as for ImhPreferNumbers. A little more permissive than
we want here, but that's better than more restrictive !

Fixes: QTBUG-91455
Pick-to: 6.1 6.0 5.15
Change-Id: I0418946014e0a66d503e61704154fd7798a0b785
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-16 11:50:24 +01:00
Laszlo Agocs
a668bc29bb rhi: metal: Remove most availability guards
Once the deployment target is bumped to 13.0, most guards
can be removed.

Pick-to: 6.1
Change-Id: I7566a4f2915ada9defa1a4bcee10f75021222b30
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-16 09:52:59 +01:00
Eirik Aavitsland
9fa181446c Minor robustness improvement of text code
Fix a potential issue reported by static analysis

Change-Id: I41b8eaa3c0840eec054e880c4f3298ee32685b46
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2021-03-16 08:47:57 +01:00
Morten Johan Sørvig
68e69588e0 Merge "Add auto-test for QT_USE_PHYSICAL_DPI" 2021-03-15 15:54:49 +00:00
Volker Hilsheimer
8962fed044 Merge "Port from QScopedPointer to std::unique_ptr" 2021-03-15 14:50:32 +00:00
Zhang Hao
42b0052d97 Merge "Code tidies" 2021-03-15 12:54:05 +00:00
Morten Johan Sørvig
657284acbc Don’t store screen scale factors in GLOBAL_STATIC
Use a normal static variable, like the other high-dpi
variables.

Clear the stored factors in initHighDpiScaling(). This
makes auto-testing possible where the application object
is recreated for each test case and should start with
a clean slate.

Change-Id: I1831c856b5d7a2c522e62c7ed0657da771c3144f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-15 11:49:52 +01:00
Morten Johan Sørvig
4d1f13f354 Read high-dpi env. variables in initHighDpiScaling()
Move all environment access to initHighDpiScaling(),
which makes it so that all environment access happens
at one point in time during QGuiApplication construction.

Replace the “qt.scaling” logging category with “qt.highdpi”,
and log each recognized env. variable. Further logging
of DPI and computed scale factors will be introduced
later on.

This also enables auto-testing of the environment variable
settings, since the auto-test can now control when the
environment is read by (re-)creating the application
object.

Change-Id: I4e62a9c0050438357a58ace5b50fb7c5950c87ce
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-15 11:49:48 +01:00
Volker Hilsheimer
45b7af038f Port from QScopedPointer to std::unique_ptr
Silence compiler warnings from deprecated QScopedPointer::swap after
fe9d7bf759.

For Qt 7, both QSslCipher and QNetworkAddressEntry should be made into
implicitly shared classes.

Change-Id: Idfd5ec4b5a0f156f212d57684822a3cd1d88de1a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-15 11:35:43 +01:00
Zhang Hao
a59ab30122 Code tidies
Delete the conditional judgment that must be established

Change-Id: I3bd94ca7b3862ab7c46370d98bf7e6cf8c040853
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-03-15 17:26:37 +08:00
Martin Storsjö
1ac2e85025 qtpaths: Fix cross compilation for windows
The cmake target may not be named "qtpaths", but one should be using
${target_name} instead. If cross compiling, and
QT_BUILD_TOOLS_WHEN_CROSSCOMPILING isn't set, the tool won't be built
at all and there's no such target to set properties on, and if it
isn't set, the target name is something else.

Change-Id: I3d904036106b38df6e56ad35d400cf9a0bb1cbdf
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-15 10:30:18 +02:00
Thiago Macieira
420755edb7 QRandomGenerator: remove dead code previously used by qrand()
Commit 9ee554ac1d removed qrand() and
qsrand(), so commit 81896304dc removed the
functions accessing QRandEngine, but forgot to remove the actual engine.

Pick-to: 6.1
Change-Id: I26b8286f61534f88b649fffd166c41aecf55d2b1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-14 23:07:24 +00:00
Giuseppe D'Angelo
4f4d7de499 QSslError: port to unique_ptr
So to avoid QScopedPointer::swap deprecation. Side note,
QSslError is not implictly shared (although it should be, but
that's a job for Qt 7).

Change-Id: I42f7abffa81d72aac5af157074a0c3cbd20ba253
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-14 18:28:39 +01:00
Peng Wenhao
faa6f19b2a make qmljsDebugargumentsstring() and forceOpen() const
Guessing the const specifier was accidentally forgotten

Signed-off-by: Peng Wenhao <pengwenhao@uniontech.com>
Change-Id: I611acc8d67d3eb101df9c8d816dd5779241a79f8
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-03-13 20:47:50 +08:00
Alexey Edelev
b0680cf5b1 Merge "Move qtpaths from qttools repository to qtbase" 2021-03-12 14:55:30 +00:00
Eskil Abrahamsen Blomfeldt
26e639b4f5 Merge "Fix QVulkanWindow on Wayland" 2021-03-12 14:11:03 +00:00
Morten Johan Sørvig
ba74953f4f Merge "Remove “scaling” logging from QBackingStore" 2021-03-12 13:40:13 +00:00
Elvis Lee
db0cd4c3d0 Merge "Support additional gbm surface flags" 2021-03-12 12:26:13 +00:00
Alexey Edelev
933343b16d Move qtpaths from qttools repository to qtbase
qtpath should replicate the functionality of 'qmake -query'. Also we
want this tool to be available in builds without qttools.

Task-number: QTBUG-75870
Change-Id: I6578fc4fc45dd940fd353a5cfe6db0a12744230a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-12 13:20:04 +01:00
Eirik Aavitsland
f0862c08f1 Merge "Avoid undefined color values in corrupt xpm image" 2021-03-12 11:41:26 +00:00
Eskil Abrahamsen Blomfeldt
be14adfdc8 Fix QVulkanWindow on Wayland
The Wayland backend needs 4 buffers and is failing when
making QVulkanWindow since there was a hardcoded limit at
3.

The Vulkan-backend to RHI already has smarter handling of
this. We want to limit the changes we do to the "legacy"
QVulkanWindow, so we keep the hardcoded max value but
increase it to 4 to accommodate the requirements on
Wayland.

Task-number: QTBUG-91418
Change-Id: I830bc30d1c2eeac1b076c50d35d5d138fd46dace
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2021-03-12 12:36:48 +01:00
Morten Johan Sørvig
fd27fcf185 Remove “scaling” logging from QBackingStore
Prepare for renaming the logging category.

Change-Id: I1fefefa510032ca70754fde9d80f9ac35ffa977b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-12 11:58:58 +01:00
Elvis Lee
a77ca7c9c4 Support additional gbm surface flags
Some vendor requires more gbm surface flags for specific purpose,
such as protected content.

Change-Id: Ie7db337e05f941b5480ffaccf61fbc94eb989ffc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-12 10:10:41 +00:00
Eirik Aavitsland
f651e6a26c Avoid undefined color values in corrupt xpm image
Issue reported by Codechecker.

Pick-to: 6.1 6.0 5.15 5.12
Change-Id: I1a5aa2203fb31e0ce3b630a11e450925aee81fb0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-03-12 10:01:27 +01:00
Andrei Golubev
f226854d25 Fix QMultiHash::count(key) crash
As QMultiHash uses a pointer for the data, nullptr dereference is a
thing, so check for valid d before doing anything in count()

Fixes: QTBUG-91704
Pick-to: 6.0 6.1
Change-Id: Ia20440cd7bdc03cb09c77f796fb9c5b52765eac5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-12 08:38:42 +01:00
Tang Haixiang
ae88dea1be Merge "Add setting the ICON size attribute in lineedit to the style plugin" 2021-03-12 02:49:27 +00:00
Aleix Pol
0a77920e56 Merge "Remove unnecessary class member" 2021-03-12 01:20:47 +00:00
Tang Haixiang
24226bb5f5 Add setting the ICON size attribute in lineedit to the style plugin
When the font is large enough, using PM_SmallIconSize will get a large
lineedit,but the icon is very small. This is very unsightly, and the
style plug-in hopes to be able to define the size of the icon by itself.

Change-Id: I0e35b331301472541d3378e748dbcd074d5419a2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-12 08:39:04 +08:00
Aleix Pol
23db5ed0b3 Remove unnecessary class member
It's never used or accessed. It's not part of exported API.

Change-Id: Ie60a560fb6f1315a53442f3c067363e651b80768
Reviewed-by: David Edmundson <davidedmundson@kde.org>
2021-03-12 00:12:01 +01:00
Volker Hilsheimer
674747bac1 Revert "QPushButton: fix support of style sheet rule for text alignment"
This reverts commit 6269438af9, and adds a test.

This change introduced QTBUG-91735, without fixing QTBUG-86857 correctly. The
code already interprets the textAlignment values from the rule, also if no
icon is set. Adding the same, or some default textAlignment to the text flags
if there is no icon doesn't work.

Fixes: QTBUG-91735
Task-number: QTBUG-86857
Pick-to: 6.1 6.0 5.15
Change-Id: Iee07e63a40e72909275f32e1caa28b33a595f879
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-03-11 22:30:22 +01:00
Tang Peng
dbdde8d023 Merge "Remove unreachable code" 2021-03-11 21:10:33 +00:00
Thiago Macieira
2851edc027 Merge "Futex/Windows: add support for notifying TSan" 2021-03-11 20:34:00 +00:00
Fabian Kosmale
fb7bad01fe Merge "QObject: remove QAbstractDeclarativeData::parentChanged" 2021-03-11 18:03:39 +00:00
Thiago Macieira
d424ccdb77 Futex/Windows: add support for notifying TSan
The code was already there, just only implemented for Linux.

Change-Id: Ib709fc1585f647a98d54fffd16663881b6d24d6f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-03-11 17:42:35 +01:00
Tang Peng
b5615d3921 Remove unreachable code
Having a `break` after a `return` is pointless as it's never reached.

Change-Id: I30877e926c006fac45681f547e97a55410f02e43
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-11 16:11:00 +00:00
Alex Trotsenko
6bd6151329 QProcess/Win: implement async closing of write channel
Instead of blocking in QProcessPrivate::closeWriteChannel(), we can
handle a pending close in _q_canWrite() slot when there is no more
data to write.

Change-Id: I2a30789b6099a2ec075292348ebe33a11341bca3
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-03-11 16:05:40 +02:00
Paul Wicking
5fa8f5df7b Doc: Change section titles that cause bad links
Section titles are valid targets for QDoc's autolinker. When
they are identical to other valid link targets, such as for
example a class, these sections may cause invalid links.

Pick-to: 6.0 6.1
Fixes: QTBUG-91141
Change-Id: Ie9a6258d2bf83932335976d8c0b5fc59f2028ae5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-03-11 15:01:35 +01:00
Paul Wicking
b42df9756a Doc: Add hyperlink to relevant section
Pick-to: 6.0 6.1
Fixes: QTBUG-91734
Change-Id: I3910c7fcf1625ad08a65e691a8eaf9ed6b61779a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-11 15:01:33 +01:00
Fabian Kosmale
e8b7e4e96a QObject: remove QAbstractDeclarativeData::parentChanged
The code in qtdeclarative did not do anything at all anymore.

Change-Id: Idd97145cb74aeb4f43dfce2f282a765e90945073
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-03-11 14:53:26 +01:00
Mårten Nordheim
d76c0e3224 Merge "QEventDispatcher(Win): Always honor interrupted status to avoid races" 2021-03-11 13:31:17 +00:00
Eskil Abrahamsen Blomfeldt
3102d611bd Merge "Support family names that end/start with space" 2021-03-11 13:09:00 +00:00
Laszlo Agocs
aa9b4bd01e Merge "rhi: metal: Stop using BufferOp for no good reason" 2021-03-11 11:33:53 +00:00
Mårten Nordheim
f274f91ceb QEventDispatcher(Win): Always honor interrupted status to avoid races
There may be a race where e.g. thread 'B' is woken up by a queued invoke.
At the same time thread 'A' asks 'B' to quit, which will set various
atomics (some important ones are 'interrupt' in the dispatcher and
'exit' in the event loop), but it does _not_ try to send another wake
since there is already an unhandled wake triggered by 'B' itself.
Sadly 'B' reads the 'exit' atomic before 'A' updates it.
Then, slightly before, 'B' sets 'interrupt' back to 0, 'A' write 1 to
it, meaning 'A's interrupt is ignored. Then, since there is no
interrupt, 'B' goes back to waiting for events, leaving the thread alive
and running instead of quitting.

Maybe this has unforeseen consequences (one consequence is that it will
return and re-enter the event dispatcher once more, possible
unnecessarily)

Fixes: QTBUG-91539
Pick-to: 6.1 6.0 5.15
Change-Id: Ie6f861f42ffddf4817d5c8af2d764abe9d9103c2
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-11 12:11:18 +01:00
Zhang Yong
02bc441553 The conditional statement is missing parentheses
Add a ')' to the judgment statement.

Change-Id: Iadfdfb7643bc5224cb3029a2abb42c3c14982eef
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-03-11 19:10:07 +08:00
Eskil Abrahamsen Blomfeldt
7fd9ed3201 Support family names that end/start with space
If the family name starts or ends with a space in the actual font
data, then this would not be selectable by Qt. This is because we trim
the family name before matching it against the contents of the database.

Testing on Windows GDI, it actually does trim the spaces on the
family names (matching a request for "Chibola" with a font called
"Chibola " for instance), but since we read the font data ourselves,
we are not doing this.

To ensure we never have font names that cannot be matched in the
database, we make sure we trim the family names before registering
them.

[ChangeLog][QtGui][Text] Fixed matching against fonts which has a
family name that ends or starts with a space.

Task-number: QTBUG-79140
Pick-to: 6.1
Pick-to: 6.0
Pick-to: 5.15
Change-Id: I9cdb50b78a7da2d2697f992ce462033eb1d7ada7
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-03-11 11:55:46 +01:00
Laszlo Agocs
adf6ba7eae rhi: metal: Stop using BufferOp for no good reason
Do what the Vulkan backend does, and just take the offset
and the QRhiBufferData. There is no reason to store a full
QRhiResourceUpdateBatchPrivate::BufferOp struct within the
backend.

Change-Id: I67528029de40320b3e4f031346d40dfc0bb9ab52
Pick-to: 6.1 6.0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-03-11 10:17:13 +01:00
Laszlo Agocs
0c6375a346 rhi: metal: Skip unnecessary writes when updating the entire buffer
Follow the similar Vulkan change in 20eb40bce9
and drop the queued up buffer data for a given slot when the current update
covers the entire buffer. This is relevant in particular for Qt Quick 3D
where such dynamic buffer changes are common.

Change-Id: If1e70d78968586b552a5357bc97af10cc61d9611
Pick-to: 6.1 6.0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-03-11 10:17:00 +01:00
Joerg Bornemann
a21fe37c72 Remove now unneeded QT_BOOTSTRAPPED check from qlibraryinfo.cpp
Since qmake links against QtCore, we don't need to check for the
bootstrapping case in qlibraryinfo.cpp anymore.

Change-Id: I644b1e71db727773b3e32ac650481df134acf033
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-03-11 10:00:24 +01:00
Joerg Bornemann
e158d699e0 Remove all qmake-related data from q[make]config.cpp
Now that we're not actually using qmakeconfig.cpp anymore, we can remove
it together with all qmake-related information that was written into
qconfig.cpp.

This also moves the qtConfEntries array back to qlibraryinfo.cpp.

Change-Id: I5e57d8c55613332cc3e57b11df4398d46aed259b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-11 10:00:18 +01:00
Joerg Bornemann
a08b1f6359 Read QLibraryInfo paths directly from QLibraryInfo and not from qmakeconfig.cpp
Change-Id: I1db1c871ec6b4e572bd36df6aff7a5be8a4a706c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-11 10:00:01 +01:00
Joerg Bornemann
c651e7ba18 Do not write Sysroot and SysrootifyPrefix into qmakeconfig.cpp
Those have fixed values.

Change-Id: I7f1ba8036f43413d3c805f4b419ae79e037343fb
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-11 09:59:51 +01:00
Joerg Bornemann
17055f5f48 Remove the platformsSection constant from qconfig.cpp.in
This is not configurable and doesn't have to be in the generated
q[make]config.cpp files.

Change-Id: If294d735800a3b5c6b3e269abdd86df401cf4864
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-11 09:59:27 +01:00
Yang Yuyin
2a9c93a348 QIcon::setIsMask: delete extra judgment
QIcon::detach can judgment if the d pointer is nullptr

Pick-to: 6.1
Change-Id: I90fd5f50ed2565a5654b978c4603635e62677953
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-11 16:58:45 +08:00
Laszlo Agocs
dd7087342d rhi: metal: Avoid unused argument warning on iOS
Change-Id: I4cb729f3d8dbe7703b89153b742ce2874f35cfd2
Pick-to: 6.1 6.0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-10 16:21:03 +01:00
Laszlo Agocs
83fb8fe208 rhi: metal: Use the layer as the single source of truth
...when it comes to the output size.

This mirrors what all other backends do. For example, with Vulkan
the only source of size is the surface (VkSurfaceKHR), never the
QWindow, even though we'd expect that the surface size equals
to window_size * dpr, and that's almost always true, but there
are exceptions. (e.g. we have seen bugs on Windows with some drivers
in high DPI situations where the Vulkan surface did not fully match
the window size, yet it is the surface, and only the surface, that
matters for rendering, i.e. viewports and such must match the surface,
not the native window)

With Metal we hit a similar problem on iOS: the QWindow's size*dpr
and what we calculate from the CAMetalLayer have a height difference
of 1.

Mitigate this by making QRhiSwapChain::surfacePixelSize() and the
calculation for currentPixelSize() done via the same route (the
CAMetalLayer). Otherwise, if there is a mismatch between what the
QWindow and the layer says, Qt Quick will think that there is a
resize happening (has happened) whenever starting a new frame, and that
has far reaching consequences (suboptimal performance, increased
memory usage by buffers, etc.)

Change-Id: I114df92bf35622c99f2747420fdce401db7705a6
Pick-to: 6.1 6.0
Fixes: QTBUG-91438
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-10 16:20:53 +01:00
Piotr Mikolajczyk
e6ca200a3a Android: Fix constant resize of a large TextEdit on click
If there is a large (3/5 of the screen in portrait or 2/3
in landscape) TextEdit on the screen, and it gets focus
on click, it will be shrank to fit the screen. Next click on this
TextEdit will restore its normal height, the next will shrink.

Pick-to: 5.15
Fixes: QTBUG-91056
Change-Id: I3dbf085cbfdc2739d537a304c16e28c58a6e01ce
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-03-10 13:11:33 +01:00
Topi Reinio
4916255445 Doc: Fix warnings on qproperty.cpp
Task-number: QTBUG-90662
Change-Id: I91f8b83c68c3692dc620063c93be9ddea64685a6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-03-10 08:11:04 +01:00
Zhang Yong
1df915ee1d QtGlobal docs: code tidies
Reformat a couple of examples correctly.

Change-Id: I2f0897267b4e3c4d7d2925f2d20cc45687278b0b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-03-10 01:42:44 +00:00
David Faure
1d567eb63d Merge "QConcatenateTablesProxyModel: skip dataChanged in hidden columns" 2021-03-09 15:32:01 +00:00
Thiago Macieira
35e9c21793 Merge "QProcess/Unix: add a RAII class to hold the argv and envp pointers" 2021-03-09 14:55:58 +00:00
Laszlo Agocs
b33462614f Merge "rhi: gl: Fix missing uniform data with certain command lists" 2021-03-09 13:45:23 +00:00
Elvis Lee
b34462c840 Merge "Support EGL protected content extension" 2021-03-09 13:25:00 +00:00
David Faure
f6efbd23b5 QConcatenateTablesProxyModel: skip dataChanged in hidden columns
When the source models don't have the same number of columns, the proxy
keeps only the smallest number of columns across all source models.
Afterwards, if a source model emits dataChanged in a column past
that number (a "hidden" column), the proxy needs to ignore it rather than
assert.
But also, if the source model emits a dataChanged signal across both
visible and hidden columns, then the last column number needs to be
adjusted so that the signal is correctly processed and forwarded.

Task-number: QTBUG-91253
Pick-to: 6.1 6.0 5.15
Change-Id: I939e8ec0faf41370472f86785851292e4372f72c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-03-09 13:39:45 +01:00
Thiago Macieira
c452a040d3 QProcess/Unix: add a RAII class to hold the argv and envp pointers
Instead of having so much manual pointer manipulation and duplicated
code.

Change-Id: Ic90d8429a0eb4837971dfffd1664f8f63753440a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-03-09 12:22:12 +00:00
Laszlo Agocs
80029e0ca6 rhi: gl: Fix missing uniform data with certain command lists
Following patterns from the other backends is insufficient with OpenGL
because we do not use real uniform buffers. There is currently a
possibility that a shader program will be bound without following it
with setting uniforms. Correct this by having a second level of tracking
of the associated srb object in the pipelines.

Pick-to: 6.0 6.1
Fixes: QTBUG-91630
Change-Id: I74a012daade826dd22c436bde06381c1233bad11
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-09 12:00:48 +01:00
Elvis Lee
7a68aa6fc7 Support EGL protected content extension
A protected context is required to allow the GPU
to operate on protected resources, including protected
surfaces and protected EGLImages.

For example, GPU can post-process on protected content
like DRM protected content so that complex, nonlinear
video effects or mapping onto textures can be used.

The surface format option may be relevant for DirectX
and Vulkan in the future:

  https://microsoft.github.io/DirectX-Specs/d3d/ProtectedResources.html
  https://www.khronos.org/registry/vulkan/specs/1.1-khr-extensions/html/chap12.html#memory-protected-memory

Change-Id: I2d155f0e68b830276690b4833b22a2bc452cdcad
Reviewed-by: Elvis Lee <kwangwoong.lee@lge.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2021-03-09 11:58:12 +01:00
Eskil Abrahamsen Blomfeldt
642ed84a2d wayland: Remove bogus warning about ignoring WAYLAND_DISPLAY
On Gnome, we will not default to Wayland at the moment, even
if the desktop is run in Wayland mode. In this case, we warn
users that they can still select Wayland manually using
QT_QPA_PLATFORM.

Problem was: We never checked if they had actually explicitly
selected Wayland, so even in the cases where we would end up
using that QPA plugin, people would still see the warning.

This moves the check to the end of the platform selection
algorithm, after we have collected all the information.

Pick-to: 6.0 6.1
Change-Id: I0d734bd0782c5e58d6dc63f69b7d531a479ad942
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-09 11:05:52 +01:00
Dong Rui
bac4495619 Delete duplicate condition in QComboBox::setPlaceholderText
There is a duplicate condition judgment in QComboBox::setPlaceholderText, just delete it.

Change-Id: I570415c5930372866f290216a89260353d3992b7
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2021-03-09 13:20:53 +08:00
JiDe Zhang
bc1f61d010 Update documents of QLocale::Country
Quoting from https://en.wikipedia.org/wiki/ISO_3166:
"ISO 3166 is a standard published by the International
Organization for Standardization (ISO) that defines
codes for the names of countries, dependent territories,
special areas of geographical interest, and their
principal subdivisions (e.g., provinces or states).
The official name of the standard is Codes for the
representation of names of countries and their subdivisions."

In order to prevent the word "Country" from causing ambiguity, the
document should clearly state that this enumeration refers to a country
or region.

Change-Id: I05543faa4193b3ddaf31d02c670b4b5f46e94389
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-09 09:09:51 +08:00
Shawn Rutledge
065fd12f2d Merge "xcb: use QXcbScrollingDevice for a touchpad" 2021-03-08 22:23:17 +00:00
Shawn Rutledge
f85e70c569 xcb: use QXcbScrollingDevice for a touchpad
When using XQuartz on macOS, the virtual pointer device is detected as
a touchpad, not a mouse; but QXcbConnection::xi2HandleScrollEvent()
expects the device to be an instance of QXcbScrollingDevice for storage
of some state. A touchpad that has the scrolling capability must be
that type, not a plain QPointingDevice.

Fixes: QTBUG-91402
Pick-to: 6.1
Change-Id: I1b82766d4a3f87f656e56c0d8904def26fb0979a
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-03-08 20:24:51 +00:00
Jan Grulich
acaabc9108 FileChooser portal: send window id in hex
We send window id in decimal, however, it is expected to be send in hex.
This causes a mismatch and makes portal dialog to show in background.

Pick-to: 5.15 6.0 6.1
Change-Id: Ibd77199bbb4a2ad4782a0457ddc5506c6b5608fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-08 20:05:19 +01:00
Qiang Li
d2d957ff67 Merge "Fix the crashes when animated QTreeWidgetItems are hidden" 2021-03-08 14:38:56 +00:00
Qiang Li
f140ef04a0 Fix the crashes when animated QTreeWidgetItems are hidden
QTreeView's drawTree implementation performs lazy layouting
when calling itemDecorationAt. If animations are enabled,
this can change the list of items, and invalidate the copy
made earlier.

Don't copy the list of items, use a reference instead so that
code iterating over the items later operates on valid data.

Add an assert in the private itemHeight method, it must not
be called with an index that is out of bounds.

Fixes: QTBUG-42469
Pick-to: 6.0 6.1 5.15
Change-Id: Ifdb782881447912e00baffd1c407de10a1d8d0d4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-08 12:31:13 +00:00
Christian Ehrlicher
1df974590f QSql/MariaDB/MySQL: misc cleanup
Cleanup the mariadb driver a little bit:
 - use nullptr instead NULL
 - use unsigned long instead int for blob handling now that QByteArray
   can handle more than 2^31 bytes

Change-Id: I79639a42a739aabdf776cc688cb5d664248aa610
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-03-08 12:44:40 +01:00
Morten Johan Sørvig
6e899f8e8c Merge "Add deviceIndependentSize() to QPixmap and QImage" 2021-03-08 10:52:24 +00:00
Morten Johan Sørvig
1471f2ae09 Add deviceIndependentSize() to QPixmap and QImage
This function returns the size in device independent
pixels, and should be used when calculating user
interface sizes.


Change-Id: I528123f962595a3da42438ca560289a29aca4917
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-08 08:27:41 +00:00
Piotr Mikolajczyk
bacf9cd04c Android: Add grabWindow handling
Draws to a pixmap contents of the requested window. On Android it works
only for QtWidgets application.

Qml application contents could not be grabbed due to lack of access to
the contents of OpenGL framebuffer from QAndroidPlatformScreen

Fixes: QTBUG-63275
Pick-to: 5.15
Change-Id: Ief7de1b709387d798138387bb735f4b48cf2928d
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-03-08 08:00:18 +00:00
Nick Shaforostoff
4f37cf2ce5 string 16<->8 bits conversion: SIMD on arm32
this adds emulation for 2 NEON commands that armv7 lacks
this increases conversion speed by around 50% in my simple tests

Change-Id: I4f52d353184e9a8d88089de60e17bd5670637c0c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-03-08 00:31:23 +01:00
Thiago Macieira
d58d0bb970 Merge "QNetworkInterface/Unix: fix DNS eligibility of global addresses" 2021-03-06 00:05:35 +00:00
Thiago Macieira
83876c0256 QNetworkInterface/Unix: fix DNS eligibility of global addresses
[ChangeLog][QtNetwork][QNetworkInterface] Fixed the reporting the "DNS
eligibility" factor (QNetworkAddressEntry::dnsEligibility) for global IP
addresses. Previously, QNetworkInterface interface erroneously reported
all global addresses as eligible, regardless of whether they had already
been deprecated by the OS or were temporary in the first place.

From the tst_QNetworkInterface::dump output (netmask & broadcast
suppressed for readability, IPv6 prefixes changed to protect the
innocent, but the local part is exactly as found on my system):

   address  0: 192.168.26.33/24  dns-eligible preferred:33546998ms valid:33546998ms
   address  1: 2001:db8::800/128  dns-eligible preferred:264817000ms valid:264817000ms
   address  2: fd00::800/128  dns-eligible preferred:forever valid:forever
   address  3: 2001:db8::2f5b:342c:fc53:b9b2/64  dns-ineligible preferred:12422000ms valid:264817000ms
   address  4: fd00::9351:adff:333d:5c8d/64  dns-ineligible preferred:12421999ms valid:531402999ms
   address  5: fd00::7297:9516:fbb4:17ac/64  dns-ineligible preferred:0ms valid:445585999ms
   address  6: fd00::fdc8:e620:691:3b44/64  dns-eligible preferred:forever valid:forever
   address  7: 2001:db8::ae82:a01:5a8a:e210/64  dns-ineligible preferred:0ms valid:264816999ms
   address  8: 2001:db8::c673:e0a2:8927:2118/64  dns-eligible preferred:264816999ms valid:264816999ms
   address  9: fe80::bd89:b998:4aeb:a5d0%bond0/64  dns-ineligible preferred:forever valid:forever

Prior to this commit, only address 9 was showing as ineligible.

Addresses 1 and 2 come from DHCPv6 and are thus always eligible.
Addresses 3, 4, 5, and 7 are temporary addresses added on account of
RFC 4941 and are therefore ineligible (they have the IFA_F_TEMPORARY
flag set). Note how 5 and 7 have also stopped being preferred. Address 3
is the one I see when I go to ip6.me and address 4 is the one used to
reach the router.

Addresses 6, 8, and 9 are the "permanent" addresses that would normally
be based on the MAC address of the interface, but are actually in
"stable privacy" mode for me (RFC 8064). Address 9 is the link-local
one, which makes it ineligible, leaving the other two stable addresses
eligible.

Addresses 1, 3, 7, and 8 are global, from a DHCPv6-PD delegation from my
ISP, which is why they have finite lifetime. Addresses 2, 4, 5, and 6
are from my local Unique Local Address (ULA) prefix, which is why 2 and
6 are valid forever.

Pick-to: 6.1
Change-Id: If8b43dc9678c4b4ba9c1fffd1668fdcae873c6bd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-03-05 13:56:31 -08:00
Timur Pocheptsov
734ab493f7 Fix a BIC introduced by extending the namespace QSsl in _p.h files
Renamed the private part of the namespace to QTlsPrivate.

Fixes: QTBUG-91531
Change-Id: Id2d9c458d8d958b35e437eee42889177dad0a7a7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit e4efa00c72c7011f4e5c27722c2a522b30274610)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-05 20:50:02 +00:00
Andreas Buhr
b2c96423bb Merge "Add documentation for Q_OBJECT_BINDABLE_PROPERTY" 2021-03-05 18:51:54 +00:00
Allan Sandfeld Jensen
d9da78b620 Merge "Add ARM version of the "AES" qhash algorithm" 2021-03-05 18:45:55 +00:00
Fabian Kosmale
9e6ad5dc22 Merge "qtypeinfo: make variable templates inline" 2021-03-05 17:18:47 +00:00
Øystein Heskestad
de658d8ca5 Merge "Make qdecompresshelper archive bomb check only trigger for large files" 2021-03-05 16:32:49 +00:00
Allan Sandfeld Jensen
ecf84e0989 Add ARM version of the "AES" qhash algorithm
Change-Id: Ia2c20e970a0149efb7665a5690538f83965e7be7
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
2021-03-05 18:31:27 +02:00
Andreas Buhr
89cc39a894 Add documentation for Q_OBJECT_BINDABLE_PROPERTY
The duo Q_OBJECT_BINDABLE_PROPERTY and QObjectBindableProperty
can only be documented together. The documentation is now with
QObjectBindableProperty. This patch adds a documentation entry
for Q_OBJECT_BINDABLE_PROPERTY which links the user to
QObjectBindableProperty.

Task-number: QTBUG-90511
Pick-to: 6.0 6.1
Change-Id: I9af4a99d49f4b02ee9645a2cc9a9a024a6a1a552
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-05 15:42:45 +00:00
Wang Yicun
89e9164abb Merge "Simplify code, remove redundant condition" 2021-03-05 15:35:26 +00:00
Zhang Hao
f13451539f Merge "Code tidies" 2021-03-05 15:14:28 +00:00
Giuseppe D'Angelo
bcedeb6d3d Merge "QPoint(F): declare as PRIMITIVE, not RELOCATABLE" 2021-03-05 14:38:41 +00:00
Fabian Kosmale
6de9acf779 qtypeinfo: make variable templates inline
And refactor the TMP to use std::conjunction and use variable template
specialization instead of template class specialization for the base
cases.

Change-Id: Iea6a03f13ea3443a0fa7365af21c496670c1e07f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-03-05 15:30:05 +01:00
Øystein Heskestad
be73ca7eb1 Make qdecompresshelper archive bomb check only trigger for large files
This is to avoid false positives.
By default files are large if uncompressed size > 10 MB. Only configurable internally.
Also add auto tests.

Task-number: QTBUG-91392
Pick-to: 6.0 6.1
Change-Id: I32258cb7c957f2a23a05157ba4ed5c0af2ba585e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-05 15:13:53 +01:00
Wang Yicun
a913002f13 Simplify code, remove redundant condition
'clazz || (!clazz && isCached)' is equivalent to
'clazz || isCached'

Done-with: Tang Peng <tangpeng@uniontech.com>
Pick-to: 6.1
Change-Id: Ie9eab4a94a61be2b360f64980c4666a622f3a209
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-05 13:52:31 +01:00
Paul Wicking
c1c61c3bb4 Doc: Fix section titles that confuse QDoc's autolinker
Fixes: QTBUG-91620
Pick-to: 6.1 6.0
Change-Id: I7c407c7158324d1fbbeb78e47d2198e8ddf5daa0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-05 13:47:53 +01:00
Zhang Hao
2801dc7f04 Code tidies
The return type goes on the same line of the rest of the signature.

Change-Id: Icacf2e00ed2876c4c9b72b8f6c428c2e37ee42a7
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-03-05 12:26:47 +00:00
Toni Saario
90371e9250 Merge "Skip globalstatic threadStressTest on QEMU" 2021-03-05 11:02:17 +00:00
Giuseppe D'Angelo
48f685f5e5 QPoint(F): declare as PRIMITIVE, not RELOCATABLE
These types can be copied via memcpy, so use the correct tag.

Change-Id: Icba37d42dd8658225ce4889284661d108122d489
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-03-05 11:19:46 +01:00
Giuseppe D'Angelo
5f501b0e97 QQuaternion: mark as PRIMITIVE type
Change-Id: I043fef8bfc66875b72f34e7939e78c7d1c7f5381
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-05 11:19:44 +01:00
Piotr Mikolajczyk
5c6b10c3ce Android: Place cursor correctly on screen when editing
When editing text the cursor is not placed correctly. So this
has been achieved by tricking Android into thinking that the
input area is only the line where the cursor is, so it is
forced to keep it on screen.

Fixes: QTBUG-91073
Pick-to: 5.15
Change-Id: Icc2e8315deb76ca1a84819d3fdceaa7b027b1174
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-03-05 07:57:14 +00:00
Wang Yu
852b070529 QContiguousCache: Remove redundant condition
The reverse condition was already checked three lines before.

Pick-to: 6.1
Change-Id: I2f78262004871ec2f3730e2a25f26fe22636cde7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-05 07:27:14 +00:00
Allan Sandfeld Jensen
9fb81fc287 Merge "Add QColorSpace::description" 2021-03-05 00:04:34 +00:00
Volker Hilsheimer
26b53173d6 Merge "QMenu test: turn tooltip animations off" 2021-03-05 00:02:41 +00:00
Volker Hilsheimer
a60f763f25 Merge "Protect against self-assignment, plug potential memory leak" 2021-03-04 22:24:48 +00:00
Joerg Bornemann
48488b810f Fix Android build
The Android build failed, because the namespace QNativeInterface could
not be found. Include the header file where it's defined.

Change-Id: If53eda4d4d4e6d5e66787d74c714215721ba0b60
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-03-04 22:39:21 +01:00
Allan Sandfeld Jensen
01c55405fa Add QColorSpace::description
A way to read the description of the profile from ICC, or set one
yourself.

Change-Id: I68622e30ee209cac99c41f3df934712c3548c0de
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-03-04 22:37:08 +01:00
Paul Wicking
3ae67b4434 Merge "Doc: Use correct include for QWGLContext" 2021-03-04 21:24:32 +00:00
Volker Hilsheimer
3ae09debab Protect against self-assignment, plug potential memory leak
Fixes static analyzer warning f03d95823e9f1395d64501cc111f0f63

As a drive-by, plug the potential memory leak if the assigned-to
QDockAreaLayoutItem already holds a QDockAreaLayoutInfo object.
The subinfo is deleted in the destructor, QDockAreaLayoutItem
has ownership for the subinfo.

Pick-to: 6.1
Change-Id: I8546adc6fb0537078eea9dfb45d1bd9967d8d149
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-03-04 19:58:44 +01:00
Paul Wicking
15f934dcea Doc: Use correct include for QWGLContext
Pick-to: 6.1 6.0
Task-number: QTBUG-91500
Change-Id: If487a2d14dd61d127dc35aa039f9b71915128da1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-03-04 18:32:32 +01:00
Thiago Macieira
224c638f78 QProcess/Unix: use a common function to find the target executable
This harmonizes the execution between start() and startDetached(). Both
did QStandardDirs::findExecutable(), but duplicated code. However, only
start() supported launching .app bundles on Mac.

[ChangeLog][QtCore][QProcess] startDetached() now supports launching
.app executable bundles on macOS / iOS systems, like start() already
did.

Change-Id: Ic90d8429a0eb4837971dfffd1664f776b2c0edfd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-03-04 09:14:04 -08:00
Alexey Edelev
3875575ab6 Merge "Fix build of Core module without regularexpression feature" 2021-03-04 13:32:07 +00:00
Joerg Bornemann
94d5c1bfe0 Merge "Remove win32_system_libs feature from src/corelib/configure.json" 2021-03-04 11:26:42 +00:00
Kai Köhne
52f99ff3d2 Merge "headersclean: Compile with -std=c++latest, -Zc:__cplusplus on MSVC" 2021-03-04 11:11:36 +00:00
Alexey Edelev
6e5e8016dd Fix build of Core module without regularexpression feature
qregularexpression.h requires FEATURE_regularexpression to be enabled.
Add a condition to the 'qt_pch.h' header to fix the build when PCH
are enabled and FEATURE_regularexpression is disabled.

It seems that the filter implementation of QSortFilterProxyModel
has QRegularExpression as its base. It's necessary to make
sortfilterproxymodel dependent on the regularexpression feature.

Fix the precompiler condition for the extractSections function in
the QString implementation. Use the same precompiler condition for
the QString::section and extractSections functions, since
QString::section depends on extractSections.

Change-Id: I5b775e0842a0aa1a8d47f8dded376bdfcf63b5bf
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-03-04 11:31:36 +01:00
Joerg Bornemann
4b9173e354 Fix QT_HOST_LIBEXECS for cross-builds on Windows
Like for LibraryExecutables, we must default to "bin" on Windows for
HostLibraryExecutables in our generated qconfig.cpp.

Pick-to: 6.1
Fixes: QTBUG-91496
Change-Id: Ib5a4b3b3fd6192bd953e615058b482e67ad19462
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-03-04 10:31:31 +00:00
Albert Astals Cid
eeb4c0a1c9 Merge "Fix signature of canDropMimeData used in code snippet" 2021-03-04 10:22:45 +00:00
Andrei Golubev
70bd6bf1e3 Merge "Fix compilation error in QDateTime" 2021-03-04 09:40:01 +00:00
Joerg Bornemann
00b75e86f3 Remove win32_system_libs feature from src/corelib/configure.json
This feature only existed to trigger the evaluation of the libs gdi32,
kernel32 and friends. Those libs only were relevant for the qmake build
of Qt and can be removed now.

Task-number: QTBUG-83932
Change-Id: Idfd4d8f70b6dbd1067412fecc1115b504b1ad347
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-03-04 09:56:09 +01:00
Sona Kurazyan
fcc453df5c Improve docs for Qt Concurrent run with promise mode
For the readers that are new to QtConcurrent, it may be confusing that
unlike the normal usage of QPromise, they don't have to call start() or
finish() when using Qt Concurrent run with promise mode. Be more
explicit about that.

Pick-to: 6.1
Change-Id: I08df6c4ca41bec4120e208a6643ee20c7adf265c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2021-03-04 09:45:31 +01:00
Timur Pocheptsov
7c1aa0c48c Convert QDtls classes to the new plugin-based design
Essentially, the same code re-shuffled and placed behind
the new interfaces.

Fixes: QTBUG-91174
Task-number: QTBUG-65922
Change-Id: I8f14697f10713f9738c5c7805aed0150c084850c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 6c835796c8ea2590008900ffb5f4bf0d902ee73d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-03-04 08:40:07 +00:00
Albert Astals Cid
b22fe78d85 Fix signature of canDropMimeData used in code snippet
Change-Id: I9026e11630651e740282466551ad78883a0421ec
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-04 09:04:17 +01:00
Eirik Aavitsland
ede0082f86 Update bundled libjpeg-turbo to version 2.0.6
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 2.0.6

Pick-to: 6.1 6.0 5.15 5.12
Change-Id: I3e308d241853edf3c1d616955cda203220a258d8
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-03-04 09:04:02 +01:00
Andrei Golubev
538e9fa568 Fix compilation error in QDateTime
One of the changes done in 902505a058
results in a compilation error: somehow an expression
"int * enum value (with underlying type qint64)" has result type
"long int" and thus the compiler cannot find matching add_overflow

Return the qint64 cast back to overcome this
Compiler: gcc 7.5.0-3ubuntu1~18.04

Change-Id: Iaca882762e812bef69ec325df5f59e02082a0130
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-04 08:26:30 +01:00
Giuseppe D'Angelo
fe9d7bf759 QScopedPointer: deprecate swap
Follow up of 612a01be65
(deprecating QSP::take()): for the same reasons, swap()
functions do not belong to QScopedPointer, or they would
allow the pointer to escape:

  QScopedPointer a;
  {
    QScopedPointer b = ~~~;
    qSwap(a, b);
  }
  // b's pointer escaped its scope

Deprecate them as well.

[ChangeLog][QtCore][QScopedPointer] QScopedPointer swapping
functions have been deprecated, as they would allow the
managed pointer to escape the scope. If you need those semantics,
use std::unique_ptr instead.

Change-Id: I2b0938b62f2ef5a3561f61f595a3fb4c505a8f08
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-04 06:49:02 +01:00
Zou Ya
712117f8b8 Redundant condition: tornoff
Redundant condition: tornoff.
'!tornoff || (tornoff && scroll)' is equivalent to
'!tornoff || scroll'

Pick-to: 6.1
Change-Id: I8339faa4d53360db280173ee489e48eba4883b70
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-04 10:34:43 +08:00
Huang Jie
d3ec08eea0 Redundant condition: widget
Redundant condition: widget. '!widget || (widget && widget->isEnabled())'
is equivalent to '!widget || widget->isEnabled()'

Pick-to: 6.1
Change-Id: Ife915bd5ea66f8ccff48a1612f8c78c263075c89
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-03-04 10:33:40 +08:00
Huang Jie
8a226cd76b Variable is Assigned a never used value in qt_make_filter_list()
Variable 'i' is assigned a value that is never used in qt_make_filter_list()

Pick-to: 6.1
Change-Id: Id845ecb5231b97a899443bdcb9f49cccb7f20bea
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-04 02:33:03 +00:00
Volker Hilsheimer
6e334a85a8 QHostInfo: simplify assignment operator
The d_ptr is never nullptr. If it could be, then other's d_ptr could
also be nullptr, and we would dereference the null pointer.

Guarding against self-assignment is nevertheless a good practice.

Fixes static analyzer warning
5fc3780532e30c6350a0aa1ad2188a4c.

Pick-to: 6.1
Change-Id: I07ff808e4c4f5bf07b4d6663f1fb4a3301a0fec7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-03-03 23:41:25 +01:00
Volker Hilsheimer
90b51219dd QMetaType::create: don't leak memory if copy can't be made
QMetaType::construct will return nullptr if a copy is requested but
if there is no copy constructor. In that case, the memory allocated in
QMetaType::create will be leaked.

This case is covered in the unit tests in

template<>
void testCreateHelper<QMetaType::Void>()

so we can't assert in construct that a copy constructor is present if
a copy is requested.

Fixes static analyzer warning 618b1e6877f737df57c39fd35ad91cd4.

Pick-to: 6.1
Change-Id: Ic439b36b1f120b9d0f888efaeab2801d8acc13de
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-03 23:41:14 +01:00
Giuseppe D'Angelo
0eca1f4a46 Merge "Port some value classes away from QScopedPointer" 2021-03-03 21:18:38 +00:00
Giuseppe D'Angelo
1086d9a572 Port some value classes away from QScopedPointer
In preparation for deprecation of QScopedPointer::swap, port to
other established solutions:

* QPainterPath was basically a QExplicitlySharedDataPointer
re-engineered around a QScopedPointer. Just use the right class
for the job...

* QBrush is in a similar situation, although its deleter is
more complex; port to unique_ptr for that one to minimize the
code impact.

Change-Id: I7f7c1dd8702f84f5146043347af64dda3c7e6f09
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-03-03 19:36:23 +01:00