Commit Graph

47840 Commits

Author SHA1 Message Date
Allan Sandfeld Jensen
fce84f76f0 Get rid of Qt4 virtual hooks
They have existed throughout Qt5, and no longer used by any
QIconEngine I am aware of.

Change-Id: Iab0a978be808a60fb82379467e294e2457056bae
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-09-15 01:40:43 +02:00
André Klitzing
b79b75adf9 Fix -Wunguarded-availability-new for userInterfaceStyle
'userInterfaceStyle' is only available on iOS 12.0 or newer [-Werror,-Wunguarded-availability-new]
       if (previousTraitCollection.userInterfaceStyle != self.traitCollection.userInterfaceStyle) {

Pick-to: 5.15
Change-Id: Id6340f70019d55ab2a0707b1aebd6d333e9544cb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-14 22:25:48 +00:00
Adriaan de Groot
07044d70e9 Add missing #includes for FreeBSD build
QFile is no longer included implicitly via other headers,
so include it explicitly in the FreeBSD framebuffer code.
This is needed to make it compile (at all, although there
are also API changes to chase and general bitrot).

Change-Id: I3801a39503f545a24a3b2c58122774b5697358e9
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-09-14 20:41:42 +02:00
Laszlo Agocs
d7d0f4d5a0 rhi: gl: Eliminate duplicate glUniform calls
This can happen when there is a uniform block in the Vulkan
shader with an instance name, both in the vertex and fragment
shader. The members are mapped to members of a struct uniform
in GLSL since we do not use uniform buffers there.

Now if there is, for example, "ubuf.opacity" both in the vertex and
fragment shader reflection info, then it's still just one single
uniform in the GL program, using one location. Registering it twice
in our 'uniforms' list is harmless, but wasteful, since it means the
uniform value will be set twice upon each setShaderResources().

Change-Id: Ib646eaec333522560d631b3b81800ef610f09319
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-09-14 20:41:42 +02:00
Inho Lee
02d5566d68 QRhi: support matrix array types of the uniform in GLES2 backend
Task-number: QTBUG-83173
Change-Id: Ieda8948820a9470e3b0bc420ec7b1af09395d568
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-09-14 20:41:42 +02:00
Shawn Rutledge
db07a20355 Remove QPointerEvent::isPointAccepted() and setPointAccepted()
They are redundant, not in use, and got added without implementation in
a81859a3c8.

Change-Id: Ifed1fbf97a8158c2801df09dac47bf1fc90795d4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-14 17:14:52 +02:00
Mårten Nordheim
2253d5eca6 Schannel: Properly handle request for certificate
Certain servers, like smtp.live.com, will send a request for a
certificate even though they don't require one. In Schannel this
manifests as a warning/info status (SEC_I_INCOMPLETE_CREDENTIALS).
In the cases where it's not needed we should suppress the warning and
try to connect anyway, which is done by calling
InitializeSecurityContext again when we get the status.

Pick-to: 5.15
Change-Id: I3c48140f2949d8557251a49a2b66946da9395736
Reviewed-by: Joshua GPBeta <studiocghibli@gmail.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-09-14 17:14:00 +02:00
Joerg Bornemann
6718dea390 Revert "Revert "CMake: Add facility to mark package dependencies as optional""
This reverts commit b0c51f86f4.
The build failure caused by 58c1c6ee5c has
been fixed.

Change-Id: Ic7458d54c7a874588e8b1bfeca61df1842763656
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-14 15:03:14 +02:00
Joerg Bornemann
b96d350cff Revert "Revert "CMake: Reduce the number of find_dependency calls""
This reverts commit 6e1a570dc8.
The build failure caused by 58c1c6ee5c has
been fixed.

Change-Id: I67acaa2d1dd5fc88c205b054252be2e6e26898c7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-14 15:03:14 +02:00
Paul Wicking
165bc70bc3 Doc: Remove outdated information
Seems this information is obsolete, get rid of it.

Fixes: QTBUG-86607
Pick-to: 5.15
Change-Id: I0250e32b3c312c7da0363dd1b0d7f676bbfa0115
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-14 15:03:13 +02:00
Joerg Bornemann
82ff8a51f9 Revert "Revert "CMake: Make the Vulkan dependency of QtGui optional""
This reverts commit f0873a1c62.
The build failure caused by 58c1c6ee5c has
been fixed.

Change-Id: I5cec78b353089ca024e905795bc99cad423c2d4e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-14 15:03:13 +02:00
Joerg Bornemann
b9c493728a Revert "Revert "CMake: Fix usage of find_dependency()""
...and fix the build errors the original change caused.
This reverts commit 127fb8bb55.

Change-Id: I4006b32734a51c5d101dd73c957f81d2a0f84ba1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-14 15:03:13 +02:00
Ulf Hermann
721116de30 Add QVariantRef, QVariantPointer, QVariantConstPointer
Change-Id: Ia329265826ab2f76e77ac14bb8d8e415a1b41dd6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-14 12:41:00 +02:00
Kai Koehne
cdb9ffd7e1 Windows: Fix clang error about copy on loop
clang on Windows shows an error:

qtbase/src/gui/text/windows/qwindowsfontdatabase_ft.cpp:122:25: error: loop variable 'key' of type 'const QString' creates a copy from type 'const QString' [-Werror,-Wrange-loop-construct]
        for (const auto key : keys) {
                        ^

Change-Id: Icdfa5e2a6753450213dcb96df70247c5a71c2293
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-14 12:41:00 +02:00
Tor Arne Vestbø
0c02f133f3 Plumb application quit through platform plugin
If we have a platform plugin we ask the platform to quit, and if
not we fall back to the base implementation of QCoreApplication
that sends Quit events directly.

This allows the platform to involve the rest of the system in the
process. The platform will then come back with a spontaneous quit
via QWSI::handleApplicationTermination(), which will then send
the corresponding Quit even from QGuiApplication like normal.

Task-number: QTBUG-45262
Task-number: QTBUG-33235
Task-number: QTBUG-72013
Task-number: QTBUG-59782
Change-Id: I0000aaf7192e4b905933c5da0e53901c6c88f26a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-14 12:41:00 +02:00
Laszlo Agocs
cc570ce2fe Fix vulkan example build with MSVC
Undeclared identifier ssize_t etc. Just use int. Not like we can have
more than a handful of physical devices anyway.

Change-Id: Ie1fb7ab9794a7d39e84db864c2be6dbdd5d97f50
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-09-14 09:48:05 +02:00
Edward Welbourne
ed2f5e7cf2 QUuid: merge toString() overloads and toByteArray() overloads
In each case, simply give WithBraces as default for mode, since that's
what _q_uuidToHex() used internally.

Task-number: QTBUG-85700
Change-Id: I9f6fddb259703917129d4be742bbdd2eb1647f44
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-14 09:47:51 +02:00
Edward Welbourne
533df067e9 Purge Q_{STDLIB,COMPILER}_UNICODE_STRINGS
These were now always defined, hence redundant.
Leave the #define in place so that we can verify we actually do always
define it, in a #else of an existing #if check on it.

Change-Id: Iea4c3dbc8f9982268bcf81da5ef17fe2ebf5c462
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-14 09:47:51 +02:00
Edward Welbourne
c4378b8620 Clean up the last of QT6_(NOT_)?VIRTUAL
This follows up on commit d273076b44
which left a comment asking for the clean-up this finishes.

Task-number: QTBUG-85700
Change-Id: I1c6896a42a09b873302ad7ec8273879f2a4a4ce6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-14 09:47:50 +02:00
Edward Welbourne
6b43b665a8 Make QTRY_IMPL() exit its loop if the test fails
Some tests, particularly the asynchronous ones that depend on the
QTRY_*() macros, have call-backs in which a test can fail, but the
macro used to test for failure only returns from the call-back, so the
test doesn't know to fail.

Make sure the QTRY_*() macro gives up if that happens, so that the
test function at least gets control back and can notice that it's
failed. Even if they don't check, they'll fail sooner, where they
might otherwise have been stuck in a loop that would never exit until
the watchdog timer shoots the test down (and Coin ends up with a
debugger back-trace and no output from later tests).

Change-Id: I622a53117de5e97d23dd22e04e5cd20361a54651
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-09-14 09:47:50 +02:00
Edward Welbourne
e926e68f50 Don't use default-constructed QTime() where QTime(0, 0) is intended
QTime() is invalid. Only the seconds and milliseconds are optional,
for valid times. Use startOfDay() for zoned times, QTime(0, 0) for
fixed-offset ones.

Change-Id: I3b65d5c3733ac83dc3a6c214859c3f56a480bb94
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-14 09:47:50 +02:00
Andrei Golubev
1ca3af0a71 QString: use QCommonArrayOps::erase instead of custom logic
With 6e8985e357 merged we can now use
generic erase logic provided by array operations. This commit aligns
QString with QList/QByteArray

Task-number: QTBUG-84320
Change-Id: I83e9349e2461afd98737df25613aa2d0fd817a71
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-14 09:47:50 +02:00
Edward Welbourne
184e385aa2 Remove some unused private methods and replace another
Nothing used defDateTime(), nothing but it used defTime().  The only
other use of defDate() were from one test, which might as well make it
a local variable.

QDateTime's default is invalid, making invalidDateTime() redundant,
and the invalidDate() and invalidTime() it called had no other users.

Change-Id: I0e07ee58478bfe8ba680eafb52e2f73a962edd33
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-14 09:47:50 +02:00
Thiago Macieira
d8d7dbb65a Compile on QNX after QFlags constructor deprecation
The QFlags constructor taking a plain zero literal was deprecated in
commit af2daafde7.

Pick-to: 5.15
Fixes: QTBUG-86585
Change-Id: I2fc68c725ba649218bd9fffd1633d6251649d2bd
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-09-13 12:04:47 -07:00
Lars Knoll
4e0fb694c7 Silence warnings from using deprecated CUPS APIs
Apparently these APIs don't have any replacements that we
can use, so we have to continue to depend on them for now.
Silence the compiler warnings related to them, to avoid
unnecessary noise.

Change-Id: I1838e3c82bedd31529fdad8debc577dca17613e5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-13 19:03:47 +00:00
Lars Knoll
2c698a6d07 Fix compiler warnings about missing overrides
Change-Id: I52bf9fe45607f4a99cafa441bd78dfe5f7adb0e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-13 21:03:31 +02:00
Allan Sandfeld Jensen
6a37ca39ec Use universal C++20 bit operations when available
Avoids using compiler builtins, and can in future replace them.

Change-Id: I3f0afe7d28b6ba05bcd1c1132b44a8db7b182d8a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-13 18:26:49 +02:00
Andy Shaw
65afcef217 Interbase: Handle EXECUTE BLOCK statements correctly
Since an EXECUTE BLOCK statement can have a mix of ? and :var syntax
then a special case for this needs to be added so that it does not try
to convert the :var parts into positional placeholders as they need to
kept as-is when preparing such a statement.

Pick-to: 5.15
Fixes: QTBUG-83152
Change-Id: Iff891207ad6dea1681a1b3a335acbbbb668b465d
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2020-09-13 16:39:06 +02:00
Lars Knoll
46c1e60989 Restore qWait() implementation
qWait() and qWaitFor() have one subtle difference in behavior,
where qWait passes the remaining time to processEvents() and
qWaitFor() does not. This lead to instability on timing
sensitive tests on macOS.

Amends 1abea5f5f1

Change-Id: I20f516813ca67d9e86de468c4403e475f08edc26
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-13 13:22:46 +02:00
Lars Knoll
127fb8bb55 Revert "CMake: Fix usage of find_dependency()"
This reverts commit 58c1c6ee5c.

This lead to configuration errors on some machines, blocking
development.

Change-Id: I744f6cc95fbaa273519ab8fc8fb492b87f5729b8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-13 12:21:06 +02:00
Lars Knoll
6e1a570dc8 Revert "CMake: Reduce the number of find_dependency calls"
This reverts commit a3cb002511.

This lead to configuration errors on some machines, blocking
development.

Change-Id: Ibb785c96c7d85692a6e22a73e086119eb571df71
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-13 12:21:01 +02:00
Lars Knoll
b0c51f86f4 Revert "CMake: Add facility to mark package dependencies as optional"
This reverts commit 3685483c4b.

This lead to configuration errors on some machines, blocking
development.

Change-Id: I309cdd55a8ef64899afcbeca54458d1c6d686951
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-13 12:20:56 +02:00
Lars Knoll
f0873a1c62 Revert "CMake: Make the Vulkan dependency of QtGui optional"
The last 4 cmake changes broke configuring qtbase on at least
Volkers and my machine (Ubuntu 20.04)

Revert the changes, to unblock development of qtbase and
other modules.

This reverts commit 16aa8c8f4d.

Change-Id: Id562bdac1915dba429ae4a0af6054d3e5e5e5d12
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-13 12:20:50 +02:00
Lars Knoll
652bd1efca Make QStringList an alias to QList<QString>
Fix our API, so that QStringList and QList<QString> are the
same thing.

This required a bit of refactoring in QList and moving the
indexOf(), lastIndexOf() and contains() method into
QListSpecialMethods. In addition, we need to ensure that
the QStringList(const QString&) constructor is still available
for compatibility with Qt 5.

Once those two are done, all methods in QStringList can be moved
into QListSpecialMethods<QString>.

Change-Id: Ib8afbf5b6d9df4d0d47051252233506f62335fa3
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-12 23:37:15 +02:00
Lars Knoll
ead02871cc Remove some dead code
Change-Id: I9d67eaa1b9d32ca245cf606ca2f11c77dafac1df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-12 23:36:50 +02:00
Lars Knoll
57f48eea48 Remove two comments that don't make any sense
Change-Id: I775a81c4e3c0fb3d7eebf403bffb1e82864eff48
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-12 23:36:45 +02:00
Lars Knoll
e07a739138 Fix generated forward declarations in qdbusxml.cpp
Simply use qcontainerfwd.h, instead of declaring those manually.

Change-Id: I6d87bf14b60469b457e8e9335868f8cdb0303817
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-12 23:36:04 +02:00
Lars Knoll
557623cc4f Rename QLibraryInfo::location() to path()
As per ### Qt6 comment. Also rename the LibraryLocation enum
to LibraryPath.

Change-Id: I556025a19c5bcdf2ff52598eaba32269522d4128
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-12 23:35:56 +02:00
Lars Knoll
d24174918f Inline one method as per ###Qt6
Change-Id: I4bf0ddf4ddf4044a60d881a57ef63b96d4bac262
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-09-12 23:35:43 +02:00
Lars Knoll
14dece57e9 Remap QMetaType ids to create more space for builtin types
We were starting to run out of space for builtin core types.
Remap the type id's to create lots of additional space.
We now reserve the first 64k id's for Qt, and have 16k id's for
Qt Core. That should hopfully be enough for a while ;-)

Fixes: QTBUG-85914
Change-Id: I0dab6bf23652e46a9557d9b38af7990b68c572b6
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-09-12 23:35:29 +02:00
Lars Knoll
7d1a74d36d Small doc fix
Refer to QMetaType, not QVariant::Type

Change-Id: I3e9284742b332095a26c03c68580ad0f6d4f9be7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-09-12 23:35:01 +02:00
Lars Knoll
b311aff0a0 Fix uninitialized variable
Amends defc8414fd

Change-Id: I0a62f08cb9428e94b30f659d810c767c2bc1b4b2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-12 21:40:21 +02:00
Joerg Bornemann
16aa8c8f4d CMake: Make the Vulkan dependency of QtGui optional
Vulkan cannot be a required public dependency of QtGui, because a
vulkan-enabled build of Qt will fail on a machine where the vulkan
headers are not installed. We cannot make the vulkan dependency private,
because we have public Qt headers that include vulkan headers.

The vulkan dependency is now marked as optional, meaning consuming
projects will try to find it, but there will be no error on failure.

Task-number: QTBUG-86421
Change-Id: I30edfd3eaa603048f4274e77036c54d90789d3c9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-12 19:27:01 +02:00
Joerg Bornemann
3685483c4b CMake: Add facility to mark package dependencies as optional
Every public dependency of a Qt module results in a find_package call in
the consuming project. But not all public dependencies are mandatory.

For example, vulkan is only needed if the user project actually uses Qt
classes that pull in vulkan headers.

This patch adds the option MARK_OPTIONAL to qt_find_package.
Dependencies that are marked as optional will not produce an error on
find failure.

Task-number: QTBUG-86421
Change-Id: Ia767e7f36991e236582c7509cbd37ea3487bb695
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-12 19:26:58 +02:00
Joerg Bornemann
a3cb002511 CMake: Reduce the number of find_dependency calls
...in code. The actual number of calls at runtime does not change.
The reason for this stunt is that we want to replace find_dependency
with find_package at runtime for optional dependencies, and this will
reduce the diff size of the next commit.

Change-Id: I304fdf09c69fea7b6d4adabf515712eb097f8c86
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-12 19:26:55 +02:00
Joerg Bornemann
58c1c6ee5c CMake: Fix usage of find_dependency()
The find_dependency() macro calls return() on failure, meaning any code
after it will be ignored, thus checking any XXX_FOUND variables after
find_dependency() is pointless.

Fix the places where we use find_dependency() and set the "failed" state
before the call and the "success" state afterwards.

Change-Id: Ia5239c704f02a9bec972210374ffed7808b14055
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-12 19:26:52 +02:00
Tor Arne Vestbø
55687924e3 cmake: Re-enable qcoreapplication and qtimer tests
They were disabled in ad0e3e26fa,
but that was probably accidental.

Change-Id: Ia9cbccfbeecfe84768c3465f5699ed44b7f932a5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-09-12 15:11:52 +02:00
Christian Ehrlicher
1618727da4 QtSql: enhance documentation
Be a little bit more specific what needs to be done when compiling the
sql driver without compiling the whole Qt

Change-Id: I3e8010d4cc84a83108340e525e620abf6b6e89c1
Pick-to: 5.15
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-09-12 14:51:58 +02:00
Lars Knoll
1abea5f5f1 Partially revert "Inline QTest::qSleep()"
This change partially reverts change
a0e0b51001.

Replacing the QTest specific sleep function with QThread::msleep()
was not a good idea. The reason is that QThread::msleep() will force
the thread to sleep to x mseconds, even if a signal woke the thread
in the meantime.

This would cause qWaitFor() to not call processEvents(), in some cases,
leading to flakyness and test failures in tests that rely on timing,
such as the animation tests in Qt Qml.

Change-Id: I0ad132cdf32be5813b2e73552d772251fe1d7f89
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-12 14:07:05 +02:00
Ulf Hermann
a7b85e5993 QMetaContainer: Add function to erase ranges from sequences
Change-Id: Ic51103c36d288f236106e2d3aec1401d53b97a15
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-12 09:12:41 +02:00