QColor can take QStringView, and QStringView has a toInt function
Pick-to: 6.3 6.2
Change-Id: I2388f7fd329e817e45210fadbd8a2a3ab559707a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Replace deprecated QString::count with QString::size or QString::length,
depending on context, and use qsizetype instead of int.
Pick-to: 6.3
Change-Id: Ie4c08abd2cf2ba771c23e8def72756170cc07af7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
We can almost always use QQmlPropertyCache::ConstPtr. The property cache
creator needs mutable property caches for a while, but it can seal them
when done. The designer integration does ugly stuff, but that should be
limited to a specific environment. And the QQmlOpenMetaObject is rather
wrong (again). This needs to be addresses in a later change.
Task-number: QTBUG-73271
Change-Id: I1c31fd5936c745029d25b909c30b8d14a30f25d3
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The mutex had no function I can discern as the class is not thread safe
in any way, and isn't used from multiple threads anywhere. Extra event
loops are famously brittle. We don't have to use an extra event loop
here. QTest::qWaitFor will do just fine.
Task-number: QTBUG-101678
Change-Id: If25a961312a1eeb725ff779e386b2657e0f23dd1
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The test works fine with the window hidden. Trying to show it gives
problems in the CI. We also want to avoid showing windows in non-GUI
tests as far as possible.
Fixes: QTBUG-101738
Pick-to: 6.2 6.3
Change-Id: I206f74f940e6ba7ac6346c85459b896387ab85a5
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Having QMetaType::fromName() normalize at run time is wasteful.
Pick-to: 6.3
Change-Id: I128b873bbea9acc1ad3360986220b6d81a37cbab
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
As we need to support more enum options for the second
argument to positionViewAtCell() (like "Visible" and
"Contain"), using Qt::Alignment alone is no longer enough.
This patch will therefore follow the same API as in ListView and
GridView, and switch to use PositionMode. The enum values
will however differ from ListView::PositionMode, since values like
"beginning" and "end" are not applicable to a two dimensional
table view.
To support backwards compatibility when used from QML, the
values will match the values in Qt::Alignment. So e.g
Qt.AlignLeft can be used instead of TableView.AlignLeft.
Since QQuickTableView is a private class, the same concerns are
not relevant for the c++ API.
[ChangeLog][QtQuick][TableView] The function positionViewAtCell()
now takes TableView.PositionMode instead of Qt.Alignment as the
second argument. For backwards compatibility, Qt.Alignment can
still be used.
Change-Id: Ib99262035ef43186d911c2fc2e0420205adbbf84
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
qmlformat would crash with an error complaining about an AST
change when a trailing comma appeared in an array as follows:
arr = [1,2,3,].
This is resolved preserving the trailing comma by passing the
commaToken from the parsed AST back out when rewriting the
newly formatted QML.
Fixes: QTBUG-99449
Change-Id: Id77bda83dca519a3745020aaa2677314a9036e0e
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
On Android when a file is selected using the default file manager,
the selected file is reported using the url with "content" scheme. This
url does not use file suffixes.
Before this patch, if the FileDialog had a defaultSuffix specified, that
suffix was added to the returned content url, and as a result the file
could not be found.
This problem exists FileDialog from both QtQuick.Dialogs and
Qt.labs.platforms, so this patch implements the similar fix in both of
them.
Fixes: QTBUG-94391
Pick-to: 6.3 6.2
Change-Id: Ic6ba95e301857d9b72ee6f5ddb819b9aae9e66e3
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
When QQuickShortcutContext::matcher is checking who should get a
shortcut, it starts with the object that registered the shortcut and
climbs up its parent hierarchy until it finds a window. Sub-menus,
unlike top-level menus, will not have an associated window until their
parent menu is opened. So, check if the popup is a sub-menu so that
actions within it can grab shortcuts.
Change-Id: I07172b1038af1e9fffd9983f7bf0a155b11bb1c3
Fixes: QTBUG-101034
Pick-to: 6.2 6.3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Check that this kind of signal is also accessible in the "extended"
QML type.
Change-Id: I81ba60c23dc96723a97f1b3df5b0a6c46dba77ba
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Use the new global include snippets for the 'Using the Module' section.
Also, clean up some of the lists to make them more readable and
reorganize the sections structure.
Task-number: QTBUG-100369
Pick-to: 6.3
Change-Id: I7f6efe516051f94ba9e5f0118cd8cb0992d46060
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Use new global include snippets for the 'Using the Module' section.
Also, reorganize some of the sections structure.
Task-number: QTBUG-100369
Pick-to: 6.3
Change-Id: I287b1294576fef0ebe62c13e357ba9db07e0c5cb
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Use new global include snippets for the 'Using the Module' section and
reorganize some of the sections structure.
Task-number: QTBUG-100369
Pick-to: 6.3
Change-Id: I4fe023c3c05747d79e5baa12c466a7c246d22e8a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Use global include snippets for 'Using the Module' and reorganize some
of the sections structure.
Task-number: QTBUG-100369
Pick-to: 6.3
Change-Id: I3c641c38389f821f63ba5eba086d5b090f739e97
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Bridge the gap between QmlIR binding order and QQmlJSScope binding order
by storing property bindings as an array, in addition to storing them
in a QMultiHash. As a matter of fact, we don't need to store bindings,
just property name + source location offset should be enough for correct
identification and internal bookkeeping
With this information present, we should have enough for qmltc to
generate meaningful CU-compatible code
Change-Id: Ibef715027cd366f0eec48e143b844e1b1d39c41d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Makes sure we also look for suggestions in extension types. Adds two new
methods to QQmlJSScope called properties() and methods() to easily get
all of them across base types and extensions.
Change-Id: I5874c0221bac6d6e317b79146227bf749100f05b
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
This make it clearer that if types are successfully found, it must
mean that a static plugin or linked library must have been found.
Change-Id: Ifaaa6fd4f385d7fc0e645b1da4a414a5cbbc7800
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Also log when it is found, with the path where it is found.
As a drive-by, add a 'version' label before printing the version of an
imported library. In a static build where some libraries end up with a
version set to 'invalid', it's clearer that the version is invalid,
and not the library.
Pick-to: 6.2 6.3
Change-Id: I998776b13bfe98f1668790419f1102e081878c99
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This ensures that any solution to QTBUG-83630 does not cause a regression.
The test that this patch adds fails for the Imagine style ToolTip (which
is tracked by QTBUG-101704), but that can be fixed separately, as there
is value in ensuring that we don't regress again via the other passing
tests.
Task-number: QTBUG-83630
Task-number: QTBUG-94764
Task-number: QTBUG-101704
Pick-to: 6.2 6.3
Change-Id: I3a827b56c0aac9d402a71dc5c4124356a270b4ba
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
While deeper integration requires more changes, we can already
establish the general relationship now. The idea: slowly migrate
to the proper qmltc compiler code. To achieve this, we can step
by step distill prototype's code generator in the qmltc code
generation. Right now, do it at the highest level by compiling
everything with the prototype's codegen (as before) but within
the "proper" qmltc compiler
Change-Id: I8a1e62f0559ff437ec2a4b0727147a441367c8e2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This is a partial revert of b0848d038b.
The tests became flaky again in early February, 2022.
Grafana shows no failures for 6.2, so this only appears to be an
issue on dev and 6.3.
Task-number: QTBUG-82015
Task-number: QTBUG-85624
Task-number: QTBUG-82404
Change-Id: Ie83f1c7e9660e26de4daf3418751faa0886d1651
Pick-to: 6.3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Mention that they don't apply if another popup is clicked.
Change-Id: Iaefe987f38897ec683af9f3fe1a21b5c75502fa5
Fixes: QTBUG-101573
Pick-to: 6.2 6.3
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QString::count() is deprecated, and also the "engine" argument to
QQmlListReference. Also, properly convert the results of "length"
retrieval.
Change-Id: Ib7edde1326a0347902174a23147086b9deccfe17
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Using the type cloning and adaption mechanism we can now determine what
kind of list we have to create in order to avoid a later conversion. We
can even propagate the type adjustment into the element types we read.
Fixes: QTBUG-100157
Change-Id: Ia2f160ebae56f39ee5946f49d2f8c5b4986a6b77
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
You really should not mess with that after creating the property cache.
Change-Id: I070200772475bb67f539dbbd85a298020b14ca79
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We're not supposed to modify property caches after they've been created.
Task-number: QTBUG-73271
Change-Id: I0ab8ed6750508fa4e28931995142f56cd5fa3061
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The MACOS_BUNDLE public option was removed from qtbase, but qml app
deployment still used it, causing deployment to fail.
Adapts to 0ada264dda533cd3be2699330a5c1e2dd27a0e6a in qtbase.
Pick-to: 6.3
Change-Id: I116518a8ce59511c8eb2755eb517576135bc3a25
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Previously we didn't search for possible fixes for typos in enum keys,
this change makes sure we can also offer corrections for enums.
Also adds a convenience method to QQmlJSScope so we can get all
enumerations across base types and extensions.
Change-Id: Id1f79a9d0a2a3b54b2ad3dfb7d8a71e6a276ce39
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
We now support automatically applying fix suggestions that don't
need any additional user input. This allows us to automatically
solve issues such as unqualified access and multiline strings.
[ChangeLog][qmllint][New Feature] Added the ability to automatically
fix some warnings, use -f to automatically fix your files or add
--dry-run to see what changes would be made first.
Change-Id: I2dc7587137d74267f60c08bb94a035f1a85a62b1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Add the sqaure bracket argument to the link command to make sure the
links go to the correct qml type page. Also, fix some line lengths in
the c++ file to bypass the clang-format warning, which wouldn't allow
me to commit.
Task-number: QTBUG-101193
Pick-to: 6.3
Change-Id: I45e22bdbec354de96b3598773b74d1754eda8a64
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Otherwise, it will break top-level builds, as moc might not have been
build yet.
Fixes: QTBUG-101617
Pick-to: 6.3
Change-Id: Id938c2e96575b6f2ad65cd5d6f8fe2af1421b02a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The flickable area inside the viewport can be bigger than
the bounds of the content item itself, if the flickable is
using non-zero extents (as returned by e.g minXExtent()).
Since the default implementation in QQuickItem::contains()
only checks if the point is inside the bounds of the item, we
need to override it to check the extents as well.
This patch will implement a new QQuickItem that overrides
contains(). It will simply check if the point is inside the
bounds of the flickable rather than the content item itself.
Pick-to: 6.3 6.2
Fixes: QTBUG-101386
Change-Id: Ifb27e899e40fde80a75e8bbbf88dd858053898af
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The other dialogs will ususally use a default 12 pixels if margins for
the Fusion style.
This patch aims to make the visuals more consistent with the other
dialogs for the Fusion style.
Task-number: QTBUG-100938
Pick-to: 6.3
Change-Id: I29f0a8dc6c189f461324d953ddb526b1736110bb
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
We can cache the result so that we don't have to look it up again later.
Change-Id: I36f05cdf4937f670dc2f78f9f8a7468aa1b82f21
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The dedicated basic blocks pass can take over its job now.
Change-Id: I3245d63ab169be5b643f11c269d27259921d96b9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Implement a new private function "scrollToCell" that can be
used whenever TableView needs to position the content item
for an already visible cell. For those cases, there is no
need to rebuild the whole table. Since we know the geometry
of the target cell, we can simply scroll/flick the
content item to the correct position instead.
Included is also a property "animate" that can be set by the
application to control if animations should be used.
[ChangeLog][QtQuick][TableView] Added a new property "animate"
that can be set by the application to control if animations
should be used for positioning the content item.
Task-number: QTBUG-100696
Change-Id: I74a35f655cbcf6e3897eb90e9b33be1ada458644
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
- Distill prototype/codegeneratorutil in the qmltccompilerpieces
(code generator) and prototype/codegenerator. The latter now has
the logic that is unlikely to become useful in the proper compiler
- Deduplicate property data utilities
Change-Id: I0064bd1cd3a1cb5a67216b4dba2735b9428ad63c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
We need to make sure the operations on the metaobject pointer are
atomic. Otherwise we can mess up the refcounting or create the shared
metaobjects multiple times. We have an atomic refcounting mechanism, so
let's use that. At the same time, realize that we don't have to
double-indirect access to the static metaobjects because we don't have
to refcount those. Therefore, replace the RefCountedMetaObject with a
class that makes both the pointer operations and the refcounting atomic,
and stores static metaobject pointers directly.
Pick-to: 6.3
Fixes: QTBUG-73271
Change-Id: Icd63413a3dbbb43ebb266ed6b4f9e6444ecbf908
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This way we can detect dead LoadReg and StoreReg instructions. This is a
precondition to removing the basic blocks pass in the code generator.
Change-Id: Iab1ed60c1aa56a15935a35507f5ac67292aa56b3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The overload taking char * and size as parameters is deprecated,
updated to use QByteArrayView instead.
Change-Id: Ic1959ca387f7d4328d99a1d26545911ff2bd96d7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>