This makes the code clearer than just passing true or false everywhere.
Change-Id: I975c69080681db4ee7e9cc3b8a5509ef118348cd
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
When imperatively assigning a contentItem, we need to make sure that
we respect the policy of the scroll bars, otherwise they could end up
visible when they shouldn't be, and vice versa.
This patch also sets the ScrollView as the parent item of the
contentItem, as a ListView assigned imperatively may already have a
parent item, and so setContentItem_helper will not set one.
When setting the parent item, we also need to ensure that the
stacking order is correct, otherwise the scroll bars will be
behind the contentItem and can't be interacted with.
Task-number: QTBUG-106118
Pick-to: 6.2 6.5
Change-Id: I88d342282ea6d202cbe0f776a6bf4fb1f9cadc48
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
A pointer type can hold bool as either nullptr or some value. We don't
need to produce a QVariant for that.
Change-Id: I368c3fa703d08ff396a5b4702ba7d1f2614b1467
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
https://xhr.spec.whatwg.org/#the-responseurl-attribute
the attribute was introduced around 2014.
[ChangeLog][Qml][XMLHttpRequest] Added missing responseURL property. This returns the url that was used to retrieve the response data, after any redirects have occurred.
Change-Id: Ice70520913bb306885a10dfd7a3a89da31bcfdeb
Task-number: QTBUG-111217
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
On macOS we always subscribe to hover events in the constructor so
that we can enable touch event handling when the mouse enters the
area. However, a disabled item should not accept hover events, so
we also need to override itemChange so that hover-acceptance is
flipped based on the enabled state.
Items should also never accept hover events, they should always
propagate. As the events are accepted by default and ignored in the
default event handler implementation in QQuickItem, we need to
ignore explicitly when we override. Do that by calling the parent
class implementation explicitly.
A disabled MultiPointTouchArea should also not subscribe to touch
events, even when the mouse enters.
Fixes: QTBUG-107037
Pick-to: 6.5
Change-Id: Ifa57cb2af4fbf11a0c8eacde87d80e60afa3f895
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Lazy loading of stack layout causes incorrect index value in the
attached property for the child items. This is because,
attachedProperties are created and updated for the child object, after
being added to the stack layout.
This patchset triggers childItemsChanged() to reset child objects of
stack layout with right index value.
Fixes: QTBUG-111902
Pick-to: 6.4 6.5
Change-Id: Iad06d028d0f977189b5da1122904dc754060a609
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Qt::TouchPointState is not the actual type here, and we should not
encourage e.g. making a comparison between eventPoint.state and
Qt.TouchPointMoved in an onGrabChanged handler. The equivalence is
an internal detail; and eventPoint can come from any pointing device,
not only from a touchscreen.
QEventPoint is a Q_GADGET; we keep the registration to expose it as a
value type (eventPoint). But such types cannot be created in QML, and we
also need to give it an uppercase name to scope the enum values that it
declares: that's a new foreign namespace called EventPoint. So it's
possible to compare an eventPoint instance's state property against
EventPoint.Pressed, and so on.
Also show complete QML syntax in the \value tables where
PointerDevice::GrabTransition is emitted to QML, namely
PointerDevice::grabChanged and PointerHandler::grabChanged.
Amends b43a873264
Task-number: QTBUG-102160
Change-Id: If1a97f21d8e005e3692298b8512f7f8b56a92c97
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Moving the QT_END_NAMESPACE before the #endif of the include guard.
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ia6b17c8c5b54840b84629b58e35f530dd09433d4
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Classes like QQuickAnchorSetPrivate have multiple script string
properties, most of them being unused. Avoid allocating memory
in that case by simply letting the d pointer be null, and
adding null-checks in the various accessor methods.
Change-Id: I4b7a1298c4a5892028174b82c3a92ccd93bdf65e
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Since Page control is supposed to be a derivate of Pane it should
support Material.elevation too
Change-Id: I05ad88d1fa9756456ac1672e40551200622bf120
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Split QmlDomAstCreator into an implementation and a header and rename it
to QQmlDomAstCreator.
Task-number: QTBUG-92876
Change-Id: I52a082d44f37e4fb111a5ca3e60704a02814d0d9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Cumulative commit for adding zero-length comments in qmljsengine and
also handling of empty lines after comments.
qmljsengine only adds comments if the relavant comment length is larger
than 0. Allow adding zero length comments since empty comments might be
useful and required in some situations.
Unlike the other formatting tools (clang-format, rustfmt) qmlformat
didnt respect the emptylines after comments and stick the comments to
the associated element. Change this behavior such that a newline/
blankline is added(but no more than one).
A few tests in qmldom/reformatter needed to be edited due to this new
behavior.
Pick-to: 6.5
Fixes: QTBUG-111231
Change-Id: I2fcdda0bfe569b7a1d19c4058e1604cb0d73291d
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
The current header and descriptions seem to have been copied from the
above Material.roundedScale section, but they don't make sense for the
Material.containerStyle section.
Fixes: QTBUG-112672
Pick-to: 6.5
Change-Id: I6ffb9d30cf4ff7a1d0a72888f804d1d92da1ecb2
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Even if compiled with QT_CONFIG(clipboard), a functional clipboard
might not be available on XCB (e.g. due to restrictions on CI VMs).
This patch adds an explicit test for XCB to platformquirks_p.h.
It skips the test functions canPaste() and canPasteEmpty().
As a drive-by it constifies local variables in canPaste() and
middleClickPaste() and unifies the skip message.
It also removes the BLACKLIST entries for clipboard-related tests on
opensuse.
Fixes: QTBUG-95940
Pick-to: 6.5
Change-Id: If6da9b589e98c1f63435f3d444567ce310ddee8a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Add a static_assert that prints a more understandable error
message when invalid types are added to the ElementT-variant.
Without this assert, compilation fails in mostly unrelated
std::visit()-calls.
Change-Id: Idef6b471c6d2d26d91b71350bb4577d012a40860
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Rewrite a comment such that it is readable again (I think it got messed
around by clang-format), add a using declaration for filter-function in
DomItem and some white space changes by clang-format.
Change-Id: I8964b4e2b08ee4fb972bc4eac572ba6c7050dcc5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Add a flag that allows to construct the Dom with the QQmlJSScopes
obtained by semantic analysis.
Added a new AST visitor called QQmlDomAstCreatorWithQQmlJSScope.
This visitor synchronizes the qqmldomastcreator and the qqmljsimportvisitor
to construct the Dom and the QQmlJSScope from the AST at the same time.
It mainly does keeping track which subvisitor (dom creator or scope creator)
is active, as one subvisitor may visit AST nodes that the other does not.
Using both visitors at the same time allows to insert the newly-generated
QQmlJSScope::Ptr directly into the correct Dom structure.
The actual implementation of QQmlDomAstCreatorWithQQmlJSScope is in its
visitT and endVisitT methods. Both are called in the AST-visitor-overloads.
Added a benchmark on two big generated qml files to see how fast/slow
does the qqmljsccope semantic analysis runs, compared to the QmlDom
creation runtime.
Task-number: QTBUG-92876
Change-Id: Ia05b6fdd59a637fef9c14b6ab284f4550414f908
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Use the X-Macro to simplify the AST-Visitor and BaseVisitor definitions.
Task-number: QTBUG-92876
Change-Id: I8f20490ae551a27a50cd037eb705baac3673eba5
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Remove the forward declarations of TypeArgument(List) and its uses.
This amends e89a06753c that removed
TypeArgument(List)'s definition while leaving its forward declarations
and uses around.
Change-Id: I1a3e27ce18611beaf84b7c59e01a622f9e7f2477
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Add a struct that helps overloading multiple lambdas to help write
short visitors.
Put it in a new private header qqmldom_utils_p.h.
Task-number: QTBUG-92876
Change-Id: I6b830c4760550f9d4392edd8f3b156d9c8a2a686
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Just like we do for workerscript plugin, in a project that uses a
static Qt without using qmlimportscanner, linking to the qmlplugin
automatically initialize the QmlMeta plugin as well.
Otherwise the application errors out with:
module "QtQuick" version 6.6 cannot be imported because:
module "QtQml" plugin "qmlmetaplugin" not found
import QtQuick
Pick-to: 6.5
Fixes: QTBUG-112712
Change-Id: I566eaf94e2a13a8d8bb7b5509af1594c6c3206e9
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
The FileSystemModule qmldir was explicitly put into the "/" resource
prefix, but that prefix is not a default qml import path. That caused
the qml module not to be found when building on macOS as an app
bundle, which relies only on resources and not the file system to find
the module.
To ensure the module qmldir is found in the resources, we want it to
be placed in the default qml import path ':/qt/qml'. To do that,
remove the previously specified RESOURCE_PREFIX option and enable
the QTP0001 policy by requiring Qt 6.5+, which will put the module
qmldir into :/qt/qml/FileSystemModule/qmldir.
Because the policy also changes the resource prefix for other
resources (images), adjust all Image source urls to be relative paths
(relative to the component), instead of absolute paths.
Also adjust the qmake generated qrc file to place the files into the
new resource prefix.
Amends 213e932e13
Fixes: QTBUG-112683
Change-Id: I5205cf6d399a6faaf7cce68d55c71dade37479a7
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
The test mostly passes in the emulator and has generally no reason to
fail in CI. Test functions that should be blacklisted can be added to
BLACKLIST file, or QSKIP'ed if they crash, which none of them do.
Blacklist the test_save function, which fails on Android as we don't
have permission to write to the file system.
Fixes: QTBUG-103257
Task-number: QTBUG-41043
Pick-to: 6.5
Change-Id: I5ef99a01dc26d9290be91675a5ff15e4de59e812
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
TapHandler does not emit any singleTapped or doubleTapped signals after
emitting it once, if exclusiveSignals is set to `SingleTap | DoubleTap`.
This change corrects the behavior by resetting m_tapCount properly.
Fixes: QTBUG-111800
Pick-to: 6.5
Change-Id: Ice7af2f41c2f30448004033d8330e733abe44110
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Since we do not want persistentTranslation to be always the same as
target.position, clearly we cannot use xAxis/yAxis to store the initial
target position: thus the startPos() function was wrong, and is now
removed. We need to store it in a separate m_startTargetPos variable
like DragHandler does, and as PinchHandler did before
7867a683fc.
Add an internal doc comment to clarify the arguments to
QQuickItemPrivate::adjustedPosForTransform().
tst_QQuickPinchHandler::cumulativeNativeGestures() now checks the result
of adjustedPosForTransform(): how far the target item moved.
Pick-to: 6.5
Fixes: QTBUG-111220
Change-Id: I04237cb82a1abaaeab873a0d887acaf322f262ce
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
TableView uses QQuickTapHandler internally to handle tap events. This
handler accepts tap events considering pointerNavigationEnabled property
of table view. TableView accepts mouse events if either 'interactive'
or 'pointerNavigationEnabled' property is set as true, otherwise, it
has to pass mouse or touch events to the below item.
This patch introduces QQuickTableViewTapHandler inherited from
QQuickTapHandler that can explicitly check pointerNavigationEnabled
property of QQuickTableView during wantsEventPoint to either accept
or ignore tap events.
Fixes: QTBUG-108596
Pick-to: 6.4 6.5
Change-Id: I330ae319706b6dbadc3a7319f62d636708aab995
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The '\meta category' command was used for tagging examples with a
specific category, used in Qt Creators Welcome mode.
As we want to also generate lists of examples belonging to a category
elsewhere in the documentation, replace the command with a macro that
expands to the original \meta command and also adds the example to
a group using the \ingroup command. This way, the category names can
be used as arguments to the \generatelist or \annotatedlist commands.
Pick-to: 6.5
Task-number: QTBUG-112731
Change-Id: I673207be9dd73a010069828b92146c37e45e9143
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Replace foreach with ranged-for and brace-initialize lists.
Pick-to: 6.5
Change-Id: Ieccebcf953d36ffa1dcaf0a1eebef21f2e9074a4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The test has no business failing on macos-12 when it passes on macos-11
and macos-13. The test does depend on screen grabbing, which might
have been temporarily resulted in flakiness due to a system dialog or
similar disturbance.
Fixes: QTBUG-98402
Pick-to: 6.5
Change-Id: I5fe548ec63e3ad6639a290cd83a96cfabdf4fb4b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The subFocusItem state was forgotten because the old parent was deleted,
before its focused child was reparented.
The test doesn't pass on Android and makes the test process exit with
error. Since it prints warnings that indicate issues further down in
the RHI stack, we'll skip it for now on that platform.
Task-number: QTBUG-112696
Pick-to: 6.5 6.2
Change-Id: Ibb32a11564ff6fbb2091c241d508f12479b234b0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
A subtitle is not a section
Pick-to: 6.5
Change-Id: I870df8d9a69f3a9975cc8c64c213dfaf58105523
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
When attempting to set two behaviors on the same property, the second
behavior's target property gets intercepted by the first behavior. Then,
meta type for UntypedProxyPropertyBindable in UntypedProxyProperty's ctor
will not be discovered correctly, since UntypedProxyPropertyBindable
interface's metaType is explicitly set to nullptr. Use
QUntypedBindable::metaType instead to access MetaTypeAccessorFlag
via iface->getter.
A warning shall also be reported in case two or more interceptors are
set on the same property.
Fixes: QTBUG-98896
Change-Id: Ie38ae75235e000e25a60a1c2ccaad70a46f5018e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The current snippet does not provide all the methods that are available
to customize the setup and teardown of the test. This patch adds the
two other methods that are called in the implementation.
Pick-to: 6.5
Change-Id: Icfd298c9b987bd2a3fc6d05e588ae0962ea8ceff
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
"expectedText" is not defined in the files below
- redirects.qml
- redirectError.qml
- redirectRecur.qml
Change-Id: Ib07f72fc902b90286ec709399216be7b2fce392a
Pick-to: 6.5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Pane should support Material.roundedScale property too
to create a nice Material 3 interface in an easy way.
Task-number: QTBUG-97993
Pick-to: 6.5
Change-Id: I9f30104c7a006129b07e56427e331bca26f83e06
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
AUTO_RESOURCE_PREFIX is deprecated, and we should start using our CMake
policies instead.
Pick-to: 6.5
Change-Id: Ic0b317929a2d9b9297d113f4382e895d63673e1d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This was missed earlier as part of the changes that went in to 6.5.
As it affects redirects, it's important that it goes in to the next
patch release.
Task-number: QTBUG-95413
Pick-to: 6.5
Change-Id: If1da80424687bceb345ef1b19047c1acc4e1a9dc
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>