Commit Graph

52544 Commits

Author SHA1 Message Date
Li Xinwei
a251443949 Avoid to call _qt_internal_set_up_static_runtime_library() twice
Pick-to: 6.2
Change-Id: I28985470b3e0b88befbbd2d62a027670d7d6c822
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-03 04:18:42 +08:00
Andy Shaw
ba3e1fe09b Allow dragging of a floating dockwidget on macOS with a custom titlebar
This amends 3224c6d7d1 to account for the
case when the dockwidget is already floating.

Task-number: QTBUG-70137
Pick-to: 6.2 6.1 5.15
Change-Id: If8b345565b11b44beb3fb4b697cfe812c29c6396
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-08-02 14:55:54 +02:00
Laszlo Agocs
b594374ba8 rhi: Be more graceful when one destroys a resource after the QRhi
One is a bad application or library in this case, but nonetheless
we should handle this more gracefully then just crashing due to
the QRhi already having been destroyed. Mainly because in Qt 5 one
could get away with the same: releasing OpenGL objects underneath,
for example, a QSGPlainTexture with no (or wrong) GL context did
not generate any user visible fatal errors. So we should not crash
in Qt 6 either with these code bases.

In debug builds or when QT_RHI_LEAK_CHECK is set, one will get the
unreleased resources warning printed in Qt 6, which is a step
forward compared to Qt 5. So there is still some indication that
something is badly designed, even if the application survives.

Task-number: QTBUG-95394
Pick-to: 6.2
Change-Id: I944f4f425ff126e7363a82aff926b280ccf1dfc3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-08-02 14:35:33 +02:00
Morten Johan Sørvig
ee68257b61 Fix PerMonitorV2 DPI aware NonCLientAreaScaling handling
The value returned from shouldHaveNonClientDpiScaling()
controls two related behaviors:

1) Should Qt call user32dll.enableNonClientDpiScaling()
2) Should Qt code treat NonClientAreaScaling as enabled.

Commit c35643db updated shouldHaveNonClientDpiScaling()
to account for the fact that PerMonitorV2 always enables
NonCLientAreaScaling, with the intent to disable 1)
However this also disables 2), which was not intended.

Instead, make shouldHaveNonClientDpiScaling() always
return true when PerMonitorV2 is enabled, and then also
omit calling the user32dll API in this case.

Change-Id: I1d06f36a3d06becc667351fadcb00ab28af6ec4b
Pick-to: 6.2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2021-08-02 14:35:33 +02:00
Tor Arne Vestbø
6e25017922 macOS: Stop relying on balanced CGDisplay reconfiguration callbacks
We were using CGDisplay callbacks to determine when a screen reconfiguration
had happened, and when it had propagated to changes in NSScreen.screens,
so that we could update our QScreen view of the world.

Unfortunately the CGDisplay callbacks were not deterministic enough to
use as a signal for when a reconfigure had completed.

Since we can't rely on NSApplicationDidChangeScreenParametersNotification
either (it comes in too late), we're now resorting to updating our QScreens
at every chance we get:

 - On every CGDisplay reconfiguration ending
 - On QCocoaWindow::windowDidChangeScreen() as a result of AppKit
   moving the window.
 - On NSApplicationDidChangeScreenParametersNotification
 - On QCocoaScreen::get() as a last resort

Since the result of these updates are only reflected as QScreen property
updates or QGuiApplication signals if a change actually occurred, it should
be safe to update early and often.

Task-number: QTBUG-77656
Fixes: QTBUG-80193
Pick-to: 6.2 6.1 5.15
Change-Id: I98334a66767736d94ad2fcb169e65f0d8bc71a30
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-08-02 12:16:24 +00:00
Alexandru Croitor
c13b98d9bc CMake: Bump project versions
Fixes: QTBUG-95454
Change-Id: I2467d3ae27b54424e59a7a4ab00d364eaec517d5
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2021-08-02 12:42:29 +02:00
Mårten Nordheim
e3f10a2760 QByteArray::number/setNum(double): Reverse dependency
Currently number(double) creates a QByteArray-instance and calls
setNum(double).
setNum(double) creates a QByteArray-instance and copy-assigns it to
itself.

By making setNum(double) call number(double) we can cut one creation
from numbers(double)'s path, and making setNum no worse than it was.

The other pairs of setNum/number are left alone as they don't have this
issue.

Change-Id: Ib611ebc78db64f74244a56cb8e384e42bc7d1758
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-08-02 09:39:45 +02:00
Assam Boudjelthia
50f53b9022 Pass QDeadlineTimer by value in runOnAndroidMainThread()
Also change the timer default value to use QDeadlineTimer::Forever.

Pick-to: 6.2
Change-Id: Ia6d0101872a5d01b04e146cd9b2f90315cb8eb2e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-08-01 21:13:07 +00:00
Alex Trotsenko
6f682d4876 QLocalSocket: always open outer QIODevice in unbuffered mode
The actual buffering is performed either in the inner socket (Unix),
or in the pipeReader (Windows). To avoid unnecessary copying of data
between buffers, enforce unbuffered mode for all implementations,
which slightly improves read performance.

Change-Id: Idb2a09f35823b9945c71231710290be12d9930f7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-08-01 21:06:45 +03:00
Alex Trotsenko
3bc976c2bd QIODevice: allow subclasses to enforce unbuffered mode
For subclasses that implement alternative buffering (such as
QLocalSocket), it would be useful to bypass the QIODevice's internal
buffer, even if the QIODeviceBase::Unbuffered flag is not set when
opened.

By setting the readBufferChunkSize member to 0 in their constructors,
these classes now unconditionally switch the base class to unbuffered
mode, while still reporting buffering with openMode() function.

Change-Id: I351bc57ac0ccb45c81f8c6be15f1745131aa26ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-08-01 20:20:46 +03:00
Shawn Rutledge
69c833dae9 Register mouse devices on cocoa
It would have been nice to ensure that a device is registered already in
mouseEnteredImpl(); but in that context, NSEvent.deviceID is always 0,
and we can't find out anything else about the device.
QWindowSystemInterface::handleEnterEvent() doesn't currently take a
QPointingDevice either.

In handleMouseEvent() and scrollWheel(), deviceID seems unique for each
trackpad or Magic Mouse, but 0 for any plain USB mouse. There, the first
mouse that the user interacts with becomes primaryPointingDevice():
its deviceID is assigned to systemID (except if deviceID == 0, we use
1 instead, to avoid the auto-incrementing device ID assignment in the
QInputDevicePrivate ctor.) When scrolling occurs, we update the
capabilities to have PixelScroll if theEvent.hasPreciseScrollingDeltas.

So over time, QInputDevice::devices() should build up to a complete
list, with capabilities() also distinguishing plain mice from those that
have the PixelScroll capability. And in the common case that the user
has only one Apple pointing device, it becomes primaryPointingDevice().

Pick-to: 6.2
Task-number: QTBUG-46412
Task-number: QTBUG-63363
Task-number: QTBUG-72167
Change-Id: Id9771b4dfd765e49023bd57d42a2aa4d0635a3b2
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-08-01 15:32:41 +02:00
Tor Arne Vestbø
07d8885ccc Update QAbstractItemModelTester::FailureReportingMode documentation
The key part of FailureReportingMode::QtTest is that it will result
in a test failure (via QTest::qVerify); not that it's using the
QtTest logging machinery.

Pick-to: 6.2
Change-Id: I18472fba173ce1323748f1f87301a4defa87020e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2021-08-01 12:44:14 +02:00
Alex Trotsenko
9f092c1077 QIODevice: rework validation policy for read() functions
- avoid calls to private and virtual functions, if the device is not
  open;
- avoid repetitive checks in loops;
- add missing checks in readLine() overloads;
- remove check against unsuccessful resize().

Change-Id: I973d5931163b25db1c09c7c3b66f29ea90bb1b29
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-08-01 10:50:32 +03:00
Alex Trotsenko
21f3ff65b8 QLocalSocket: do not emit aboutToClose() twice
This signal is emitted by the QIODevice itself, so we don't have to
forward it from the internal socket.

Pick-to: 6.1 6.2
Change-Id: I85745f36d7a27d92f339a9184de3b6e5d46f6f34
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-08-01 10:50:15 +03:00
Alex Trotsenko
6e3897b9fa QIODevice: fix converting OpenMode flag in debug output
Suppress error:

src\corelib\io\qiodevice.cpp(791): error C2440:
 '<function-style-cast>': cannot convert from 'QIODeviceBase::OpenMode'
  to 'quint32'

Pick-to: 6.1 6.2
Change-Id: I6b6e94790942d3af62bc2f38afad97c0b3c80817
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-07-31 15:19:48 +03:00
Marc Mutz
615a9cf991 QUuid: port to QAnyStringView
Remove the QString/QStringView/QLatin1String/const char* overloads
from the API, but not the ABI.

As a drive-by, replace a use of QStringView::left() by truncate(), as
suggested by a comment.

[ChangeLog][QtCore][QUuid] The from-string constructor and the
fromString() function now take QAnyStringView (was: overload set with
a subset of QString, QByteArray, const char*, QLatin1String,
QStringView each).

Change-Id: If7fa26cfbef9280480c78b669d9f5f14118995ed
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-07-30 22:54:28 +02:00
Marc Mutz
09fba5cf36 QWindowsFontDatabase: port local QSets to QDuplicateTracker
Apart from a more fitting, minimal, API, QDuplicateTracker also
transparently uses C++17 pmr::monotonic_buffer_resource to avoid, or
at least reduce, memory allocations.

Change-Id: I155f5518190c5f8f6d21fbec3fcecd6bcc7ff852
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-30 15:59:55 +02:00
Assam Boudjelthia
0edda211f9 Remove mention of permission api in http example
Pick-to: 6.2
Change-Id: I8b22633e1ad5372f92f87315b7184a4b499a0a0b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-07-30 14:46:55 +03:00
Assam Boudjelthia
72e5b36e2e Remove app permission API from QCoreApplication
From the API review session, a potential deadlock behavior might
occur when using QFuture's synchronous APIs on the UI thread. Also
the fact that this api currently have an implementation only for
Android. For those reasons we thought this API could be postponed
until Qt 6.3, when the QFuture concern is addressed and other
platforms other than Android are implemented as well.

Pick-to: 6.2
Change-Id: I1aef025488c24791da85d15fb57367d3e5e681be
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-07-30 14:46:55 +03:00
Edward Welbourne
b72fa182b4 Correct a #include in a comment in qglobal.h
The comment indicates how to use QT_BUILD_REMOVED_API, which includes
a #include of qglobal.h; but we have a tool, run somewhere in
configure, that grumbles about this #include (unaware, I suspect, that
it's in a comment), saying we should #include <QtCore/qglobal.h>; so
change the comment to say that. Presumably this is our recommended way
to do includes, so we should follow it when suggesting how to write
code.

This amends commit 0c8b98774c.

Change-Id: I4683ad6f1c0eedec3eaa02ac40c5d017059a49b0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-07-30 12:35:09 +02:00
Mårten Nordheim
64368bb527 Add a few more cases to the QString::number(double) test
Formatting using scientific notation with extra precision wasn't tested

Change-Id: I7a89a0f3d6468515604e43e52fc366dedf3c39ea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-07-30 12:00:37 +02:00
Oliver Wolff
5f5c342924 Remove Windows 7, 8, and 8.1 codepaths
Pick-to: 6.2
Task-number: QTBUG-84432
Change-Id: I970d7d7e9ebdcf246a5be32d60066b4e5e948c27
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-30 08:02:56 +02:00
Yuhang Zhao
2c6bc06267 Windows QPA: Remove DwmIsCompositionEnabled() usages
According to Microsoft Docs [1], DWM composition is always
enabled and can't be disabled since Windows 8. Now that
we are cleaning up pre-Windows 10 code, this apparently
needs to be removed as well.

[1] https://docs.microsoft.com/en-us/windows/win32/api/dwmapi/nf-dwmapi-dwmiscompositionenabled

Task-number: QTBUG-84432
Change-Id: I64dc049e0741600c8d0ae4db0e9e3bc98a211339
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2021-07-30 01:08:15 +00:00
Tor Arne Vestbø
f9170f56c7 testlib: Regenerate test expectations
After c25687fa0b and
539553a572.

Pick-to: 6.2
Change-Id: I34b436f20b9c480f6948aa97430228936955808e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-07-29 18:46:39 +02:00
Tor Arne Vestbø
7c14223b1e testlib: Update a few remaining instances of the deprecated -xunitxml format
The format was renamed in 27db9e458c.

Pick-to: 6.2
Change-Id: I53975c7467d8768dc9dc9ac2d89c42eefa12e22f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-29 18:46:39 +02:00
Tor Arne Vestbø
cba2adb195 testlib: Run test result expectation tests with stdout as output
For historical reasons a few of the subtests are skipped when
running with anything but the plain text logger to stdout.

To ensure we have as broad test coverage as possible for the
expected output of the various loggers we run these tests in
stdout-mode.

Pick-to: 6.2
Change-Id: I856905d1543afe89710533657a55bd599c0305fd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-29 17:57:41 +02:00
Alexandru Croitor
3c23317552 CMake: Make WrapVulkanHeaders target optional for QtGui consumers
If Vulkan headers are present on the system when qtbase is configured,
QtGui and QtOpenGL should be compiled with Vulkan support.

If a user project uses a Qt built with Vulkan support, but their system
is missing Vulkan headers, the project configuration needs to succeed.

The project will get compilation errors if it uses Vulkan headers, but
that's intended.

This use case was broken when fixing Vulkan to be found when building
Qt for Android.

Fix the regression with a combination of things
1) Mark the WrapVulkanHeaders package as optional (already the case)
2) Use the include directories directly when compiling Gui and OpenGL
3) Propagate WrapVulkanHeaders::WrapVulkanHeaders link requirement to
   consumers only if the target exists. It won't exist if Vulkan
   include dirs are not found

This also requires some changes in pri and prl file generation.

For prl file generation, we don't want to link to the
WrapVulkanHeaders target, so we filter out all dependencies that
use TARGET_NAME_IF_EXISTS for anything that calls
__qt_internal_walk_libs which includes qt_collect_libs.

For pri files, we make sure to generate a uses=vulkan/nolink clause
by inspecting a new _qt_is_nolink_target property on the target.

We also don't add include dirs to the pri file if the new
_qt_skip_include_dir_for_pri property is set.
This is intended for Vulkan, because there is separate qmake logic to
try and find the include dirs when configuring a user project.

As a drive-by, fix nolink handling for WrapOpenSSLHeaders.

Amends bb25536a3d
Amends 7b9904849f

Pick-to: 6.2
Fixes: QTBUG-95391
Change-Id: I21e2f4be5c386f9e40033e4691f4786a91ba0e2d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-07-29 16:38:50 +02:00
Alexandru Croitor
3b2157ed9e CMake: Fix MoltenVK headers to be found on macOS
This fixes building Qt with Vulkan support on macOS which aside from
the regular Vulkan headers also needs the location of the MoltenVK
headers.

This assumes the usage of the LunarG Vulkan SDK for macOS.

Pick-to: 6.2
Fixes: QTBUG-80576
Change-Id: I030b2fdeaafdd7bf5ebe6fb4c9ea860917e84056
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-07-29 16:38:49 +02:00
Tor Arne Vestbø
edba9cddbb testlib: Accurately name JUnit test, and only run for JUnitXML reporter
The JUnit reporter was initially named xunit, but the naming was inaccurate
and the reporter was renamed in 27db9e458c.

The corresponding test has now been renamed as well, and as an added bonus
we only run it for that reporter.

Pick-to: 6.2
Change-Id: I59cb7d949514cdf46a0199a53a7a3e39f833207c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-07-29 15:39:40 +02:00
Ivan Solovev
08a1bcfa9b QByteArray: extend unit tests
This patch introduces some test improvements to check the calls of
different methods on an empty default-constructed string.
Apart from that, many other tests are added to extend code coverage.

Task-number: QTBUG-91736
Pick-to: 6.2 6.1
Change-Id: If86ef3d8611a678798b1bcc60a1a4f5598fd2179
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-07-29 15:00:35 +02:00
Ivan Solovev
e150bcfe4d QByteArray: fix indexOf/lastIndexOf
This patch fixed two bugs in indexOf/lastIndexOf:
1. The lastIndexOf(char, qsizetype) overload was crashing with an empty
   QByteArray. It was unconditionally calling lastIndexOfCharHelper()
   which assumes that this QBA is not empty. An explicit check for
   the empty case is added.
2. The indexOf(QByteArray, qsizetype) overload was behaving incorrectly
   while searching for an empty QByteArray. In this case it
   unconditionally returned its second parameter (from). However, from
   can be negative, or even exceed the size of this QByteArray. This
   patch handles this cases properly.

As a drive-by: this patch adjusts the QByteArray::indexOf(char, qsizetype)
and QByteArray::lastIndexOf(char, qsizetype) overloads to match with the
QByteArrayView implementation. This is done to have similar code paths
in both cases and avoid tricky bugs in future.
Ideally we had to adjust the QByteArrayView implementation, but it's
fully inline, so can't be changed without breaking BC.

Task-number: QTBUG-91736
Pick-to: 6.2 6.1
Change-Id: Iaef2fdc5b99cce6aa342cca2d17544a1ad7ca677
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-07-29 15:00:35 +02:00
Marc Mutz
c61d9873e5 QPrivateSlotBase: add empty base class optimization
There are few slots whose lambdas are empty; most will at least
capture [this]. But there are a few in Qt examples that do, e.g. []{
qApp->quit(); }. Logging is also an example. So go the extra mile and
optimize for empty functors by inheriting from them as opposed to
storing them in a member variable.

Change-Id: I3904f10db5ebe904ba889d29c08569edd804df3b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-07-29 15:00:35 +02:00
Ivan Solovev
59df5dacd5 Fix QString test compilation without QRegularExpression
The QString itself can be compiled without QRegularExpression, but
the tests do not check if they are supported or not.
This patch fixes the issue by introducing the proper #ifdef guards.

Task-number: QTBUG-91736
Pick-to: 6.2 6.1
Change-Id: I797691f78a34d4f78a86af99c78bf06e26e846d1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-07-29 14:36:49 +02:00
Marc Mutz
3c683a8a8d QSlotObjectBase: document relation between m_impl and Operation better
Change-Id: I02bfe1857a9c2b781f7ad891e813fd6818fab671
Reviewed-by: Ivan Tkachenko <me@ratijas.tk>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-07-29 13:35:55 +02:00
Mårten Nordheim
d179ec6ca4 QString benchmark: don't use %ls
The vsnprintf we use in QTest doesn't not have a portable %ls:
It accepts wchar_t, so it's UTF-32 on Linux and UTF-16 on Windows

Change-Id: I9ebda1e92b6e8e4dbbb79c6f2e35a833c587a089
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-07-29 10:42:36 +02:00
Timur Pocheptsov
8d0e4a2e5c tst_QSslCertificate::verify - skip auto-test
as a temporary fix for suddenly expired certificates situation (to
be regenerated).

Pick-to: 6.2 6.1 5.15
Task-number: QTBUG-95429
Change-Id: I00ad11cfd8824eeeffa2991dfcda6a7899726953
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-29 08:09:55 +02:00
Edward Welbourne
92f8043759 Update float16 part of TestLib selftest
In commit 9bad096c09 I gave
qFuzzyIsNull(qfloat16) a more forgiving threshold, consistent with
qFloatCompare(qfloat16, qfloat16)'s fractional threshold. The selftest
failed to catch two of the tests failing, so fix one of them to use
different values, and remove one.

Updated test expection for txt and deleted for other formats, as
they're skipped (in tst_selftests.cpp) for this test. Refined the
generator script to know about this test only being tested for txt.

Pick-to: 6.2
Change-Id: I109547cf92178bb9f5ff0b06e0b3bb40c881b41b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-07-28 21:26:55 +02:00
Alexandru Croitor
42970e490a CMake: Bump min required CMake version for shared Qt builds to 3.16
Building a shared library Qt configuration already required a minimum
CMake version of 3.16, because we depend on CMake's Autogen.json files
which are used for metatype.json file generation.

If a lower version was used, a FATAL_ERROR was issued in
qt6_extract_metatypes.

This change is essentially moving the check to happen earlier in the
qtbase configure process.

User projects will now /also/ officially require a minimum of 3.16
(up from 3.14).

As a consequence, the min/max version policy range that is set in
the public QtFooConfig.cmake files is changed
from 3.14..3.19
to   3.16..3.20

The upper bound is raised because building and using Qt works fine
with all CMake 3.20 policies set to NEW.

[ChangeLog][CMake] Building Qt as shared libraries now requires
CMake version 3.16 or later. Building user projects with CMake using
that Qt installation also requires a CMake version of 3.16 or later.

Pick-to: 6.2
Task-number: QTBUG-95018
Change-Id: I77d2829370f1dfc90b4071bebc8a3ade654e59e6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-07-28 20:54:14 +02:00
Alexander Volkov
0a8aa8c23e Doc: Fix typo Ctr -> Ctrl
Pick-to: 6.1 6.2
Change-Id: I89c9526aa74b312dd67a6d194395b3298bbc31fe
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-07-28 21:00:36 +03:00
Marc Mutz
767e00a2d7 QUuid: port fromRfc4122() to QByteArrayView
Remove the QByteArray overload from the API, but not the ABI.

Adapt callers.

Change-Id: I88aa09cbca3b89d0b249ce336ebe49c4b352c9e1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-07-28 17:50:09 +02:00
Marc Mutz
3a72496b5c tests: fix some -Wvolatile
C++20 deprecated compound volatile statements such as pre- and
post-increments, to stress that they're not atomic. So instead of

    volatile i;
    ~~~~;
    ++i;

you're now supposed to write

    volatile i;
    ~~~~;
    int j = i; // volatile load
    ++j;
    i = j; // volatile store

which matches more closely what hardware does.

Instead of fixing every use of volatile pre- or post-increment in this
fashion individually, and realising that probably a few more Qt
modules will have the same kind of code patterns in them, write
QtPrivate functions to do the job centrally.

Change-Id: I838097bd484ef2118c071726963f103c080d2ba5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-07-28 17:50:09 +02:00
Nicolas Fella
74a91773af [qgenericunixservices] Consider kde-open5 for opening URLs
When xdg-open is not found the KDE-specific kfmclient is considered.
That however is part of Konqueror and may not be present as well.
Plasma offers another option, kde-open5, which should be considered
before falling back to webbrowsers.
This is particularly for non-http URLs like tel: where opening in a
webbrowser is not wanted.

Pick-to: 6.2 6.1 5.15
Change-Id: I2b606562e21568fbe43f4593de67a1d467918cc4
Reviewed-by: David Faure <david.faure@kdab.com>
2021-07-28 16:37:10 +02:00
Timur Pocheptsov
4c0f81490b Provide new code paths for OpenSSL v3
With OpenSSL v3 it would be possible to compile-out functions,
directly working with entities like RSA, DSA, DH and EC_KEY.
For this you have to define OPENSSL_API_COMPAT >= 0x30000000L.
This would break QSslKey and QSslContext.
To mitigate this potential problem, we switch to the 'generic'
API, that works with EVP_PKEY instead. All functionality
will be preserved, except inability of QSslKey::handle()
to get pointers to RSA, DSA, DH or EC_KEY.

Fixes: QTBUG-95122
Pick-to: 6.2
Change-Id: Ic85b48502421c4330cf4877b52850539c855fa74
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-28 16:24:24 +02:00
Marc Mutz
25fff849e8 QDirIterator: add nextFileInfo()
Before this change, next() was the only way to advance the iterator,
whether the caller was ultimately interested in just the filePath()
(good) or not (bad luck, had to call .fileInfo()).

Add a new function, nextFileInfo(), with returns fileInfo() instead.
Incidentally, the returned object has already been constructed as part
of advance()ing the iterator, so the new function is faster than
next() even if the result is ignored, because we're not calculating a
QString result the caller may not be interested in.

Use the new function around the code.

Fix a couple of cases of next(); fileInfo().filePath() (just use
next()'s return value) as a drive-by.

[ChangeLog][QtCore][QDirIterator] Added nextFileInfo(), which is like
next(), but returns fileInfo() instead of filePath().

Change-Id: I601220575961169b44139fc55b9eae6c3197afb4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-28 15:16:42 +02:00
Nico Vertriest
8ccd5d5af2 Doc: Fix link errors in qmake manual
- Replaced # with / after link prefix "Qt for macOS"
- added definite article
- punctuation issue
- Added prefix "Qt for macOS/" to one link, and
  changed "macOS Version Dependencies" to "Supported Versions"

Fixes: QTBUG-90662
Change-Id: Ib2e48ee477e8d34fece64d6dea1f86fe73f09478
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-07-28 14:40:10 +02:00
Mårten Nordheim
a3889e1cc4 QSysInfo: Delete pre-windows 10 code
It's not supported.

Change-Id: Id8c6ca7e7ad152620c76b5479ca495e9f64cc354
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-07-28 13:18:50 +02:00
Mårten Nordheim
6a51ff3f0d io: Remove version checks for versions below Win 10
It's not supported.

Change-Id: Ia17fc7e1d5ae785eca0a6ba530f9b9bc960605d4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-07-28 13:18:50 +02:00
Mårten Nordheim
c877e9760b QEventDispatcher: Remove code dealing with Windows < 10
It's not supported.

Change-Id: I650a48f214bc4965b5e28f04e4f095273d7f9e5b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-07-28 13:18:50 +02:00
Marc Mutz
becb3596f0 QtCore: clean up API removals
Use the same new pattern as in QtWidgets.

Amends de18b3ff37.

Change-Id: Ia1cbd40aa7a7efc9a954d22b599e13a19a6a9266
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-07-28 09:43:03 +02:00
Marc Mutz
d3ecc6db29 QMenuBar: remove addAction() functions
They're now in QWidget itself. Remove them from the API, but not the
ABI.

[ChangeLog][QtWidgets][QMenuBar] The addAction() functions have been
moved down into QWidget.

Change-Id: Iaa023ff227686e8e67a2b5594f0fbc31b95177a3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-07-28 02:01:21 +02:00