We generally need to guess value types since there are value types
without metaobjects of their own, such as QRectF and QSizeF. However, if
they have upper case element names, they are clearly not in that
category. Guessing those as value types will make further tools produce
follow-up mistakes.
Pick-to: 6.2 6.5 6.5.0
Fixes: QTBUG-111986
Change-Id: Ic15ef8c726eb3913c87eb4a300794f321f59fafa
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The current implementation of SelectedTapped allowed
the user to start editing when tapping on the _current_ cell.
This is not correct, SelectedTapped is supposed to (like
the name suggests) let the user start editing when tapping
on a _selected_ cell.
This patch will change the implementation so that
the user can tap on a selected cell to edit it.
Pick-to: 6.5
Change-Id: Ice5de9250c23f5f57e71077d4f46d1a3f31e9b80
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Update baseline control test qml file with construct that can reflect
dark and light mode changes.
Change-Id: Ib52ecacab66a449dda825804c15cb74cfb3dbaa0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Introducing a new name for the former QQuickPixmapReaderThreadObject:
ReaderThreadExecutionEnforcer, which describes its (sole) purpose, as
opposed to the former.
Added a thread affinity marker to check threading assumptions in
QQuickPixmapReaderThreadObject.
Also made an alias for the event ReaderThreadExecutionEnforcer sends
to trigger processJobs on the original reader on its thread.
Change-Id: I022374775eaa417f8568a7297b44b028db7ff0ee
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
If we get a verbatim type as input there, we can just use it.
Change-Id: If04c29c3756664718bf482a016f431cc5f26cee5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This allows us to do some more specialized lookups in QmlCompiler.
Change-Id: I7947c8e7bccfa57aee949b080a531a88fd47c8af
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The Qt 6 implementation of qmlobject_cast simply accessed the metaObject
of the object (canConvert -> QQmlMetaObject::QQmlMetaObject(QObject*)
-> QOject:metaObject). That would directly cause the creation of
dynamic meta-objects, if they weren't created so far.
Given that we still didn't get rid of the property-cache in QML, use it
to optimize this code path:
If the object has some associated QQmlData, retrieve it and check if we
have a property cache. If we do, retrieve the first C++ meta object
from it. We can safely ignore any dynamic meta-objects as T must be a
static meta-object. Then do the normal inheritance check with the first
C++ meta-object and T::staticMetaObject.
If we don't have a property cache, fall back to the previous
implementation (but without the QQmlMetaObject detour).
Change-Id: Ie23d1a3dac6bf343ee2bc31e04c4592681ad9995
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
If the component has an error or was clear()'d its CU will be null.
Since isBound() is a public method, it should take that into account
rather than just crash.
Pick-to: 6.5
Change-Id: I4a3e7417da3c87f6ce7dbb615f984815bc2b0b0b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Thus improving readability, as cancelled might be confused with a
cancellation flag.
Change-Id: Ib7b24e58458e138ca1f653d5342e3d00f01a0f96
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
While d2f895969938b0a80906e9a91553750bbcb717c9 in qtbase makes sure
that everything is reset on device loss, initializeWithRhi is only
called on next resize or hide/show, so we set deviceLost so it is
recreated on the next frame.
Change-Id: I70bcf753d26e2660fd0f86d8c7b37206100d59c9
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
roleNames are generally guaranteed to be stable (given that QAIM has no
change signal for them), except that resetting the model is allowed to
invalidate them. DelegateModel did so far not take this into account.
Handle this case correctly by snapshotting the current roleNames before
the model is reset. Afterwards, if we detect that roleNames has changed,
we throw the current model set up away and rebuild everything from
scratch – it is unlikely that a more efficient implementation would be
worth it.
If we detect no changes, we simply use the existing logic to handle the
model reset.
Note that some views, e.g. TableView do not use DelegateModel if they
detect that the model is a QAIM. They require a conceptually similar
fix (but can probaly implement this in a more efficient way).
Fixes: QTBUG-32132
Fixes: QTBUG-103220
Pick-to: 6.2 6.5
Change-Id: I6874988cf09b8fe75d2e9750d0bf209915554c45
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Pretty much all accessors const_cast themselves already in this case.
This requires us to eliminate the global static null accessors, but that
is a good thing anyway.
Also, drop some further unnecessary const_casts. release() is const.
Change-Id: I6cf6544bec67028dfbfb3b2008e84cd646638b60
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Otherwise, they tend to break the unity build. Since we are
compiling with "-Wattributes", and GCC doesn't warn about
unused variable, having the [[maybe_unused]] leads to an
error, and not having it fails the unity build with other
compilers. As a result, we need the condition to ignore
the flag, and set it again afterward.
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ia7662a0cfc01de7c9188d37449abdd91e6110fa1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
If geometry without an index buffer becomes a batch root, it should not
be merged with other geometry since an index buffer is required for a
merged batch.
This should not be very disruptive, as this can only occur under
very specific circumstances anyway (custom QSGGeometry used in a scene
in a particular order).
Fixes: QTBUG-97557
Pick-to: 6.5 6.4 6.2
Change-Id: I6b3845fb988a4bfe2a6f989801741246b8f4fb37
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The tst_scenegraph render tests were disabled for Android because they
were failing in CI. This appears to mostly be related to Android devices
having non-integer scaling factors, which causes issues with the render
test as it tests pixel color values derived from QML coordinates.
Most of these issues can be resolved by having the color sample function
round it's floating point values instead of implicitly flooring them
when they are converted to int values.
The render_bug37422 test was failing because the .qsb file was not
handled correctly as test data, so that was converted to use the new
syntax that builds the .qsb file at build time.
The render_OutOfFloatRange test still remains problematic by design on
system with non-integer scaling factors so is disabled when that is the
case.
Fixes: QTBUG-102589
Pick-to: 6.5
Change-Id: I3cae5c9700ef0d5acf2cce46518576de99717c99
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This fix changes the way the search component of UrlObjects is formatted
by passing the correct options to QUrl::query. Namely, the
EncodeDelimiters flag is no longer set. This now allows for correct
encoding of backslashes in search strings.
Amends 6cca731f3e.
Pick-to: 6.5
Task-number: QTBUG-111014
Change-Id: Iee544dfc7ad6ba374601c8ec4690d11bf07c9b6a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Thus improving readability, as the fields won't be confused with
actual methods.
Change-Id: I7ff390fffd97042180bc6d9321fb967569e67a93
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Transition to the QMutexLocker for a more fail-safe and idiomatic
approach to locking the mutex
Change-Id: I97cfb05e8bddfd4c67b14b1db6bc457eb8e6d4c9
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Guard the callers of the deprecated APIs with proper macros,
otherwise they will case compilation errors when deprecated APIs
from qtbase are disabled.
Pick-to: 6.5 6.4
Change-Id: Ie25e7424aaccf7175c839ecddbd326a7a5649709
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The current implementation would start a multi-selection when
holding down the Shift modifier. This is not correct. Holding
down Shift is normally done to extend an already active selection.
The correct way to do a multi-selection is to hold down Control.
Amends 52cbcd947d
Pick-to: 6.5
Change-Id: I5dbb7c88702266e8a396dd0bdcd4fb68ffbbb0c2
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
We cannot assume anything about the accumulator register after calling
PushCallContext::call(). Also add a note about not needing to re-load
the accumulator on ThrowException.
Pick-to: 6.5 6.2 5.15
Fixes: QTBUG-111935
Change-Id: I7196585e1d2697c215f4fe87d8d7ac9b98b622a3
Reviewed-by: <carl@carlschwan.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It's primarily an index into the property roles, which is a QList.
Change-Id: Ib3f0000166cae87d3ae0a69db971257e71a0f3e8
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
If threaded download is not used, we rely on async callbacks to drive
the download. We can also safely own the thread object since all
operations are executed on exactly one thread.
Fixes: QTBUG-111892
Change-Id: I17f927f383f7a3a28d26a128b3f9e7ce1dbfe8be
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Subclasses of QSGRenderContext are responsible for releasing the
resource tracked by the render context on invalidate. I'm not sure the
software context will ever have any other resources than QSGTextures,
but it doesn't hurt to try and release everything anyway.
Fixes: QTBUG-106968
Pick-to: 6.5 6.4 6.2
Change-Id: I58902e1a33c0d3d101e39af3e5f0a18d6820ce98
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Remove some #if 0 and commented code that was there since
the Qt 5.14 days of porting to QRhi. Given that nobody missed
it so far, it is unlikely to be relevant.
Fixes: QTBUG-86234
Change-Id: I12fed241395cef267f9a0fefcd5e25091cec2f4e
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
So far we did not completely restore aliases in inline components. This
was masked by the fact that until recently we failed to load inline
components from the disk cache and always loaded them from source
instead.
To fix this, refactor QQmlComponentAndAliasResolver to work for both,
QmlIR and QV4::CompiledData. With QmlIR, it populates the relevant data
structures. With QV4::CompiledData, it sanity-checks them. The
sanity-checks do incur some overhead, but given recent events, we
should err on the side of caution here.
Since QQmlComponentAndAliasResolver has received all the fixes we've
applied to make inline components work, this should lead to inline
components loaded from cache files to work the same way as those
compiled from source.
In turn, we can drop some methods of QQmlPropertyCacheAliasCreator.
Amends commit 131db085a7
Pick-to: 6.5
Fixes: QTBUG-111766
Fixes: QTBUG-111857
Change-Id: I9cc75e700a5fe5810a866e9aa930b9811368b1b4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Many of the inherited docs were inappropriate or insufficiently specific
to PointHandler. Now we have more snippets with more ideas for how it
can be used.
As a drive-by, fix a typo in the docs for
PointerDeviceHandler::acceptedPointerTypes and add a link to the new
PointerDevice page added in e283c05af7
Pick-to: 6.2 6.4 6.5 6.5.0
Fixes: QTBUG-74020
Fixes: QTBUG-106878
Change-Id: I028e1577ac5d4ef0b927c94259d6ab25b6028885
Reviewed-by: Doris Verria <doris.verria@qt.io>
...while also specifying 300 es in order to fix some of these shaders on
WebGL. If dynamic indexing is rejected in WebGL 1 and WebGL 2 with 100
es shaders, then the only option is to use 300 es shaders with WebGL 2.
Fixes: QTBUG-111227
Pick-to: 6.5
Change-Id: I506aa0a7aa6870b888c0f55ad97b99c3e26c31c0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Provides the NO_COMPILER_RUNTIME boolean option to
qt_generate_deploy_qml_app_script(), which forwards to
qt_deploy_runtime_dependencies().
On Windows, this option prevents the deployment of compiler runtimes.
[ChangeLog][CMake] Added the option NO_COMPILER_RUNTIME to
qt_generate_deploy_qml_app_script.
Task-number: QTBUG-111741
Pick-to: 6.5 6.5.0
Change-Id: Ic51fc5430e21b8c5aba201d4675a37c9c220a3f2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
It's mainly intended for QML use cases: both MouseArea and WheelHandler
have wheel(QQuickWheelEvent *) signals. But the QML compiler generates
C++, and other use cases are possible. For the signals to be useful in
C++, their arguments need to be exported. Besides, the other classes in
this file are exported the same way (for example
21b3b74c99e2ee8dedb711ba448066eb308979dc; some were made private in
83e820ba76).
QQuickWheelEvent was added in f2e1be963f
Pick-to: 6.5
Fixes: QTBUG-111230
Change-Id: I448aa633c7e7deb2e5f12e29bcb1c449be00a63d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
If we cannot properly adjust the types, the result will probably be
garbage and we should not try to generate any code. We are double
checking the actually received type in the code generator, but if we get
a different type at code generation time than we "ordered" at type
propagation time, that's not great. The type propagator should already
have checked that the types are convertible, after all.
Change-Id: I9c20dbd6b4cc8214e780dad9eb4302ca6ef81bac
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We want to communicate the input via the 'in' accumulator and the output
via the 'out' accumulator, not the other way around. It would be a nice
optimization to already read the input as the desired type, but since we
only do QMetaObject::cast() and the "optional" Qvariant conversion for
the "as" operation we cannot guarantee that the lhs can be read that way.
Change-Id: I994e06a02c742ff375cf2edfaaf989adba7d6e90
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Hopefully this reduces flakiness in CI, following the suggestion from
the error message:
Unable to use getContext() at this time, please wait for available: true
Pick-to: 6.2 6.5
Task-number: QTBUG-41043
Change-Id: I3710163cb197170e590f8fd7d188fa62f32ea649
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This variable, introduced in aabf219601,
allows to turn of the use of lookups in a few places. However, there is
no apparent need for doing so, and the commit message of the change that
introduced it does not give any reason for it.
As the variable is always false, and given that we run the lookup code
path by default since quite a while, simply remove it.
Change-Id: I62e00739a58fc748a1239087fa0374861ec73e64
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
JavaScript can coerce anything to bool, so should we.
Change-Id: Id560e4c1dc10b5432c0cedf3110ad3377bbc5f59
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We did not document it anywhere, the code is rather dated, and if we
want to promote QML as a scripting engine/an interpreter, we would need
to invest quite a bit more effort into a showcase.
Thus, remove the example for now.
Pick-to: 6.5
Task-number: QTBUG-110649
Change-Id: Ie23b26379e7ea72271d793a6928a3757cde2cb12
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
QQuickCalendarModelPrivate::getCount() was kludgey and wrong.
Rewrite it to use QCalendar::partsFromDate(), thereby bypassing repeat
calls to calendrical calculations, document what it's meant to be
doing and do that.
Fixes: QTBUG-111634
Pick-to: 6.5 6.4
Change-Id: I3bdf0233fc1b170eaeb1948ba74e93f636a29bd7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
- Fix all qmllint warnings.
(except for main.qml, interactive.qml, and sampling.qml)
- Translate user facing strings when it makes sense to do so.
- Mark readonly properties as 'readonly'.
- Avoid binding on multiple properties on a single line.
(except for tiger.qml).
Pick-to: 6.5
Change-Id: Idbf8a472ca5ba5385d1368aadd608e95231a07f0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>