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>
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>
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>
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>
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>
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>
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>
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>
Only the latter inherits QQmlParserStatus and can be "complete".
Change-Id: Ief61151f102a5a91c4d0ddcb912d9bdeee9a5614
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Replace the use of QQmlJSScope* with QQmlJSScope::ConstPtr or
const QQmlJSScope::ConstPtr&.
Change-Id: I07f35cbcc08ce1cb1cd07a9aff0d4721b7f45128
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
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>
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>
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>