| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
String converters are removed in 6.2 anyway.
Fixes: QTBUG-89892
Change-Id: I504c00d99580e3d27d04f420295dd97251657ef4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit d250e0070701e9c511ef5b1fb0d23995872ad844)
|
|
|
|
|
|
|
|
|
|
|
|
| |
We set QProperty bindings up in the wrong way: Parent components would
overwrite their child component's binding. This patch reverses the
order, fixing the bug.
Task-number: QTBUG-87153
Change-Id: I3e90d1d14a41a7c5c337745f1453484d360a3979
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 96e321bc5cf3c1a6d52374a6f4070a438032b08d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this change, an alias of a bindable property is also bindable, and
shares its bindable interface with the target.
Moreover, the logic in QQmlTypeCompiler is adjusted so that a change
handler of an alias uses the bindable interface if possible, instead of
connecting to the alias' change signal. That would never be emitted if
the target is a QProperty without a notify signal.
Alias properties still have a change signal, but those never get
emitted.
Change-Id: I857dfdbe51048a2b604ad632982e7f4adac6b907
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
As you can extend value types with QML_EXTENDED we may as well allow a
factory function in the extended type. Furthermore, if the original type
allows construction from QJSValue, we may just use that. In turn, we can
get rid of the value type providers now.
Change-Id: I9124ea47537eab6c33d7451080ab2fff942eaa7b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
They all did the same thing.
Change-Id: I7661b19ad16c0713d46c4df337899e3897349b2e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was only used for QColor. The string representation of QColor was
funneled through the color provider to get a numerical RGBA value and
that one was passed to storeValueType() which would create a QColor
object. The RGBA value was retrieved by creating a QColor object. We
can just directly create the QColor from the string, and we can use the
generic create() method for that.
Change-Id: If36775830882237e5e36f748872ce23530c3bb71
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
It can be expressed as a special case of create() with a QJSValue.
Change-Id: I7342026ad694077d2780dd8a852714fa72dd68d0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- isQProperty has been renamed to bindable
- QNotifiedProperty is no more
- Bindable properties have a function to obtain the QBindable; store
that information in the qmltypes files.
Task-number: QTBUG-86434
Task-number: QTBUG-86435
Change-Id: I2ba593af1e197d04d2c30cfb9e6904a3d2059e4b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
variant and var properties differ in two important ways:
- variant properties trigger "magic" string conversions:
variant v1: "red" // contains a QColor
var v2: "red" // contains a string
- variant properties behave differently for value types: they create
copies, instead of references.
However, as variant properties were marked as obsolete and this
behavior was effetively undocumented, it should be safe to give "variant"
"var semantics".
With this change, we can also avoid doing magic conversions when storing
data in QVariant properties of QObjects/QGadgets
Change-Id: I549b1beb98e6af9639c1ee81f316bda513d5ff65
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
[ChangeLog][QQmlListProperty] When overriding a
QQmlListProperty in a derived QML type, the default behavior is to
append the derived class elements to the base class ones. This
introduces a macro to allow replacing the base
type contents either always or if the property is not the default one.
Fixes: QTBUG-77529
Change-Id: Ib1abbf52e341c043344c347c612928b47856fb3e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The test example is based on
qtvirtualkeyboard/src/virtualkeyboard/content/components/PopupList.qml
Luckily ((QQmlPropertyCache *)nullptr) -> property(-1)
is ended without access to this, so this was not caught before.
But this is UB, plus I can not run Qt and my application compiled with
-fsanitizer=X, because of it crashed after the first member function
call with nullptr as this
Fixes: QTBUG-85605
Change-Id: If6a71fde9a14cc4f73139dfa0e6ee3005453104d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
If we install the binding eagerly, context properties cannot be resolved
yet, as the context object has not been created so far. This causes
issues with a QNotifiedProperty using a callback which accesses the
current value, and thus forcing the binding evaluation while the object
creation is still ongoing.
Change-Id: I3bf3def04cd044371cb757a1854a3224a9c669b8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This introduced inconsistency in order to be compatible with V8 and Qt
5.0/5.1, respectively. We don't need to do this anymore. We standardize
on the behavior observed when statically setting a property in QML, e.g.
"foo: '2014-03-03'", rather than the behavior observed when dynamically
setting it from JavaScript.
[ChangeLog][Important Behavior Changes] Dates are interpreted the same
way when assigned to QML properties as when parsed in JavaScript now.
The time zone is generally left alone, not forced to UTC in some cases.
Fixes: QTBUG-36635
Change-Id: I72a7045d7b39ee1c6e0ac1ef55d74ef8aa505f00
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
Pick-to: 5.15
Fixes: QTBUG-85165
Change-Id: I052e97be398791f54f6b5c106ffe364f3457359a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We don't know in advance if a URL is part of the source code and should
be relative to the current element, or if it is part of the application
data and should not be touched.
[ChangeLog][QtQml][Important Behavior Changes] URLs are not resolved or
intercepted anymore when assigning them to a "url" property. Instead
they are resolved and possibly intercepted when used to access an actual
resource.
Fixes: QTBUG-76879
Change-Id: Iaa2385aff2c13aa71a12e57385d9afb5dc60a073
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 7ec30c51b287159377761338fe6d3b48706d74ee.
We don't want to half-decode directory separators on assignment. This
just introduces inconsistency down the line.
[ChangeLog][QtQml][Important Behavior Changes] Percent-encoded directory
separators in URLs are not automatically decoded on assignment to url
properties anymore. This was obviously not a good idea to begin with.
Fixes: QTBUG-81244
Change-Id: I1938abbe8aada88beff0d628397674255e8b2472
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
| |
Remove all code that supported converting between JS RegExp's and
QRegExp, as QRegExp is going away in Qt6.
Change-Id: I4863e68dd87a337d7e836d1b26c28ee3bb914e9f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Syntactically we call them signal handler expressions :-), now also
working when the underlying property doesn't emit an old-style signal
but is just a QProperty.
Change-Id: I719a3e428f44af0fd48036434aefa682a02f7de1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: I439653123cdc96df97a1801664655c9d28a8b9b5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Avoid going through externally managed bindings and instead allocate a
more lightweight property binding. It's basically a
QQmlJavaScriptExpression and one pointer plus the overhead of
QPropertyBindingPrivate.
Change-Id: I1530330926d351b61f2b3bbad39301c628a8bef1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
| |
It's used all over the place. We need a proper interface.
Change-Id: Iebe254ef3bf35503bf3fdd3639979a5db2b3449e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
| |
Change-Id: Ic0c768fc2402d8674e06e84dfe4dc90d05407167
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This class is not a private detail of QQmlContext. And it is incredibly
hard to see who owns what in there. Let's add some civilization ...
We enforce refcounting for QQmlContextData across the code base, with
two exceptions:
1. QQmlContextPrivate may or may not own its QQmlContextData.
2. We may request a QQmlContextData owned by its parent QQmlContextData.
For these two cases we keep flags in QQmlContextData and when the
respective field (m_parent or m_publicContext) is reset, we release()
once.
Furthermore, QQmlContextData and QQmlGuardedContextData are moved to
their own files, in order to de-spaghettify qqmlcontext_p.h and
qqmlcontext.cpp.
When the QQmlEngine is deleted, any QQmlComponents drop their object
creators now, in order to release any context data held by those.
Before, the context data would be deleted, but the object creators would
retain the dangling pointer.
[ChangeLog][QML][Important Behavior Changes] QQmlContext::baseUrl() does
what the documentation says now: It prefers explicitly set baseUrls over
compilation unit URLs. Only if no baseUrl is set, the CU's URL is
returned. It used to prefer the CU's URL.
Change-Id: Ieeb5dcb07b45d891526191321386d5443b8f5738
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Being careful, we can now save primitive values inline. We use the heap
pointer of QV4::Value as either QString* or QV4::Value* for complex
types. We cannot store persistent managed QV4::Value without the double
indirection as those need to be allocated in a special place.
The generic QVariant case is not supported anymore. The only place where
it was actually needed were the stream operators for QJSValue. Those
were fundamentally broken:
* A managed QJSValue saved and loaded from a stream was converted to a
QVariant-type QJSValue
* QVariant-type QJSValues were not callable, could not be objects or
arrays, or any of the special types.
* Cyclic references were forcibly broken when saving to a data stream.
In general the support for saving and loading of managed types to/from
a data stream was so abysmally bad that we don't lose much by dropping
it.
[ChangeLog][QML][Important Behavior Changes] When saving a QJSValue to a
QDataStream only primitive values or strings will be retained. Support
for objects and arrays was incomplete and unreliable already before. It
cannot work correctly as we don't necessarily have a JavaScript heap
when loading a QJSValue from a stream. Therefore, we don't have a proper
place to keep any managed values. Using QVariant to keep them instead is
a bad idea because QVariant cannot represent everything a QJSValue can
contain.
Fixes: QTBUG-75174
Change-Id: I75697670639bca8d4b1668763d7020c4cf871bda
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
We may want to have, for example, a QQmlFileSelector and a
component-specific interceptor that chooses a theme or similar.
Also, make the API public. We want to propose this as alternative to
dynamically registering QML files via qmlRegisterType(QUrl, ...).
Change-Id: I4a535d3ea556da6710fde816579ec188b3f57099
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: Ibfc6fc49b0c09ced04f1263e097e35529e84ef7e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is needed in a few places outside of declarative, so this change
restores the loc member in DiagnosticMessage and moves
QQmlJS::AST::SourceLocation into common's QQmlJS namespace/directory.
QQmlError is unaffected and retains only line/column.
Amends d4d197d06279f9257647628f7e1ccc9ec763a6bb
Change-Id: Ifb9d344228e3c6e9e26fc4fe112686f9336ea2b2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
| |
Change-Id: Ic738f3ea8f91cf2ffc7fb86ad9f72c0d630b6de8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
.qmake.conf
src/qml/types/qqmlbind.cpp
src/quick/items/qquicklistview.cpp
tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
Change-Id: Id6805c13256ad13d5651011e5dd09bba0ec02987
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We should not keep user-created objects in global data structures. This
is inherently thread-unsafe and crashes when the user passes static data
and later unloads the same.
Instead we keep the cached gadgetPtr wrapper objects in the engine now.
Fixes: QTBUG-79553
Change-Id: I24ac3e84b572831d1d70b61b8a6001338579e284
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Inline components are an explicit component boundary, and therefore need
some extra treatment.
Change-Id: I03cc0d58f3565999f64675e8482ed3c3a325e8c0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There's no need to have the property cache fully resolved when checking
for required properties, and it introduces bugs as information for fully
resolving the type is missing at that point.
This would later cause errors in the QQmlPropertyValidator, due to the
propType being wrong.
Fixes: QTBUG-81806
Change-Id: I413cc3fab57f258f5e4cf4164c505312b10543e2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
It is now possible to mark a property of a parent class as required in
the child by writing required <propertyName>
Change-Id: I9e9d58c7b5c00577b056e905b39744b2fa359ea0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| | |
Fixes: QTBUG-81561
Change-Id: I97a0f5013b6e3662ffaad53c5cc871404e11a310
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
[ChangeLog][QtQml] It is now possible to declare new QML components in
a QML file via the component keyword. They can be used just as if they
were declared in another file, with the only difference that the type
name needs to be prefixed with the name of the containing type outside
of the file were the inline component has been declared.
Notably, inline components are not closures: In the following
example, the output would be 42
// MyItem.qml
Item {
property int i: 33
component IC: Item {
Component.onCompleted: console.log(i)
}
}
// user.qml
Item {
property int i: 42
MyItem.IC {}
}
Fixes: QTBUG-79382
Change-Id: I6a5ffc43f093a76323f435cfee9bab217781b8f5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
as type is going to be deprecated.
This change was done automatically with the help of clazy.
In addition, ColumnRoleMetadata was changed to take an int instead
of a QVariant::Type
Change-Id: Ibc02d7b52e7d931a56c19fdebc4788b5e6df2a39
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
No need to have a custom class for an issue that is solved generically
Change-Id: Ic4c5f3abd31037e6ab7dac2ced4ed9eeabfdccfa
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch amends commit 3f96bf1f43252daf26ed61df2b3456f2dc81183b by
ensuring that the allJavaScriptObjects JS stack pointer does not begin
dangling during the deferred binding/property population.
Change-Id: I8fae8ba0e974df2f0d5f40041126ca6f1a6f9436
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
| |
| |
| |
| |
| |
| | |
Change-Id: I5e9ff550aa2875f41dbea797d814e1f0044ebd63
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\|
| |
| |
| | |
Change-Id: Ib381f350ada365747ce20b989bfdc368d75f2219
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The root cause for the issue is that QQmlObjectCreator::setPropertyValue
calls QQmlStringConverters::variantFromString on strings if the property
is of type QVariant. Unfortunately, this cannot be changed easily as the
current behavior is explicitly documented and tested in tst_qqmllanguage,
thus making it a breaking change.
As a workaround, QML Binding does now take a QJSValue instead of a
QVariant (making value a var property), which does not trigger the
conversion path.
Fixes: QTBUG-78943
Change-Id: I0b64dffdb6b84b2bab2bb85a8cb263e530c18570
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If hadRequiredProperties is a property of a specific object creator
instance, we lose the information until the required property gets
noticed in the toplevel creator.
By storing it in sharedState, hadRequiredProperties will always be set
in case we encountered a required property.
Change-Id: I226604175febe36406ca4eae57cab2a3a6be9777
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If a delegates declares a required property of a given name, and that
name exists as a role in the model, we set the property accordingly.
The same holds true for the special properties that come from the
QQmlDelegateModel like "index" and "model".
All roles are still injected into scope and thus accessible;
changing this in Qt5 would be tedious or even impossible while still
maintaining backwardscompatibility with delegates that do not use
required properties.
Change-Id: I4f388ba549c42f1ff9822bdb3b8357c4d45e4b66
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[ChangeLog][QtQml]
"required" is now a (contextual) keyword in QML, and users can
mark properties with it to specify that those properties must be set
when the component gets instantiated.
This can be done either declaratively via standard property
bindings from QML, or imperatively by using the functions to set initial
properties (QQmlCompoent::setInitalProperties and related functions in
C++, Qt.createObject, Loader.setSource,... in QML/JS).
Logic has been added to QQmlComponent::create and the various QQmlIncubator
classes to verify that the required properties were set. If properties
marked as required are not set, a warning will be printed at runtime,
and the component will not be created.
Change-Id: I8e38227fc8f173b053b689c1597dc7fd40e835e7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Extends grammar to support generator functions in QML components and
adjusts codegen accordingly
The corresponding test case must be blacklisted in tst_qmlmin, as qmlmin
cannot handle yield statements
Fixes: QTBUG-77096
Change-Id: I47d45dd56289cdf073b41932a585259d3052de04
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
It is only used in the runtime.
Change-Id: I93bc91a97f7a6967cdf49f2eb5c32b47217d905f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
| |
No one can read this mess.
Change-Id: Icec4f2afc466435c1ae5e4e80fa2c1b5baf7d087
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
| |
Fixes: QTBUG-76932
Change-Id: I05c8dba8c7339fe79c9d7de9158a0eb9e041579d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
.qmake.conf
Change-Id: I20ad6f8a260f387a3b73566a32c35a5772b401a5
|
| |\
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
.qmake.conf
Change-Id: Icd05d016de5b4cf9af5234cb47b5c3fd0f6a053e
|