Use the correct properties and use qsTr().
Pick-to: 6.3 6.4
Change-Id: Ic9765503845e5d9d64c2c77c60238095b4947058
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
In 6.4 we're introducing the ColorDialog in the qt quick dialogs module.
This was the final dialog, that was missing from the module in previous
versions of qt.
This change will make use of the new dialog, instead of the qt labs
platform version, which is using the widgets color dialog as a fallback.
The eventual goal for this example should be to eliminate the need for
the qt labs platform module entirely.
Note that I am also making a small change to how the font dialog is
being used, since we deprecated the currentFont property in the 6.3
release, but I forgot to update this example along with it.
Pick-to: 6.4
Change-Id: Ib99ca7cbf110d3084ff96dfadfa1cd8c8af8815e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
The property should be selectedFile, not file.
Pick-to: 6.3 6.4
Change-Id: I3ce399a7df2d80d122058c411b9b1a633f04fc64
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
The test doesn't need it; qWaitForWindowExposed is sufficient.
Fixes: QTBUG-104022
Pick-to: 6.2 6.3 6.4
Change-Id: I7e818b2f377bf5798e881100c555d54482ee3dbf
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Ensure that we remove shortcuts for a MenuItem when it's disabled,
not just when a new shortcut is set.
Fixes: QTBUG-89567
Pick-to: 6.2 6.3 6.4
Change-Id: I9c4eeda1a68a23317fe5e7bf517046e4e403c46a
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Scrollbar test fails quite often on webOS emulator. This could be
related to test environment or webOS specific cursor handling, which
is out of The Qt Company's control.
Fixes: QTBUG-105611
Pick-to: 6.4
Change-Id: I0d7dce93c611ef03eaedbde8cd31fdbf54b89f89
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
When running an application on iOS, use the iOS
style by default, rather than Basic.
Change-Id: I355277f20e25720f899806ea40ed6af0da1e3033
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
The identifier is of course not a full (as in absolute) path, but rather
a relative path. The documentation states above that all paths are
relative to the engine's offlineStoragePath after all.
Also, drop the version number from \qmlmodule.
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-95232
Change-Id: I9202d4ecd45d3efca00ad48dbef359491c373916
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The most common mistakes leading there are missing qualifications in
C++ and missing qt_extract_metatypes in CMake.
Pick-to: 6.4
Fixes: QTBUG-105254
Change-Id: I285355d0cc5be34d5e018dc6e843e649f60df871
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The paths need to be the same between CMake and qmake and you really
should not use absolute qrc paths.
Amends commit d270c51f81
Amends commit e0ee63a06e
Change-Id: I9f6d3ac3fbf4483e0c0f2cad540f45c25192886e
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
As it stood, it could be quite hard to tap on an indicator to
expand or collapse the tree. So increase the size of the area
around it. Also make it independent of the arrow image size, since
the image will change size depending on if the indicator is
expanded or not.
Pick-to: 6.4
Change-Id: Idf7f9b6429fd5149a8fc262edc73a127740388c5
Reviewed-by: Doris Verria <doris.verria@qt.io>
TreeViewDelegate was using mouse event handlers to detect clicks
on the delegate and its indicator (to e.g toggle the expanded state
of a tree node). This had the effect that any pointer handlers installed
on the TreeView itself would be blocked from working, since the
delegate would accept the mouse events, and thereby stop propagation.
Since TreeView uses drag-, and tap handlers to perform selections
(installed by SelectionRectangle), using TreeViewDelegate as
delegate would basically stop selections from working.
Therefore, this patch will switch to use pointer handlers instead.
Pointer handlers are by default non-blocking, and will naturally
work better with other pointer handlers in the application, including
of course the pointer handlers installed on the TreeView itself.
The reason QQuickTreeViewDelegate was using mouse event handlers
from the start, was because it inherits QQuickAbstractButton, which does
the same. For that reason, we still need to
override mouseButtonPressed(), and ignore the mouse events, to
make sure that the QAbstractButton implementation doesn't block.
Instead we now call the appropriate mouse handling functions in
QAbstractButton directly from the pointer handlers.
Since we don't use mouse event handlers anymore, this also has the
advantage that we no longer need to recommend users to install custom
pointer handlers on a child item of the delegate - they can now be
installed directly on the delegate. Docs that described that
work-around are therefore removed/changed.
Fixes: QTBUG-105570
Pick-to: 6.4
Change-Id: I46d82175c577a27d083494960f1cad645f4d75a4
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
QQuickRowLayout and QQuickColumnLayout both inherit from
QQuickLinearLayout, however, QQuickLinearLayout is not
exported, so if you try to use QQuickRowLayout or QQuickColumnLayout
outside of Qt itself, you'll get compilation errors due to
missing symbols. Fix it by simply exporting QQuickLinearLayout.
Pick-to: 6.4
Change-Id: I8c87500ea67c560e9c27b534a8dbc03fb1388d68
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The Qml lexer was not restartable, make it so that a line can be
parsed independently from another.
This is a requirement for efficient indenting and highlighting.
Old approach in creator used a separate finite state machien "scanner",
now it is possible to use the same lexer as the parser.
One can "checkpoint" every few lines, and restart the process form the
line above the change, and stop when the status is the same as before.
Change-Id: I72a13a767ac7adfe103e56e60902e61c88e4fd82
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
The non-native filedialog was missing a text input field that would
allow the user to easily set the filename in a filedialog with fileMode
set to SaveFile.
Pick-to: 6.4
Fixes: QTBUG-101502
Change-Id: Id800a1e34de0e65455409a7edc5fa2f5f13b4b19
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
908aa77d16 hid old scroll bars, but
didn't account for the situation where the old scroll bars would be put
back into place, and so they never showed up.
In the case of the linked bug report, since there was a binding to the
ScrollView's contentItem, a default Flickable would be created. After
that binding was evaluated, the contentItem was set, causing the scroll
bars to be hidden (as part of the process of disconnecting from the old
flickable). To fix the issue, we now do the reverse of hideOldItem when
a new contentItem is set.
Fixes: QTBUG-104983
Pick-to: 6.2 6.3 6.4
Change-Id: I910259cc3e8f6a6231ae6c87c7d4f0f652bd0545
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Nate Graham
Stuff cannot just magically move under a different prefix
when shaders are referenced with relative paths.
As the example uses the common main helper code, it is
easier to switch to absolute paths than to use
NO_RESOURCE_TARGET_PATH.
Amends d270c51f81
Change-Id: I527314725210e02675dc8c2f5fc5042dc5e1c478
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Adds a docuemnt outlining some of the details of how the plugin system
works.
Change-Id: I9b6d6987bf0fcdf9b12791bed93d4142b59f267d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We should use the enums from QLocale instead of just recreating them in
QQmlLocale.
Change-Id: Ieb2985f93f3da36781e5c6bb4b582e3abb166d81
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
flushFrameSynchronousEvents() is only called on the window's DA, so a
touch event stored in QQuickDeliveryAgentPrivate::delayedTouch in a
subscene DA would be lost, unless we make the flush recursive.
However, a grabbed touchpoint remembers its DA; when that's a subscene
agent, subsequent touch moves are delivered directly via the subscene
DA, and touch event compression does not occur at all. This may
pessimize performance if touch events occur many times more often than
frame rendering, but it's not expected to matter a lot on 3D-capable
hardware.
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-105566
Change-Id: I9102b20806f9577fba0f741f7589ee5b1642e5a5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
To add translation bindings to qmltc, the methods used to create
translation bindings need to be adapted to work without
QV4::CompiledData::Binding as it is not available from qmltc. Instead,
information already available from the QQmlJSScope should be used, along
with a newly introduced helper class QQmlTranslation.
Details:
Add a QQmlTranslation class that represents a call to qsTr, qsTrId etc
that knows how to translate itself (without needing any
ExecutableCompilationUnit or Binding). It encapsulates the
information needed to create a translation binding.
ExecutableCompilationUnit::bindingValueAsString refactored
so its functionality can be used without Binding.
Instead, it uses only the translationId, see
ExecutableCompilationUnit::translateFromId
and
ExecutableCompilationUnit::translateFrom.
Refactored QQmlTranslationBinding to work with QQmlTranslation instead
of CompiledData::Binding.
Same for QQmlCppBinding::createTranslationBindingForBindable,
QQmlTranslationPropertyBinding::create and
QQmlCppBinding::createTranslationBindingForNonBindable.
Changed TranslationBindingInformation to work without
CompiledData::Binding, and also removed static unused
QString ProxyTranslator::originStringFromInformation(
const TranslationBindingInformation &translationBindingInformation)
as I could not find out what this origin string is.
Same for the translation debugging in qmldb_preview.
Added QmltcCodeGenerator::generate_createTranslationBindingOnProperty.
Added #if to avoid compilation error for standalone DOM compilation due
to the new QQmlTranslation class.
Task-number: QTBUG-105345
Change-Id: Iccd94d5cba4eaf63901233451fec48051c855c2a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
All the Qt Quick types in src/quick/util are exported
except this one, so export it as well. It may also be
used by external users when implementing something in
pure C++ instead of QML.
Pick-to: 6.4
Change-Id: If224608127e5fdc2c834b294f200b7a72fae6f96
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
StdinReader::run() (qmllanguageservertool.cpp) just uses readSome,
which might read just a single character (and on several platforms
that is what it does), and then sends it via signal to another thread.
This is rather expensive, we should read larger chunks to be more
efficient, but we should never wait for more data if a full message
was already read (to avoid deadlocks). This commit uses
QHttpMessageStreamParser in dry mode to know when to send the data
via the signal, that is, when a message has been entirely read.
Change-Id: Iee795ded0a539413ec15c686a416f2ccf6673ec9
Task-number: QTBUG-104553
Fixes: QTBUG-104150
Pick-to: 6.4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
If this function is called and the resulting event says that
event->pointingDevice() is a mouse, something went wrong somewhere.
We require that the recipient of the event can find out that it came
from a touchscreen, if that's where it really came from; and this
function should never be called with an event that comes from a mouse.
Change-Id: I993fa5a491e58f63a90b2df6f0885f7fcf8cb8ec
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Import as resolution (i.e. finding a type that was imported with an import as)
was broken in two ways: the shortcut looking for types did look only to types
imported without as, and the normal lookup for symbols declared the ImportScope
as visited (to avoid loops) too early in one case and would skip it.
This was visible in qmlls completions of Controls.
Pick-to: 6.4
Change-Id: Ifc1e777973ddc251bd0685290e8d28bfb025f269
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This test fails the dependency update on macos x86_64 platforms
but is just checking if/when a qFatal error is thrown. Therefore, it
is blacklisted.
Change-Id: Ie08c24e0b00aedbcf40b5b51191a0e4a6180a1dd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The QStringView overload of match will be deprecated in Qt 6.8.
As a drive-by, replace a match(view.toString()) with a a matchView; the
view lives long enough, so no reason to convert to QString.
Also use capturedView instead of captured when working with
string-views, and hoist one regex construction out of a loop.
As the QML DOM has to build with older Qt versions, condition the use of
matchView on Qt being >= 6.4
Fixes: QTBUG-105360
Change-Id: If248d135fd381c6368d446376798a52dec220b40
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
There are two main problems with the existing table:
* The user has to scroll horizontally to view all the content in the
right column.
* It is difficult to link to the individual entries.
Splitting the column into subsections solves these issues. In addition,
add a list of all the commands in the qmldir file to get a quick
overview of the subsections that follow.
Also, make small grammatical fixes to the text.
Fixes: QTBUG-105239
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: Ic33caedf317ae1d33ecc606cffc5d664490e242c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Users need code they can copy, and qt_add_qml_module lacks examples of
e.g. main.cpp and its position within the recommended directory
structure.
Pick-to: 6.2 6.3 6.4
Change-Id: I29212b603bfd9cf24ecb327317be8f1410b2cfda
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
- Avoid mixed type bitfields: There are compilers which generally
support bitfields, but will not combine members if the type is
different. Requires explicitly casting bitfield members to bool in a
few places to avoid ambiguous overloads.
- Move all containment mask members into extraData: extraData will be
allocated anyway to store the contains meta-method, so we might as
well move the mask pointer there.
- Do not store quickMask separately; instead, cast mask to QQuickItem on
demand. qobject_cast<QQuickItem *> is fast, as it only has to check a
single flag.
- Do not store a QMetaMethod for the mask's contains method. Instead
store only the index, and retrieve the metaObject on demand.
Change-Id: Ib2120c3b01ea037eb17c6c903a2977c38cd6c40c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Before 6.4, it was only possible to make a selection in
TableView by using a SelectionRectangle. But in 6.4, you
can also make a selection directly in TableView by using
the shift+arrow keys. To make sure that a selection is
cleared either way on tap, move the implementation that
clears the selection from SelectionRectangle to TableView.
Pick-to: 6.4
Change-Id: Ic718763bf9b643cb3e3c04cc3b90c6ffcf9ca4b2
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Previously we didn't set this flag properly if there were multiple modules
that were imported.
Change-Id: I05d81bc82f69e038a82131e20c23fb9dd497e9cc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
If the user used for(let x;...) we need to preserve the let and must not
change it to var.
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-105361
Change-Id: I49fc3797505b569cc9b8a9138dd57ec7e70d3eb9
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
For one, the Qt 5 autotest remained entirely disabled (with individual
cases all skipped) in Qt 6. Two, most of it is meaningless in Qt 6,
the state changes and the associated flags which are mostly ignored by
the renderer due to the QRhi-based architecture.
Replace the whole test. Start small, and have a test case that renders
using QRhi while exercising the modern QSGRenderNode features, such as
taking the projectionMatrix() into account and specifying
DepthAwareRendering, accessing the QRhiRenderTarget/QRhiCommandBuffer,
etc. This ensures that the basic functionality is not completely broken,
which is important for Qt Quick 3D for example.
For now have just one additional test, a very basic OpenGL one, to make
sure there is an OpenGL context current.
Fixes: QTBUG-105468
Change-Id: I05f4651e2d6b4b0760929aecdd32841ca69fa55c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Otherwise configuration fails due to not finding moc for AUTOMOC due to
the tests using non-internal target creation APIs.
Change-Id: I7df3d395bd253f5bc943fab8218aa9611ad8a02a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>