Commit Graph

48810 Commits

Author SHA1 Message Date
Volker Hilsheimer
d1785f73db Swallow some runtime warnings from tst_qapplication
Change-Id: I226c3b55a1666eb3ccd369a3307919d4c72a2600
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-10-18 17:00:34 +02:00
Volker Hilsheimer
87f29754ec Fix compile warning from testing deprecated signal
Silence the warning, and test event delivery in addition.

Change-Id: I59c49a2ac70ecd32429116b76643700a7ad5ce3e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-10-18 17:00:24 +02:00
Giuseppe D'Angelo
f1408d9966 QColorSpace: port to QESDP
Replace the hand-rolled refcount management with QESDP.
Since the class has a default-constructed / moved-from state
where the d-pointer can be nullptr, add a in-class detach() that
ensures a private object.

Change-Id: Id81431fa60132dbc0eed45bb60b38d4f7d73833f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-10-18 14:02:32 +02:00
Ulf Hermann
9ceedd5863 Make most of QMetaTypeInterface constexpr
The only thing we need to modify at runtime is the typeId and that can
be mutable. This way we can have a constexpr ctor for QMetaType which
hopefully makes the importing and exporting of related symbols less
fickle.

On Windows we cannot make QMetaTypeForType constexpr as that leads to
mysterious errors in other places. Until we figure out why that is, we
just leave this class as non-constexpr.

This reveals that qcoreapplication.h and qvariant.h are using QDebug
without including it. We now get template instantiation errors. Include
qdebug.h to avoid that.

Change-Id: If1bf0437ada52459c59c6fa45bab3d22dfb0bc92
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-10-18 13:48:16 +02:00
Ulf Hermann
0b0acce5a7 Cbor: Export the datastream operators for QCborSimpleType
Otherwise they are not available to the tests. This is exposed by making
the metatype interfaces constexpr.

Change-Id: I1b3214f339985f2f8ffaf0640cf51e41e92198d0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-10-18 13:48:07 +02:00
Tor Arne Vestbø
40e6fe7801 doc: Update and flesh out native interface docs
The namespace and overviews are in the qtdoc repository.

Docs for individual interfaces should live with their platform.

Change-Id: Iba5fd7e9ebc4f1f634ec9dc3ec125ce88a1312ba
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-18 13:31:09 +02:00
Fabian Kosmale
1f66d914e4 QMutableEventPoint::detach: deref old private
After detaching, the current QMutableEventPoint obviously doesn't
reference old QMutableEventPointPrivate anymore. Deref it, so that we
do not leak memory.

Change-Id: I3b59667603d41f452eead9a2db13e1d005f622ec
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-10-18 10:42:48 +02:00
Joerg Bornemann
73f9c514dc CMake: Ignore license-related configure arguments
Do not print warnings for the configure arguments -commercial,
-opensource and -confirm-license. We're not removing the arguments yet
to keep existing build scripts working.

Fixes: QTBUG-86096
Change-Id: Ieb63e2f2b81c022e8559cde6c3e0be0b8ce655ca
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-17 23:27:31 +02:00
Tor Arne Vestbø
d6ff54a1ae doc: Make QtGui docs depend on platform integration docs
Change-Id: I72cad7f399219d448d78763c50369f087e9d0cf7
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-17 23:27:02 +02:00
Volker Hilsheimer
0d9934d4bc Consistenly deprecate QMultiMap insert, add moving unite overload
Change-Id: I8d1d30f3962b0444c27591bf45b6b3c538172039
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2020-10-17 17:34:52 +00:00
Fabian Kosmale
f660fedcab qcontainerinfo: make variable templates inline
Change-Id: I09d51f0a04a6dc12915ba6ad0b77af074238988d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-10-17 16:40:20 +02:00
Ulf Hermann
c800e96523 qtypeinfo.h: We only need a const reference for most operator<<
If we require a value, then we need a dtor, too. This is not always the
case. For example QSessionManager has a private dtor, leading to
failures.

Change-Id: I3f715848ff5c63b2ea2773c17bced21e7a814ca9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-17 12:15:44 +02:00
Cristian Adam
5216c56110 MinGW: Fix static direct2d plugin build using PCH
Ammends 27499d25fb

The value used to create the PCHs for _WIN32_WINNT is 0x601, and
qwindowspointerhandler.cpp requires for MinGW 0x603. Since the
precompile header value cannot be undefined while compiling the
source file, it's better not to use the PCH for this particular
source file.

Change-Id: I2dc10fa11f0a796c2d21d8880e32e911359f1602
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-17 12:13:11 +02:00
Cristian Adam
113f1ad324 CMake: Generate qrc files at configure time and make them traceable
Having the qrc files at configure time allows qmlimportscanner to
scan them when invoked with -qrcFiles argument.

The traceability part is done via _qt_generated_qrc_files property.

Task-number: QTBUG-85994
Change-Id: I75c252a987cd1c1f49ba73ec9d100edc73c23486
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-17 12:13:08 +02:00
Tor Arne Vestbø
b5af140809 Generalize the winmain/qtmain entry-point library
The use-case is relevant for other platforms as well.

Now that Qt has a module system we can also replace a lot of the
hand crafted logic for linking with simpler constructs.

Change-Id: Ib6853aaf81bfea79c31f2de741d65b4b56f23ef6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-17 12:13:00 +02:00
Alexandru Croitor
8ec4fd9cff CMake: pro2cmake: Handle qt3d library names
Change-Id: Iec582a3c066f64655ed533f8ef1bf0e2de0dc38c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-17 12:12:32 +02:00
Lars Knoll
3f477c7f0c Inline the members for QRecursiveMutex
Avoid creating a a d pointer for recursive mutexes.

Change-Id: I28af15a416ee17de346e2ea5b1442279d9d3e159
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-17 12:03:16 +02:00
Lars Knoll
f01ec0713d <chrono> should always be available with C++17
Change-Id: Ia4868259bfa25e4b929a51de6de580df7277c282
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-17 12:03:05 +02:00
Lars Knoll
d4b206b246 Split QMutex and QRecursiveMutex
These classes should not inherit from each other
anymore in Qt 6. The reason is that this makes
the 95% case of using a non-recursive mutex
much slower than it has to be.

This way, QMutex can now inline the fast path
and be pretty much as fast as QBasicMutex is
in Qt 5. They actually use the same code paths
now. The main difference is that QMutex allows
calling tryLock() with a timeout, which that
is not allowed for QBasicMutex.

[ChangeLog][QtCore][QMutex] QMutex does not support
recursive locking anymore. Use QRecursiveMutex for that
purpose. QRecursiveMutex does not inherit QMutex anymore
in Qt 6.

Change-Id: I10f9bab6269a9181a2e9f534fb72ce65bc76d989
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-17 12:02:56 +02:00
Lars Knoll
77d812683f Refactor QMutexLocker to be able to handle recursive mutexes
Since we're going to split QMutex and QRecursiveMutex into
separate classes, make sure QMutexLocker is prepared for that.

Change-Id: Id5e9a955d1db7c8ee663dd3811ad6448dad0aeae
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-17 12:02:49 +02:00
MagnaboscoL
f76530a617 Fix the initial cursor state for the VNC plugin
Ensure that we show a cursor directly after a client connects.

Fixes: QTBUG-85006
Pick-to: 5.15
Change-Id: Icb604beb1b0ca2e7efa42ac01c2aac0a3e002865
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-10-17 12:02:24 +02:00
Lars Knoll
2732231182 Cleanup remaining QVariant::Type uses in Qt Sql
Change-Id: Ibcaa678cd9f9c957392a75b477fa6821f9a69127
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-10-17 12:01:54 +02:00
Friedemann Kleint
008343a05e qmake: Fix qHash-related integer conversion warnings
Use size_t instead of uint.

Change-Id: I1dc38f61653f9bfc4ddeddcc65b0271aa4ad1256
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-17 11:56:59 +02:00
Friedemann Kleint
9ed75b6716 QWindowSystemInterface: Add tablet event overloads without timestamps
On some platforms, tablet events do not have a time stamp.

Task-number: QTBUG-46412
Change-Id: I3cc820b1edaaf55511c000fefb805f5a3a7872a6
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-10-17 11:56:41 +02:00
David Skoland
4a7280598b Fix Clang compiler warnings (-Wrange-loop-analysis)
In a macOS environment, Clang throws a number of compiler warnings
about loop variables when building qtbase.

See task for more info about the environment.

This changes a handful of loop variables,
like QJsonValue references into QJsonValueRefs.

Task-number: QTBUG-87216
Pick-to: 5.15
Change-Id: I26006efd7c75c2d56ebc7f7efb4c9bdcabe92e8b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-17 11:56:30 +02:00
Volker Hilsheimer
b61d67f897 Fix compile warnings from ignored return value
The return value can be ignored here, so make intention clear.

Change-Id: I116869c47039b159db96f133b5850a2215873c2f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-17 08:21:52 +02:00
Volker Hilsheimer
833a6e18bf Implement move and comparison operators for QEventPoint
QEventPoints are equal when all data values are equal, the
refcount is ignored.

Change-Id: I6ef70faf0b12129eaa22bfc1f0a45bab2422d421
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-10-17 08:21:52 +02:00
Andy Shaw
a9982e64eb sqlite: Upgrade to 3.33.0
[ChangeLog][QtSQL][sqlite] Upgraded to v3.33.0

Pick-to: 5.15
Pick-to: 5.12
Change-Id: I379d8c62b449d4c6b04e5154c8c1a86761e5466e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-17 08:21:52 +02:00
Giuseppe D'Angelo
32c68232a7 QColorConstants: code tidies
Change-Id: Ib4131a583529d2cd6a6d7d27513cca387cb1d722
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-10-17 03:04:42 +02:00
Tor Arne Vestbø
880db10f55 iOS: Remove dead code for linking to platform plugin
The code only existed to avoid the auto-generated
Q_IMPORT_PLUGIN(QIOSIntegrationPlugin), but nowadays
with bitcode enabled the code is not used, plus we end
up with this auto-generated file for other plugins anyways.

Change-Id: I91c8c88f4e825caab7d7d5250edaba8c57cb7374
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-16 23:59:28 +02:00
Tor Arne Vestbø
f6012c4a56 cmake: Fix logic for adding staticlib to module pri
Change-Id: I2426e78bb509a37e7e3924506903cd84732f88d8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-16 23:59:28 +02:00
Andreas Buhr
df8489816b Fix compilation with optimization with g++-10.2
When compiling in RelWithDebInfo configuration with g++-10.2,
it complains:
qtbase/src/gui/painting/qdatabuffer_p.h:71:36: error: argument 1 range
[18446744065119617024, 18446744073709551612] exceeds maximum object size
9223372036854775807 [-Werror=alloc-size-larger-than=]
This patch disables this warning in this place.

Pick-to: 5.15
Change-Id: Id3154ce80a1921671031828aaa7144214adad5dd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-10-16 18:49:02 +02:00
Andreas Buhr
16e4ae01bb Move file of test helpers out of directory for qtconcurrentmap tests
The test helpers are used both in the qtconcurrentmap tests and in the
qtconcurrentfilter tests. In the future, they should also be used
in generated tests. This patch moves the function out of the
qtconcurrentmap folder as it is not specific to 'map'.

Change-Id: Ie79a7ae3040a7eab7364a3aabf934158c7527b5a
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-10-16 18:49:01 +02:00
Allan Sandfeld Jensen
986c09f815 Test QImage move semantics
Tests the move semantics of QImage in Qt6.

Change-Id: Ia4d95f0b88ca7dde0daf85a0f53049b42b5be1a5
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2020-10-16 18:49:01 +02:00
Alexandru Croitor
1f9ec097b2 CMake: Rename some public API functions
Some of them have a different (hopefully better) name now.
Some are marked as Technical Preview.
Some are renamed to be internal.

Marking add_qt_gui_executable as TP with the intention to un-TP it
after we rename it and change its behavior as discussed in the API
review meeting.

Additional changes to add_qt_gui_executable and qt6_add_resources have
been filed as separate tasks that will be worked on separately.

See comments on PS1 for details.

Task-number: QTBUG-86827
Change-Id: I56a84a1943b0902bb807310dc620eb381824e8dd
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-16 13:53:04 +02:00
Volker Hilsheimer
d72ff6ffd0 Fix some compiler warnings from tests
For iterators that return a value, don't use reference in ranged for,
and cast numeric literal to correct size type for QCOMPARE.

Change-Id: Idfd09dbc2ef3ab1bf025c7859ea6e2e9572bc9a1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-16 13:53:04 +02:00
Alexandru Croitor
c6b3680bcf CMake: Fix qt_add_plugin to be a proper public API function
When configuring an example like
widgets/tools/plugandpaint/plugins/basictools outside of a Qt build,
the configuration fails because it tries to call the internal function
instead of the public one.

This was needed some time ago to facilitate moving from qt_add_plugin
to qt_internal_add_plugin, so some compatibility code was added.

But we've now migrated to qt_internal_add_plugin across most repos,
so we should remove the compatibility code to allow examples to
configure successfully.

Amends 6fbeef4c6b

Fixes: QTBUG-86858
Change-Id: Ib15f50351a8742c44d7a8be84be4e576cb48bddb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-16 13:53:04 +02:00
Alexandru Croitor
ff33883fea CMake: Fix building examples targeting iOS simulator with qmake
The makefile generated by qmake when building an iOS example tries to
execute the mkspecs/features/uikit/devices.py python script to find
a simulator ID.

When installing the mkspecs, we didn't preserve the source file
permissions which means that the executable bit was stripped.

This causes the makefile to call xcodebuild with an invalid simulator
id due to not being able to execute the python script.

Make sure to install the mkspecs directories preserving the source
file permissions.

Fixes: QTBUG-87639
Change-Id: Iaa33b740c93187155025891104e8a21c6e7c98c8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-16 13:53:04 +02:00
Volker Hilsheimer
f772b8e48c Document (some) Qt6 changes for QtWidgets
Change-Id: I8185e7c4d46f77fa80ad351e1e73d53ca30201a6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-16 13:53:03 +02:00
Joerg Bornemann
4f75c24b3e CMake: Allow Debug-only iOS builds
They are disabled for the qmake build due to QTBUG-71990, but the issue
doesn't apply to the CMake build.

Task-number: QTBUG-71990
Change-Id: I6c659e9dbbc947fd3c6241f9fab2ea306c98020b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-16 13:53:03 +02:00
Volker Hilsheimer
1d49dad22c Fix warning, make sure temporary is moved into return value
Seen on clang 12; might be a compiler bug, but doesn't hurt
either.

Change-Id: I4aba8406c99951106e57fe9e61c688e649963cd6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-16 13:53:03 +02:00
Volker Hilsheimer
e2b3d42f94 Don't divide by zero when calculating number of items
Amends e74af68654.

If the model has children, then row 0 should have a non-zero size, but
it's not unthinkable that a delegate returns zero for size hint, so
protect against that case.

Task-number: QTBUG-87588
Pick-to: 5.15
Change-Id: Ia396f532d42ce5fad8757d629816c3cdc31d84ed
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Florian Bruhin <qt-project.org@the-compiler.org>
2020-10-16 13:53:03 +02:00
Volker Hilsheimer
0f1008a593 QAbstractItemView: don't lose items if model only allows MoveAction
If a model only allows MoveAction, then calls in the view/widget subclasses'
dropEvent implementation to set the event's drop action to CopyAction
will fail. QAbstractItemView will then remove the item when QDrag::exec
returns.

Instead of abusing the event actions for this, store explicitly that the
dropEvent implementation already moved the item. If the flag is set,
don't remove the item.

In QListView, which uses moveRow to move items in the dropEvent handler,
handle the case that the model might not implement moveRows. In that
case, or when dropping an item onto another item (to overwrite data),
fall back to the default implementation of QAbstractItemView. Sadly, it
is impossible to know whether a model doesn't implement moveRows, or
whether the move failed for other reasons, so this requires a bit of
extra special case handling. QListView in IconMode is particularly odd
in that it moves the item in the view, but not in the model.

This follows up on fd894fd68e and fixes
additional issues discovered during debugging. Extend the existing unit
test; since drag'n'drop runs a modal, native event loop on most systems,
it still only runs on the Xcb platform.

Change-Id: I6c5377e2b097c8080001afe904d6d3e4aed33df4
Pick-to: 5.15
Fixes: QTBUG-87057
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2020-10-16 13:53:03 +02:00
Volker Hilsheimer
faf7fd577f Fix warning in test: unused capture in lambda
Change-Id: Ifa9bab843feb670f8400c26fd78f96db55bfd79e
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: David Skoland <david.skoland@qt.io>
2020-10-16 13:53:03 +02:00
Giuseppe D'Angelo
aa442e9450 Q(E)SDP(V2): fill the API gap left by take()
take() returns a pointer to the shared data object *without*
decrementing the reference counter. The primary use case
is adopting the object from a Q(E)SDP into a different reference
counting mechanism. This is fine, but if we support the
"extraction" part, we shall also support the "adoption" part.
Also, the API for the shared data pointer classes should
match.

Add an adopting tag type and suitable constructors to the
shared data pointer classes, and add take() to the classes
lacking it.

Drive by, apply qExchange to take()'s implementation.

[ChangeLog][QtCore][QAdoptSharedDataTag] New class.
It is now possible to adopt pointers to shared data into
a QExplicitlySharedDataPointer or a QSharedDataPointer object
without incrementing the object's reference counter.

Change-Id: I62b8b005c1bfbe2add58566206fca27634bb7e70
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-16 13:53:03 +02:00
Ulf Hermann
7745b49b2d QMetaType: Silence float comparison warnings in QEqualityOperatorForType
We actually do want to invoke the original equality operator there. If
that is unsafe, we cannot do much about it at this point.

Change-Id: Iadb2eaba1156828d89022d282c41bda57b500b13
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-10-16 13:53:02 +02:00
Ulf Hermann
b3f3ebc2c0 Fix "variable set but unused" in qvariant.cpp
... how did that pass the CI?

Change-Id: I84baaf3632df0410d1fb25f24fd22f65daae13af
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-10-16 13:53:02 +02:00
Allan Sandfeld Jensen
382e3cb00f Add comparison operators to shared data pointers
To avoid they are compared as bools, or ambiguously.

Change-Id: I1495b3126a71c1379e72d4cf53b1a67590eb9f4b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-16 13:53:02 +02:00
Orgad Shaneh
8ff44b3aea pro2cmake: GitIgnore .pro2cmake_cache
Change-Id: Ia95c69860e6545d3c7cc59dc45d69b4f77cf794f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-16 14:53:02 +03:00
Orgad Shaneh
f0ab87bb43 pro2cmake: Ignore also initial comment
Change-Id: Id0b27c2a082f78c713e43c6ca846a4fff9ab7a8c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-16 14:53:02 +03:00