The documentation should not recommend passing data via the context.
Rather, it should at least mention what a QQmlEngine actually is.
Change-Id: Iee4faba7bb4e3bbbe385474badcb9781688f7147
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
(cherry picked from commit 495cf09a03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit ee808db28c)
A more detailed look revealed some more places where the properties
were incorrectly accessed from the setters.
Use the usual (set)ValueBypassingBindings() approach to fix it.
The exceptions from the usual property handling are the setSize()
and setPosition() setters. The first one is documented to not
remove the binding, and the second one has a comment stating the
same. So, do not call removeBindingUnlessInWrapper() in these
setters.
This commit amends f85de75735
Task-number: QTBUG-117899
Change-Id: I97a94cbf2b38c57e9a260e54c9894c2ffd47271d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit e8c8ddeb94)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 6447671abe)
Add a note in qt_add_qml_module that qmltc requires private headers in
the ENABLE_TYPE_COMPILER section, and link to the part of the
documentation of qmltc that explains how to compile QML to C++ using
CMake.
Fixes: QTBUG-117451
Change-Id: Ie5e6e6c92a10ef4822e5a712bb31e06bdce6bf5e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit f9eabe862b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 412581aeba)
The extra check for hasOwnProperty() was wrong. It was originally meant
for qmllint to find initial assignments to the same property but qmllint
has a different way of identifying those these days.
Amends commit d2507f2383.
Fixes: QTBUG-118100
Change-Id: I6151b8088315b6a99e331b0830b9fdd8188a30cb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit 53b9c17749)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 557db3f1c0)
We don't want to promote manual event processing. Simply state that the
initialization and polling should happen in different places and time
should pass between them.
Furthermore, mention the pre-created incubation controllers that are
usually good enough for most people. Don't shine such a negative light
on the incubation controller snippet. It's good to have a simple example
you can immediately understand.
Fixes: QTBUG-116804
Change-Id: I496426e18147ce19d08ca1cd0945c99f4ff1e2ad
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 589d0fa5de)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 56ec9ac868)
We don't want people to use context properties. Warn about their effects
and offer singletons and object properties as alternatives.
Also, suggest object properties instead of context properties in the
page about exposing C++ attributes.
Fixes: QTBUG-113785
Change-Id: Id3fb6c7f26383838baeef2e696f8b1848b4e6fc6
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 2050db81ca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit fdf9c258af)
For singletons, we can't rely on the static meta-object of the
registered type, as the create function used for a singleton might
return an instance of a derived type instead.
This could lead to crashes or method-overload resolution failures later
on.
Fix this by always querying the actual meta-object of the singleton,
instead of relying on the meta-object of the registered class.
Leave a comment about the fact that we still have an issue if you have a
derived instance of the registered type when you additionally extend the
type. However, that is pre-existing (given that it only affects QQmlType
itself).
Fixes: QTBUG-117891
Pick-to: 6.2
Change-Id: Ie12b4c886ace5cc58a5ded59fa48bc425ae58419
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 8c2ea501fd)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit a8ab23b677)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Turns out that there is a 'real' same game example in qtdoc, so no
need to list this tutorial page.
While at it, also remove the entry for 'QtQuick/Qt Quick Demo - Same Game'
from manifestmeta. Since the example got renamed and moved to qtdoc,
this didn't have any impact anymore.
Task-number: QTBUG-117207
Change-Id: I35d8e1024e58619dc65060a41091021246546885
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
(cherry picked from commit 2a93472d8e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 0ad60587ca)
We can't rely on the checksum verification, as we still assume that we
can read all bytes in the range claimed by the unit's header.
If for some reason the cache file has been truncated, that will lead to
crashes due to out-of-bound reads.
As we already store the unit's size in the header, use it for an initial
verification before doing any further work.
Initial test case was provided by Harald Sitter <sitter@kde.org>.
Pick-to: 6.2 5.15
Fixes: QTBUG-117130
Change-Id: Idd20191ed0e0ef9c37985c4c64124578f0607ad3
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 7a3db863f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b47065e311)
loadFromModule requires that we can actually find the module. Link to
the immport path documentation to guide users in the right direction.
Task-number: QTBUG-117806
Change-Id: I322bf9811b0a493096d11f59effcbf793f67f08f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit f77c59459b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e1fbca3d73)
Seems that on some cases updateEffectShaders() can be reached before
m_shaderEffect exists. So check this.
Task-number: QTBUG-117830
Change-Id: I55aff305eefa6150275032e859728bf62fdbeb28
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
(cherry picked from commit 0bdb7b2a41)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit cfdf76be4a)
When the ProgressBar is indeterminate a NumberAnimation runs and
animates the x value of the track. This presents a problem when the
ProgressBar changes from indeterminate to determinate, causing the x
value of the determinate track to start at the last location
the animation stopped.
Since we don't want to use any JS expressions in our templates, fix
this by having a separate track (progress) image for the
indeterminate state and have that be the animation target, instead
of reusing the same element for both states.
Change-Id: I85b338b59ea662c2d6e0afff8fbfeeb381beab19
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 68ad21c130)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 7e15dc55b6)
Otherwise we get a conversion to unknown and that is bad.
Fixes: QTBUG-117361
Change-Id: Iead1ddd21b692ed9fb9923dccdfa5bd01dc9d467
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Nicolas Fella <nicolas.fella@kdab.com>
(cherry picked from commit d0c7f46b40)
(cherry picked from commit d5ab133e2e)
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Before calling pthread_attr_get_np(), as opposed to
pthread_getattr_np(), we do need to call pthread_attr_init(). Both the
FreeBSD and the NetBSD manpages tell us to do so.
Amends commit 9f4aeeabb9.
Fixes: QTBUG-117513
Change-Id: Ic851ba2ffcf13d268b3a53d926cb92f7bed7a3d9
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 54059d0dff)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit fff3ee966a)
It needs to mention that Immediate is used for these operations if the
stack is empty.
Task-number: QTBUG-117700
Pick-to: 6.2
Change-Id: I4598e8662e6e9cf5fb62ce623d08075be992ceb3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 6d0e545d75)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 22b3c95335)
When searching for a member of a scope, we now first search the starting
scope and its base and extension scopes for QML properties and methods.
Then, if the member has not been found yet, we search for a JS
identifier in the part of the scope hierarchy that are JS scopes.
This change fixes an issue in qmllint where it would warn of functions
not being found when they were, in fact, being called and thus found at
runtime. For example, an object with an invokable function 'print'
would generate a warning that the function could not be found because
it was being confused with the global function print, interupting the
search. The latter was later discarded as a valid result for the search
thus leading to the warning that no function was found.
Fixes: QTBUG-117077
Change-Id: I9899cefe452ed33b7f7f9b3cbceb1f5a5e080269
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 42daf58747)
(cherry picked from commit 0a83908810)
When creating qqml object, all pending bindings are installed and run
once to determine their dependencies. If they do not have any, they
cannot change and are therefore removed.
A missing check for the ref count of the binding after it was set lead
to a use-after-free. A check was added to determine if the binding has
enough remaining references to be used.
Pick-to: 6.2
Fixes: QTBUG-117642
Change-Id: Ida94d46d6f482a5294b19c41578e592b42906634
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 1786f6c183)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit fe856f7691)
When using QQuickDeferredPointer for deferred properties in Qt Quick
Controls, it is necessary to also implement the itemDestroyed virtual
method because if the item pointed gets deleted the
QQuickDeferredPointer reference will be a dangling pointer when cleanup
occurs in the destructor. This patch is following the pattern laid out
by QQuickControlsPrivate for handling its QQuickDeferredPointer members.
This bug is exposed when aborting a component incubation for types that
did not do this cleanup in the form of a segfault in the destructor of
the offending class.
Fixes: QTBUG-116828
Change-Id: I6a486de74ee38ccdcaff6a31195ee389f51fc93c
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 4e41739c58)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d733885962)
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
For simplicity, whenever we mention debug-and-release in this commit
message, we mean the more general concept of "multi-configuration build
with a debug configuration".
When deploying a QtQuick application that was built against a
debug-and-release Qt (like the Windows one that comes with the
installer), we copied both builds of a QML plugin to the installation
directory.
Now, when we've detected that the used Qt is a debug-and-release build,
we match exactly against the debug suffix if our application is a debug
build, or the absence of the debug suffix if our application is a
release build.
For non-debug-and-release Qt builds we leniently match against any debug
suffix, including the empty one, as before.
Fixes: QTBUG-109444
Change-Id: I0d02cce2be871286fa6e9bac521d692e96c1bbf0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 854ee1c03c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d0513abe1f)
If we neglect this we get an assert further down the line.
Amends commit a824a6f060.
Change-Id: Ib8fd01d329d5b45b27dfe117e168860c6a1d267f
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 9c8d76b6ce)
(cherry picked from commit c82d1eed17)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Cumulative commit that includes bugfixes for object destructuring
and elements with rest operator. These weren't picked to 6.5 before
because some ground work was required (i.e MethodParameter was missing
value field and some fixes in parsing grammer file).
This includes some ground work and picking of the following commits.
-- 2a2eee5f0d,
-- 7c3199311f,
-- 065aeb26d014027210ea240b0327b96fff9af060
Fixes: QTBUG-116153
Change-Id: I3c60f3785aff18a1d627a425a86064b3ffa908a9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The problem was that the table view resize handler accepted scroll
events but did nothing with them. The fix is to simply not accept
these events.
Pick-to: 6.2
Fixes: QTBUG-116566
Change-Id: Ica4afc45908e1b4c0b8aac11a3798981b6250baf
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 38b9d70cb9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit e040503743)
When a subclass that has a proxy model is in use, it's not given
if the selection model should be using the application model
or the proxy model to store selections. Rather, this is subclass
specific. In case of TreeView, the application model should
be used. In case of HeaderView, the proxy model should be
used. Until now, we always used the application model, which
would fail if trying to select cells in HeaderView. The reason
for the latter is that the proxy model in HeaderView doesn't
share any common model items with the application model, and
therefore cannot use the application model for selections.
Fixes: QTBUG-115227
Pick-to: 6.2
Change-Id: I39f0687e0396392039234787fda0df6d7d4d7da4
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 82d0d8321a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 17f5777e63)
The delegate component in DelegatePage.qml uses properties from
the context where loader exists. This behavior of Loader seems to
be changed and it doesn't forward properties. Thus, property
reference through required properties doesn't work in the component
that's getting loaded, with ComponentBehavior configured as Bound.
This patch makes a workaround by moving the component within Loader
scope and access model properties through its id.
Fixes: QTBUG-117062
Change-Id: Ib1f21f842f9926a426fb79f2fbb2536ed53f98d8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 3c633dc1e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 88ae82c0f2)
The \generate list names are added for each categorized section with
some explanation. Here, calling the overviews as
explanations-(name of the section). The idea is to give general terms
instead of specific phrases like 'core' etc, for better understanding.
Task-number: QTBUG-115347
Change-Id: I0e0aeb37dc4a59e6a18e3ba20727765f33a02eed
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 7518610015)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 9ef1c24b63)
QHeaderDataProxyModel did not implement roleNames(), so
QAbstractItemModel::roleNames was being used. That function returns
the default role names, ignoring any custom ones.
Fixes: QTBUG-116748
Change-Id: Iff7e0d7c71c60da7ace54aee5857605e8bea8d0c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 1fe24b6658)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 2eeccf8909)
Use {set}ValueBypassingBinding() to read and write the value of the
property.
Use valueBypassingBinding() to get the values of other realted
properties before calling geometryChanged().
The tests for these bindable properties already exist. They will detect
the binding loops as soon as the related qtbase patch is merged.
Fixes: QTBUG-116540
Change-Id: Ifb6caac2d5176fa6985a170fcdfe0dceeac10936
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
(cherry picked from commit f85de75735)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit b3b9987ebd)
The texteditor example does this since it's a full-screen editor.
Currently that example produces a warning. It also doesn't cost us much
to support it.
Amends 2d99c70f98.
Change-Id: I8fb847297add3ab10f4ee5e6b5634ac841bfd4e6
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
(cherry picked from commit a159d87cb9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 88e8ef3b26)
Remove useless arg#0 bindingIdentifier from FormalParameterList. They
are used nowhere, are not tested and are not even set correctly:
FormalParameterList::finish() sets next to nullptr before its forloop
that goes from this to this->next (that was freshly set to nullptr three
lines above)...
Instead of setting bindingIdentifier to arg#0 when its empty and testing
for arg#, just test for bindingIdentifier being empty. That saves some
trouble in qmlformat because you dont have to care about the position
that the current method parameter has.
Apropos position of the current parameter: qmlformat needs some context
when doing its reformatting test, to avoid reparsing code in completely
wrong contexts. Add missing preCode and postCode to MethodParameter to
provide an artificial context for qmlformat, so it knows that it is
working on a MethodParameter, and also teach qmlformat how to
get the FormalParameter out of the artificial context, by extracting it
from the FormalParameterList.
Change-Id: I2bc82f65d95c3cd09ad846c60dd7561ac03efad3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
(cherry picked from commit 640ff3d812)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 03bd497190)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>