Commit Graph

31817 Commits

Author SHA1 Message Date
Ulf Hermann b7aba647b0 QQmlSA: Remove cruft from public API
Methods you can't use should not be visible, and PassManager needs to be
Q_DISABLE_COPY_MOVE.

Task-number: QTBUG-116682
Change-Id: Ib308bf3a5bac3dd78b52b82b01bc8f2bc13835b3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-10-23 14:27:26 +02:00
Ulf Hermann a4346439ce tst_qqmllistmodelworkerscript: Avoid memory leak
QTest: :toString() is bad.

Change-Id: Id1a617344b521d79f8e279ebdc67d2c11ce6a8fa
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-10-23 12:27:04 +00:00
Ulf Hermann 1be6d083a2 qmltyperegistrar: Fix namespace registration
Whenever the target type is a namespace we have to generate a namespace
registration. This is in line with how we decide what to do with
Q_GADGET and Q_OBJECT types. Furthermore, even if both types are not
namespaces, but we have a QML_FOREIGN_NAMESPACE marker, we still need to
generate a namespace registration. The normal type registration would
just ignore the foreign. To this end, add another type info that tells
us whether the foreign type is supposed to be a namespace. Finally, also
add the override marker to QML_FOREIGN_NAMESPACE. We can derive from
types that declare it after all.

Pick-to: 6.6 6.5
Fixes: QTBUG-117703
Change-Id: I6ab25989f7738ab4567f0748192449704031bcc6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-10-23 14:23:48 +02:00
Ulf Hermann 1ba14d58eb QmlCompiler: Disallow reading enums from instances
Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-118089
Change-Id: Ib98bb84159847439614341a3cbd4d34d6eabfc8a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-10-23 14:23:38 +02:00
Sami Shalayel 59f9e1dd77 doc: add alias cycle in qmllint warnings
Add description of the warning and an example on how to fix it.

Task-number: QTBUG-111137
Change-Id: I0743c7700aa2d4d84b687604b5f61a9f01d05f37
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-23 08:11:50 +02:00
Sami Shalayel 8caf3a066a doc: add duplicate property warning in qmllint warnings
Add description of the warning and an example on how to fix it.

Task-number: QTBUG-111137
Change-Id: I3cf959b212b85c5081ae67ff031e194f9f1f4545
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-23 08:11:34 +02:00
Sami Shalayel d2991a6fa8 qmldom: move DomCreationOption definition into qqmldomconstants
Move the DomCreationOption enum definition into qmldomconstants,
next to the other enums.

Change-Id: I536e288f14f3083d8d45a572ea8710d9d9ef232e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
2023-10-23 08:11:17 +02:00
Sami Shalayel 425b35d887 doc: add duplicated-name warning in qmllint warnings
Add description of the warning and an example on how to fix it.

Task-number: QTBUG-111137
Change-Id: I8ee0d31e9562cdbd963e5bdf25fe75fdce7b3190
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-23 08:11:07 +02:00
Sami Shalayel e673d4d38b doc: add non-list property warning in qmllint warnings
Add description of the warning and an example on how to fix it.

Task-number: QTBUG-111137
Change-Id: Ia1c194bb9e65428b8c5f46b755369f153ab45584
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-23 08:10:56 +02:00
Sami Shalayel 8ba3d83f28 QQuickCheckBox: make nextCheckState property non-private
QQuickCheckBox has private properties but its private class
QQuickCheckBoxPrivate is defined in a .cpp instead of a header.
This causes problems with qmltc because it needs to include the
header of the private class when it sees private properties.

Replace the private property nextCheckState with a non-private one, as
nextCheckState does not need to be private (QJSValue is public API).
Amends 043e3d24f9 who exposed this
property to QML.

Add a file with a CheckBox in the qmltc tests to test if qmltc can
properly compile a CheckBox now.

Note: call the getter of nextCheckState "getNextCheckState" to not
shadow the "nextCheckState" virtual method from the base class.

Fixes: QTBUG-118091
Pick-to: 6.5 6.6
Change-Id: I771aeb8a4f388d7068ec78eba968746c8e184f31
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-10-23 08:10:26 +02:00
Tor Arne Vestbø 89a7868f7b Move componentComplete member from QQuickWindow to QQuickWindowQmlImpl
Only the latter inherits QQmlParserStatus and can be "complete".

Change-Id: Ief61151f102a5a91c4d0ddcb912d9bdeee9a5614
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-20 23:02:54 +02:00
Tor Arne Vestbø d7381c251f QQmlProxyMetaObject: Forward objectDestroyed to parent
The parent might have a different implementation of objectDestroyed
than QDynamicMetaObjectData, for example not deleting the object.

Change-Id: I7420ea577d9dc76bc13d11c54b6e0004205f13af
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-10-20 20:22:32 +02:00
Ulf Hermann 35debbda13 QML: Fix further return type constructions
There, too, the return type is already initialized and needs to be
copied or moved rather than placement new'd.

Amends commit 1d8859ce3a.

Change-Id: I5008659171962a3bd476a6e890e7576579646ae3
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-10-20 11:40:16 +02:00
Ulf Hermann 4f538c1feb tst_ecmascripttests: Adapt to renaming of logging category
Amends commit 1bd18723f7.

Change-Id: I2752af68dd463cb8a81cc3ff90a2653e876f6cfb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-10-20 00:19:12 +02:00
Ulf Hermann 495cf09a03 QQmlEngine: Fix documentation
The documentation should not recommend passing data via the context.
Rather, it should at least mention what a QQmlEngine actually is.

Pick-to: 6.6 6.5
Change-Id: Iee4faba7bb4e3bbbe385474badcb9781688f7147
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2023-10-20 00:19:12 +02:00
Ulf Hermann 0642ea5890 QQmlFile: Add documentation
The utility methods are used in quite a few places, in the examples.
Properly document them. The rest of the class is used only
internally by QtLottie and QtScxml. We can probably deprecate much of
it. For now it remains internal.

Fixes: QTBUG-87833
Change-Id: I9ba590191c36dc45c6f8be4e04a390b5fedabfcb
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-10-20 00:19:12 +02:00
Tor Arne Vestbø 9b9772931c Add binding order regression test for QQmlObjectCreator
Task-number: QTBUG-98789
Patch-by: Andrei Golubev <andrei.golubev@qt.io>
Change-Id: I7516bef7bd88148de5d07e688bd690de1bb8e3c0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-10-19 21:21:25 +02:00
Dimitrios Apostolou 1f019715cf Increase CTest timeout for tst_qmlformat
tst_qmlformat is a long test, and when we enable ASAN it usually runs
dangerously close to the default of 1500s (25min). So double it.

Pick-to: 6.6 6.5
Change-Id: I7e5566a28e3138fc5d667831406431f5fab50359
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-10-19 16:52:32 +02:00
Oliver Eftevaag 874654f353 Palette: Remove redundant code
In 4e7a83156d we duplicated the
implementation for the bitPosition() function in qpalette.cpp.

The intention was to expose the function in a private header, and
eventually replace the redundant functions in qpalettecolorprovider,
with the ones in QtGui.

Now that qpalette_p.h exist, lets actually use it.

Change-Id: Id7528b7f1c3f5481e0410688ef8e018afb951410
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2023-10-19 10:12:20 +02:00
Ulf Hermann 4cb85dca8e Add Documentation for versioning
This covers all the aspects of versioning I'm aware of.

Pick-to: 6.6
Fixes: QTBUG-93780
Change-Id: I7c2e1becd90cb836db66e7784dd9fe231e56bd47
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-10-19 09:56:15 +02:00
Ulf Hermann dd40ba7683 Particles: Simplify QQuickParticleData
There is no need for the custom lifecycle methods.

Change-Id: I13d78518366e888b9f38f8c73060f963897e53be
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Shawn Rutledge (away) <shawn.rutledge@qt.io>
2023-10-19 09:30:57 +02:00
Ulf Hermann c85695369c Make QQuickV4ParticleData a value type
We don't need all the QJSValue wrangling.

Change-Id: I683e3edc55de2cf3457cb86f952cf1eb717ae395
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge (away) <shawn.rutledge@qt.io>
2023-10-19 09:30:53 +02:00
Ulf Hermann 742fba7d7a QmlCompiler: Comment about not allowing modifications to return values
This trap is all too easy to forget about. Let's make sure the next
person thinking about it understands it.

Change-Id: Ib7bd566e1d8c4264a99ae59e79384c4e87581d43
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-19 09:30:27 +02:00
Ulf Hermann bf2258e6f4 QtQml: Don't unnecessarily detour through the CU to look up types
Since we also store partial types as QQmlType now, we can just look them
up the regular way.

Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-117788
Change-Id: Id3e81853f802419f1121ef5e856c3272a3c977a1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-10-19 09:30:13 +02:00
Qt Submodule Update Bot bbeca33068 Update dependencies on 'dev' in qt/qtdeclarative
Change-Id: I123bf203c2e829f8368667bc7ef57da716d0849a
Reviewed-by: Qt Submodule Update Bot <qt_submodule_update_bot@qt-project.org>
2023-10-18 21:11:01 +00:00
Tor Arne Vestbø 306551b84a QQuickWindowImpl: Use direct connection for {visible,visibility}Changed
The connections were made queued because QWindow would emit them also
during destruction, at which point the QQuickWindowImpl was already
destructed, but we can work around this by calling destroy() explicitly
in our destructor. This allows us to use direct connections again,
which are preferable since all we're doing is forwarding the QWindow
state, and results in visibility signals being emitted properly during
destruction of QQuickWindowImpl.

Task-number: QTBUG-98734
Change-Id: I262d8cfccfce005232c62d69e381df09835a33fc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-10-18 18:37:51 +00:00
Tor Arne Vestbø 6ccee0304d QQuickWindowQmlImpl: Use qmlWarning to report visibility conflicts
We don't need to maintain the complexity of emitting a simple error
when qmlWarning already takes care of this for us. The only thing we
lose out on is the object name as part of the message, but in return
we get the line and column number.

Change-Id: Ie4bcd3f8e3fa1a3d71a7e80702f36209ab2a68dd
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-10-18 20:37:48 +02:00
Sami Shalayel f9eabe862b doc: qt_add_qml_module links to qmltc's doc about private headers
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
Pick-to: 6.5 6.6
Change-Id: Ie5e6e6c92a10ef4822e5a712bb31e06bdce6bf5e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-18 17:49:01 +02:00
Tor Arne Vestbø 16023fc77c Defer automatic Window transient parent until component completion
A Qt Quick Window without an explicitly set transient parent will
automatically get a transient parent based on its object parent,
for example if it's added as a child another Window or Item in
a QML document, or if a parent is passed to Qt.createComponent
or Qt.createQmlObject.

The logic to handle this was spread out through the various places
that Window objects were added to a QML document or created,
making it hard to maintain or extend this logic. The logic is
now centralized in a single updateTransientParent() function
in QQuickWindowQmlImpl, that's triggered on component completion,
and whenever the conditions for the automatic transient parent
change after that. This allows us to extend the logic to not
apply automatic transient parent when we add support for real
(non transient) child windows later. The machinery relies on
new optional behavior in QObject to send ParentChange events
whenever the parent of an object changes.

Another issue with the previous approach was that it was doing
synchronous QWindow::setTransientParent() calls whenever one
of the conditions were met, which in some cases resulted in
overriding the explicit transientParent set declaratively by
the user. This was an issue because setting the transient
parent to null was the documented way to opt out of one of
the implicit behaviors of a Window with a transient parent,
namely that it defers its visibility until the transient
parent has been made visible. As we now defer the transient
parent magic until the component has been completed, we
know whether the user has set the property explicitly,
and can bail out of the magic if so.

As the deferred visibility of a Window was closely tied to
the transient parent logic, this logic has been refactored
as well, attempting to keep the two machineries as decoupled
as possible. As part of this refactoring the logic to warn
the user if conflicting visibility properties is detected
has been factored into a separate function.

The tst_qquickwindow::attachedProperty() needs a tweak, as
it was was relying on the secondary window not being
transient, which was the case prior to this patch because
we failed to catch the case of Window properties in our
auto-transient-parent machinery:

  Rectangle {
      property Window someWindow: Window {}
      // someWindow is now transient to the
      // rectangle's window.
  }

Now that we correctly handle this case, the check for
qWaitForWindowActive() was not sufficient to ensure
the Window.active property was true, as transient child
windows are active if their transient parent is active,
and we would not end up spinning the event loop at all,
which is required for the binding to update.

To solve this we now explicitly mark the test window
as not having a transient parent.

[ChangeLog][Qt Quick] Declaring Windows via dedicated
properties of another Window or Item will result in
an automatic transient parent relationship to the
parent Window or Item, just like declaring it as
part of the default data property.

Task-number: QTBUG-116188
Change-Id: Ia1138391d57b64838cebea4bc0a97fbfdf022772
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-10-18 17:42:10 +02:00
Sami Shalayel 239359291c doc: add missing type warning to qmllint warnings
Add description of the warning and an example on how to fix it.

Task-number: QTBUG-111137
Change-Id: Ib544ea674a1cfc5c6d9b5c9a944cf476cdf51f7d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-18 10:22:07 +02:00
Ivan Solovev e8c8ddeb94 QQuickItem: more fixes for bindable properties
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
Pick-to: 6.6 6.5
Change-Id: I97a94cbf2b38c57e9a260e54c9894c2ffd47271d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-18 10:07:36 +02:00
Ulf Hermann 53b9c17749 QmlCompiler: Prohibit writing to readonly properties
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.

Pick-to: 6.6 6.5
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>
2023-10-18 09:22:29 +02:00
Tasuku Suzuki f55a9d0678 Fix build without features.itemmodel
Change-Id: Ic66bd86f4fde6e6ea0ac965aff5ac4e448e120ae
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-10-18 00:32:15 +09:00
Eskil Abrahamsen Blomfeldt bb8fb504fe Fix translucent NativeRendering text on transparent window
We cannot pass the color alpha to the source color
scale factor, since when we blend we will end up with a
resulting output color that has alpha. The color's alpha is
premultiplied into the subpixel alpha values we fetch in the
fragment shader, together with the state's opacity.

Note: While not strictly necessary, this also changes the
text shader to match the standard premultiplication in other
shaders, since it has caused some confusion.

[ChangeLog][Text] Fixed an issue where NativeRendering text
with a translucent color combined with a transparent window
would cause unexpected translucency effects on opaque parts
of the scene.

Pick-to: 6.5 6.6
Fixes: QTBUG-118052
Change-Id: I1f06a503c48355863784fc18a849fb539b9384ef
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-10-16 16:28:49 +00:00
Semih Yavuz 8aa5d17618 qmlformat: fix formatting with -F option
qmlformat accepts -F option to format a list of files given in another
file. That should supposed to be inplace, but qmlformat would send
output to stdout. To fix this, force inplace formatting if the
options.files are not empty.

Change-Id: If62dd3edde91460eba5812b1d7aea1b7422f46bf
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-16 18:28:49 +02:00
Semih Yavuz c2a2e5b613 doc: document qml tool
Change-Id: Iff0afe38883d68d9bf72bc5e170cf6e17bc4e05f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-16 18:28:48 +02:00
Semih Yavuz 259452ae4f doc: document qmlpreview
Change-Id: I6e526c8a6526a2b3da443c310dab6690db9d9b3f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-16 18:28:48 +02:00
Semih Yavuz c9bdd4d756 doc: document qmlimportscanner
Change-Id: I6bf67681fbdca3460769df255f1caa6d2be0665e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-16 18:28:48 +02:00
Semih Yavuz 7d6751c34a doc: document qmlformat tool
Change-Id: I14eee55b77137e65626ffa5737ee7f5d85bd5926
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-16 18:28:48 +02:00
Sami Shalayel c5c8836c05 doc: add recursion depth error in qmllint warnings
Add description of the warning and an example on how to fix it.

Task-number: QTBUG-111137
Change-Id: I5816b84c18c22afccc36794ebb2e7de8b1bdf5b9
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-16 18:28:48 +02:00
Sami Shalayel 6846af01bf doc: add import warnings to qmllint warning list
Add description of all the warnings that comes with the "import" id
and for each warning add examples on how to fix them.

Change-Id: I258b6aa701180026e196479cdab67974fcbb762c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
2023-10-16 18:28:48 +02:00
Ulf Hermann ad81532099 QtQml: Improve documentation of LoggingCategory
Explain the example some more, document the enum, fix some grammar
problems.

Pick-to: 6.6 6.5
Fixes: QTBUG-96007
Change-Id: I5d113f198a95e514026e71334bd40851941d924a
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
2023-10-16 16:28:48 +00:00
Ulf Hermann d9d2af4db3 QtQml.Models: Amend documentation for ListModel
QAbstractListModel has a QML name these days. We can mark the
inheritance. Also, add a note about it to the description.

Pick-to: 6.6 6.5
Fixes: QTBUG-101991
Change-Id: I9db8c399caa48b268b532a6ed88beec9f4032ee1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-10-16 16:28:48 +00:00
Ulf Hermann 2e6ad03389 QtQml: Document QML_ADDED_IN_VERSION and QML_REMOVED_IN_VERSION
In turn, deprecate QML_ADDED_IN_MINOR_VERSION and
QML_REMOVED_IN_MINOR_VERSION. These are dangerous because you don't
quite know what major version they refer to.

Pick-to: 6.6 6.5
Fixes: QTBUG-116895
Change-Id: I9d6d169430944e1dfa4e78bda74c8b71f739e331
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-10-16 18:28:48 +02:00
Ulf Hermann 377501f35b Amend code snippets for QML_ELEMENT to show how to expose enums
You can expose enums from either object types or namespaces. The note
about namespaces had no snippet at all and the one about object types
didn't show what was actually exposed to QML.

Also fix the code snippet for qmlRegisterUncreatableMetaObject().

Pick-to: 6.6 6.5
Fixes: QTBUG-113188
Change-Id: I94f8d8f21cb6690689de0cb98f4426daff6e72a2
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-10-16 18:28:47 +02:00
Sami Shalayel f74fa49f85 qmllsutils: use QQmlJSScope::ConstPtr instead of raw pointers
Replace the use of QQmlJSScope* with QQmlJSScope::ConstPtr or
const QQmlJSScope::ConstPtr&.

Change-Id: I07f35cbcc08ce1cb1cd07a9aff0d4721b7f45128
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-16 18:28:47 +02:00
Ulf Hermann 0a0f6637c6 Doc: QT_QML_SINGLETON_TYPE has to be before qt_add_qml_module
Fixes: QTBUG-117093
Change-Id: I8949c8d09c381a503b33f4b37f48c899b7502f50
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-10-16 18:28:47 +02:00
Sami Shalayel 36424b527f qmlls: complete handler names in bindings
Previously, qmlls was not able to find property change handlers or
signal handlers for properties or signals defined from QML code. Instead
of trying to fix the DOM code that searches for signals and properties
in the current type, use the qqmljsscope to find properties and signals
of the current type.

Add a test that makes sure that the autcompletion
proposes handler names for QML defined signals and properties.

Change-Id: I07910044a23a2b9df9a6d03fb37be5c06d10b213
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-16 18:28:47 +02:00
Sami Shalayel cc64912032 qmlls: autocomplete support for the JS global object
Add completion support for the JS global scope (console, Math and
friends) in qmlls.

Task-number: QTBUG-116899
Change-Id: I33f5165320c245d3a45f55bd8e9c06a6e492e35c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2023-10-16 18:28:47 +02:00
Ulf Hermann 1bf4294fa8 QtQml: Make docs for QML_{CONSTRUCTIBLE|STRUCTURED}_VALUE visible
Also, extend them a bit to show how you can as-cast to value types and
create lists of value types.

Fixes: QTBUG-113490
Change-Id: I03378fa53ab5b76792b3e96d519ca6958132c046
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-10-16 18:28:47 +02:00