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>
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>
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>
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>
Avoid creating a a d pointer for recursive mutexes.
Change-Id: I28af15a416ee17de346e2ea5b1442279d9d3e159
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
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>
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>
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>
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>
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>
QEventPoints are equal when all data values are equal, the
refcount is ignored.
Change-Id: I6ef70faf0b12129eaa22bfc1f0a45bab2422d421
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
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>
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>
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>
Tests the move semantics of QImage in Qt6.
Change-Id: Ia4d95f0b88ca7dde0daf85a0f53049b42b5be1a5
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
To avoid they are compared as bools, or ambiguously.
Change-Id: I1495b3126a71c1379e72d4cf53b1a67590eb9f4b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
qfuturewatcher.h includes qfuture.h, which includes EnableForNonVoid
through qfuture_impl.h header. Thus, there is never a need to keep
the same alias in QFutureWatcher as it always can use one from QFuture
Change-Id: I293fd087aea1a21ef5bcfdf50cdefc176a9703d0
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Accidentally found out that we enable/disable QPromise::addResult based
on type deduced from input argument, instead of using "value_type" of
QPromise itself, which is wrong
Simplified the checks to a single one -
EnableIfSameOrConvertible<InputType, StoredType> as this is sufficient
to account for both cases: QPromise<void> and QPromise<T> with input,
convertible to T
Change-Id: I657998c0e26241b0fc5e70988622984ece8871df
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Proposed during API review
Change-Id: I9c43e1915c50803ab69bfe07a91c05d2224b86c4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Changed QPromise::addResult() to return bool value. True is returned
when result is added and false is returned when e.g. promise is in final
state (canceled or finished) or when addResult() is called twice with
the same index as argument (in which case new value is rejected)
Updated QFutureInterface::reportFinished() that accepts optional result
as argument to align with other result adding methods. This function
is "internal" only (as of now), so no documentation update is needed
Change-Id: I2d63069246e5e5c8cf04529c22bb296faaaae53d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
...and provide our dummy typedefs when vulkan.h is not available.
Originally this was there for qdoc, but from the qtdeclarative API
review it becomes clear that we need this also when an application
- that includes Qt Quick headers which in turn want to use VkImage
and co. for type safety - is built on a system without vulkan.h
against a Vulkan-enabled Qt build.
Also fix some of the typedefs which were technically incorrect. (not
that it matters much since the dummy typedefs still do not allow
calling exported Qt functions that use the real Vk* types since the
function signatures like won't match in some cases (would need to
replicate too much hocus pocus from vulkan.h for that), but that's fine
since our goal here is to keep application compilation going when it
encounters a Vk* type in a Qt header, not about enabling actually
calling those functions)
Task-number: QTBUG-87450
Change-Id: I855b4478c8707587b28db2408e282145129a0194
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Avoid detaching where possible
Change-Id: I438d3e66689aeef05951af86a48af2a6910da7c2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Feedback on the API review. Make sure, qMin<true, 'a'> and similar
constructs don't compile.
Change-Id: I59a66348a4168fe306159ddaf2595838d4ed66d1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We don't need two overloads here.
Change-Id: Ia6a3bcd93491843e07b0295fefe8da42ae9d6519
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Trading typing in a few lines of straightforward code for a full
sizeof(QRhiShaderResourceBinding::Data) copy (with less fortunate
compilers that do not manage to optimize it away) is a bad deal.
Change-Id: If227320f8a9598508c1fe02c4f56e6d75f0a787b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>