Commit Graph

47969 Commits

Author SHA1 Message Date
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
Ulf Hermann
ac493c335c Make QMetaSequence's d_ptr const
The container interface should really never change.

Change-Id: I31dedf5b776da97a747f0eb26f3bc83ce46f3caa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-12 09:12:34 +02:00
Ulf Hermann
ef93fdeb09 Provide methods for adding values to a sequential iterable
Provide functionality to add and remove values, so that you can use a
sequential iterable as stack or queue if the underlying container
supports this. To this end, provide a way to specify whether the
value should be added or removed at the beginning or the end of the
iterable.

Change-Id: If63d302f3ca085e56d601116ce4dfaa6b94a0c4f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-09-12 09:12:26 +02:00
Ulf Hermann
73fe229eb4 QMetaContainer: Add an "input" iterator capability
For completeness' sake we should expose this. The iterators provided by
QIterable and friends will check the category at runtime, and should give
sensible feedback.

Change-Id: I778894f340c862f79a18c6c5607bcbba98dd7598
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-12 09:12:18 +02:00
Nicolas Fella
89c65bc8f7 Fix documentations string in QPagedPaintDevice
pageLayout().pageOrientation() does not exist, but pageLayout().orientation() does.

Pick-to: 5.15
Change-Id: I17a667b18aba284b91972422e604568e2fdbda05
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-12 08:43:18 +02:00
Richard Moe Gustavsen
43fa4b2687 QStyle: return 'Fusion' instead of 'fusion'
This change should have no impact on Widgets, since style names
there are case-insensitive. But for QtQuick controls the style
names are case sensitive. So in order to use the style hint
from the platform theme for controls, we need to return
the name with an uppercase "F".

Change-Id: I360f43f174938202b0ef2cdfcde6daf39c9f39bb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-09-12 08:38:39 +02:00
Richard Moe Gustavsen
f7863bfdb9 QAbstractSpinBox: don't emit update signals twice
A QAbstractSpinBox has a spinClickThresholdTimer that is detecting
if the user is doing a press'n'hold on one of the spin buttons, to
activate auto-repeat.

But if the valueChanged() handler in the application spends too much
time before it returns, the spinClickThresholdTimer will fire before
we get a chance to cancel it from the pending mouseRelease event.

The result is that the spinbox will think that the user is doing a
press'n'hold, and increment the value once more.

To avoid this, we start the timer _after_ the call to
valueChanged() instead.

Pick-to: 5.15
Fixes: QTBUG-86483
Change-Id: Iff5de4f8da562738e02848c98bc1fbc9fe227748
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-12 05:43:35 +02:00
Volker Hilsheimer
60a6f3f3da Remove dead code and obsolete comment
The special members do nothing that the compiler-generated default
doesn't do, so remove them.

Remove the comment introduced in d06b4ca9a1 about
QBitmap inherting QPixmap being a problem. It which wasn't followed
up on for Qt 6, and making QBitmap a QPaintDevice rather than a
QPixmap subclass (as implied in the commit message) would result in
significant code duplication.

Change-Id: I8d5032062f95ab19b38eb97d17191a9b13af870f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-12 05:43:01 +02:00
Volker Hilsheimer
3f8c4ae047 QAbstractItemView: add virtual itemDelegateForIndex
and obsolete itemDelegate(index), which the new function replaces.

This allows itemviews to override the item delegate per index. The
existing APIs to set delegates for rows and columns doesn't work for
tree views, or other views where the delegate should depend on the
parent index as well.

Adjust all itemview code that accessed the QAIVPrivate's relevant
data structures directly to go through the virtual function.

[ChangeLog][QtWidgets][QAbstractItemView] The
itemDelegate(QModelIndex) member function has been made obsolete,
and has been replaced by a new virtual
itemDelegateForIndex(QModelIndex) member function that can be
overridden to give subclasses control over which item delegate
should be used for an index.

Change-Id: Ib03529c38797386d3a1d4cf3c5646e911d95daf5
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2020-09-12 05:42:53 +02:00
Timur Pocheptsov
605d2163f1 QSsl: workaround a 'very secure' OpenSSL version (CentOS 8.x et al)
CentOS it seems not only backported some OpenSSL 3 functions,
but also raised the default security level to 2, making some of
our keys (and MDs?) 'too weak' and failing auto-tests here and
there as a result. For our auto-test we lower the level to 1,
as it is expected to be.

Fixes: QTBUG-86336
Pick-to: 5.15
Change-Id: I7062a1b292e8b60eb9c2b2e82bd002f09f9da603
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-12 05:36:08 +02:00
Allan Sandfeld Jensen
5bb4baae03 Replace qreal with float in QColor
There is no reason to use double precision for colors. We at most have
16 significant bits anyway.

Change-Id: I8b402cd978675b8ba7248176976d934363212ff1
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2020-09-11 20:41:15 +02:00
Mårten Nordheim
25a0153802 QAuthenticatorPrivate::parseHttpResponse: mark "host" as unused
... in the case where it is unused

Change-Id: Ia181b975f07a8d1eee078867b98168ec5c326612
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-09-11 17:57:20 +00:00
Alexandru Croitor
94c15bda6e CMake: Provide way to register extra tool package dependencies
This is needed for qtwayland, where QtWaylandCompositor package should
call find_package(QtWaylandScanner) in the 'Tools' section of the
ModuleDependencies.cmake file, rather than the regular 'Qt' section.

This takes care of handling host path prefixes, to ensure that a host
package is found even when tools have also been cross-compiled via the
QT_BUILD_TOOLS_WHEN_CROSSCOMPILING option.

Task-number: QTBUG-83968
Change-Id: I4725a630214d053105fb6d2a0f7c5ff6128d13f9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-09-11 19:49:53 +02:00
Alexandru Croitor
9a2ee31059 CMake: Fix rpaths set for Qt internal apps like Designer
qt_apply_rpaths takes into account properties like MACOSX_BUNDLE. This
property might not yet be set when qt_internal_add_app is called, but
later.

To handle that, move the call of qt_apply_rpaths to
qt_internal_finalize_app.

As a result, the installed apps will have 2 rpaths, the $ORIGIN style
relocatable one, and an absolute path one pointing to the Qt
prefix/lib. The last one might be unnecessary.

Fixes: QTBUG-86514
Change-Id: I25e0d695c78c8b5703e94c99cc2457f772721456
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-09-11 19:49:50 +02:00
Allan Sandfeld Jensen
9346760f5a Minimal ABI necessary for future optimized QPixmap
Add virtual hooks that can make it possible in Qt6 to implement paint
device specific pixmaps.

Change-Id: Ib1d1d7b5e32d9430203f718534344b25c0ead744
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-09-11 19:47:10 +02:00
Andreas Buhr
ac7e518a64 [QtCore] Fix QDateTime unit test: time zone of system was used
Test data for QDateTime unit tests was constructed in system's local
time, which made unit test outcome dependent on the time zone of the
system running the tests.
This led to failing unit tests on systems with libc6 version
2.31 or newer. A QDateTime in a timezone, which has daylight saving
time, was created and then used in Hawaii's time zone,which has no
daylight saving time. Newer glibc checks this and returns errors.
This patch changes the behavior to create the test data in a
specified time zone setting.

Task-number: QTBUG-80441
Change-Id: I0330b647fa011be99141dde09001ff2d58bd3a5f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-09-11 19:34:25 +02:00
Lars Knoll
1316a0aef2 Fix Qt6 related comments in qdebug
Change-Id: I9861d29a6615863094cd007178f214a816865eb7
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-09-11 19:32:36 +02:00
Lars Knoll
defc8414fd Cleanup QGradient
Tackle some cleanups scheduled for Qt 6.

Change-Id: I46e6e49e3d74f49ce953a36c5611d635232d43b1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-11 19:32:35 +02:00
Lars Knoll
698761ea8a Remove Qt6 related comment
We can't unexport the class, as it's being used by the
OpenGL paint engine in QtOpenGL.

Change-Id: I74c1bef0e4720a82679a329462e80571f0583a84
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-09-11 19:32:35 +02:00
Lars Knoll
6751933521 Get rid of QEnableIf
Use std::enable_if instead.

Change-Id: I02a2f3066f9e4cab6db1909681a17330afdbbedb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-11 19:32:35 +02:00
Lars Knoll
05acc167c9 Remove pre-C++17 code path
Change-Id: Iaa7f677f45cee50f0b9ed236cf5bef18d5764bfa
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-09-11 19:32:35 +02:00
Lars Knoll
0078391c18 Fix warnings coming from using the deprecated overload of qCheckSum
Change-Id: I719c2d56a690fd245d3917045de4005f118c688b
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-09-11 19:32:34 +02:00