aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Fix singleton declaration in qt6_target_qml_targetJoerg Bornemann2020-10-201-1/+1
| | | | | | | | The declaration is to be written without the square brackets. Fixes: QTBUG-87684 Change-Id: I8fb7fb1f9204cb56d2fa1e2c10ec585ff0e2b512 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Adjust to public API renaming in qtbaseAlexandru Croitor2020-10-181-1/+1
| | | | | | Task-number: QTBUG-86827 Change-Id: Ibeae878cbd7cc43031aeb13b2c480215c849f8bc Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Adapt QMutexLocker to qtbase changeFabian Kosmale2020-10-182-2/+2
| | | | | Change-Id: Ica9561a42217f5a509a6e84e9e48036ec6348e48 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* CMake: Mark some of the public APIs as TPAlexandru Croitor2020-10-161-1/+6
| | | | | | | | | | We don't have tests for them yet. The API surface is quite big. Some options might not make sense anymore. Task-number: QTBUG-86827 Change-Id: I4aebdb2cdfa716433681d32967ab32f1c171925c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Rely on default parameter in QUnifiedTimer::updateAnimationTimerVolker Hilsheimer2020-10-151-1/+1
| | | | | | | | Allows that parameter to be removed in qtbase. Change-Id: If409d91d0e3a542106790759b8916858eca546e4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* CMake: Add generated qrc files to the qmlimportscannerCristian Adam2020-10-151-1/+7
| | | | | | | | | | | | The list of generated qrc files is passed to qmlimportscanner via the -qrcFiles parameter. qt_import_qml_plugins(pointer) needs to be explicitly called in CMake unlike qmake which does the equivalent behind the scenes. Task-number: QTBUG-85994 Change-Id: Ia49a5e1fe5df11c0b3b8ff4c1765377767ca2478 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Use qt_internal_add_plugin in qt_internal_add_qml_moduleAlexandru Croitor2020-10-131-1/+1
| | | | | | | | | The implementation means to call qt_internal_add_plugin because that's the one that handles the 'QML_TARGET_PATH' option. Task-number: QTBUG-86827 Change-Id: I3289741458cb8038f576bc4b08617f42fce98710 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix alwaysRunToEnd==true prevented complex Anim from stoppingPiotr Mikolajczyk2020-10-132-0/+4
| | | | | | | | | | AnimatorProxyJob would not forward loopCount to the controlled job causing the sequential or parallel animation to go infinitely after attempt to stop Task-number: QTBUG-82890 Pick-to: 5.15 Change-Id: I6a1ca787f06789064e05407bbe9ae5e5861f24d5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CMake: Rename qt6_quick_compiler_process_resources to be internalAlexandru Croitor2020-10-131-2/+2
| | | | | | Task-number: QTBUG-86827 Change-Id: Idb9934d18dbe54baf223d30923b03becd3e53a50 Reviewed-by: Simon Hausmann <hausmann@gmail.com>
* Fix QProperty property interaction with aliasesFabian Kosmale2020-10-125-5/+24
| | | | | | | | | | | | | | | | 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>
* QQmlMetaType: Cast the type interfaces to const when deletingUlf Hermann2020-10-121-2/+2
| | | | | | | | We don't need them to be mutable, and the return type of the function will become const soon. Change-Id: I3016d80df31db981d47296e468e93336d3a79ce1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QPropertyChangeTrigger: Inherit directly from QPropertyObserverFabian Kosmale2020-10-123-11/+15
| | | | | | Change-Id: If2ffeef14d33200e39fb8b3e7fd88c232164a241 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Update QStringConverter usageMårten Nordheim2020-10-091-2/+2
| | | | | | | Following fa8d021fa6fcb040fb702b6ffd2deee52a3b748a Change-Id: I89c0231655ec853cef9465e5a88a92d7e0085d30 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QQmlPropertyValidator: only use string converter for stringsFabian Kosmale2020-10-091-10/+26
| | | | | | | | | | | | | A recent change in fromIsoTimeString exposed the fact that we are using QML's string converters to check whether a binding expression is valid for a given property. However, while we begrudgingly accept that string representations shall be converted to value types via the string converters, the same shouldn't hold true for things that aren't actually strings - for instance, numbers. Fixes: QTBUG-87299 Change-Id: Iefd390efae7c193dc32d37e63943b39e09c9295a Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Allow optional imports in qmldir filesUlf Hermann2020-10-087-73/+109
| | | | | | | | | | This is useful for modules that select their imports at runtime using qmlRegisterModuleImport(). We can list all possible variants as optional imports so that tools can see what types might be available. Task-number: QTBUG-87130 Change-Id: I8a37bdde79aef3619fd1f05e5ea6781d521afa88 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Allow installation of qmltypes filesUlf Hermann2020-10-082-0/+19
| | | | | | | | This is what qmake does on install_qmltypes and we do want to install the qmltypes files of our own modules. Change-Id: Iad430aab87f21331abf332ca5c92f9d7edc47bb0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add versionless functions for new public APIAlexandru Croitor2020-10-061-0/+17
| | | | | | | | | Add some missing versionless functions. Task-number: QTBUG-86827 Change-Id: I98c554429555a7692b1315658884c173129cbe81 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Remove old Qt 5 CMake build system filesAlexandru Croitor2020-10-061-7/+0
| | | | | | Task-number: QTBUG-86827 Change-Id: I4c951093995c47bb38ee23ab97acf0b4a1e07ce7 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* CMake: Regenerate projects to use new qt_internal_ APIAlexandru Croitor2020-10-062-74/+74
| | | | | | | | Modify special case locations to use the new API as well. Task-number: QTBUG-86815 Change-Id: I3b964e3baf0cc7040830156dac30358ea1152801 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* QQmlDirParser: Return typeinfos as string listUlf Hermann2020-10-062-15/+4
| | | | | | | ... and notice that we don't use them so far. Change-Id: Id57c5a45307fb8425207635b266b81a942b7651c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Allow the same syntax for depends and import entries in qmldirUlf Hermann2020-10-061-9/+13
| | | | | | | | | | Our qmldir parser does the same now and we need it in order to declare auto dependencies. Task-number: QTBUG-87164 Change-Id: Ie70474e238283c2ba936aeff49fb35acfd843da6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Doc: use editingFinished signal of TextInput instead of textChangedMitch Curtis2020-10-061-1/+1
| | | | | | | | | | The former is only emitted as a result of user interaction, whereas the latter is also emitted as a result of programmatic changes. It's better to use editingFinished(). Pick-to: 5.15 5.12 Change-Id: I71bb084bced6c33d940f550b5e3b2e57df45bd3c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* XHR: allow the user to set the User-Agent headerGiuseppe D'Angelo2020-10-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | The Fetch spec has allowed it for a while (in other words, it's no longer forbidden): * https://fetch.spec.whatwg.org/#terminology-headers * https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name Cf. also * https://github.com/whatwg/fetch/issues/37 * https://github.com/whatwg/fetch/commit/dab09b0c483c46324082df1e54b29ed4c9c02162 [ChangeLog][QtQml][XmlHttpRequest] It is now possible to set the User-Agent header. Change-Id: I1d5bd785223e9df2883011f873d440a63e363a24 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlMetaType: Grudgingly accept uppercase value typesUlf Hermann2020-10-051-3/+7
| | | | | | | We throw a warning instead of an error. Change-Id: I0f5886a2d46582405ae1d57879ccb3937e27950f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlProperty::write: historical reason does not hold in Qt 6Fabian Kosmale2020-10-031-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | There was a codepath which checked after a failed QVariant conversion whether the variant is valid and is null at the same time. In that case, the conversion would be treated as successful. The motivation for this can be traced back to QTBUG-37197, and our handling of strings. However, since those times various things have changed: - QVariant::isNull() does not return true anymore if its contained type is null. Thus the conversion of a QVariant holding a null QString will not lead to a conversion failure (as long as the target type is actually a conversion target for a QString). - A failed conversion will always leave the resulting variant in a state in which it is valid. The latter is rather problematic, as we would thus always enter the code path when the source QVariant happened to be null; even in the case where the source and target types are really incompatible. This can for instance be observed in tst_qjsonbinding, where assigning null to a QJsonArray would suddenly "work", thus leading to a test failure. However, thanks to the first point, it is safe to completely remove this code. Change-Id: I176a5c4b04295d128919cab8a333b8a5a2c2345d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Simon Hausmann <hausmann@gmail.com>
* qmllint: Unify injected and "normal" JavaScript identifiersUlf Hermann2020-10-021-0/+13
| | | | | | | | The specifics of how to warn about the injected identifiers are moved out of ScopeTree as that is not related to the structure of the scopes. Change-Id: I26418c3fa492da8339abf045a4034a8464b7bbb8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use factory functions and ctors for creating value typesUlf Hermann2020-10-0214-80/+101
| | | | | | | | | | 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>
* V4: Rewrite qv4sequenceobject based on QMetaSequenceUlf Hermann2020-10-0212-339/+343
| | | | | | | | | | This avoids the template explosion and makes the mechanism extendable. You can now register additional anonymous sequential containers. Fixes: QTBUG-71574 Task-number: QTBUG-82443 Change-Id: I5b9ed9af1533a3b7df8fc5bb37bbb73b8304e592 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qqmlimport: Use stable_partition instead of stable_sortFabian Kosmale2020-09-281-2/+2
| | | | | | | | | | | | We do not actually need to sort the imports list, we just require that all inline component imports come before all other imports. This avoids triggering a MSVC STL debug assertion about the used Compare function not actually creating a strict ordering. Fixes: QTBUG-86989 Pick-to: 5.15 Change-Id: I381852392545287ec02b186fcb4f33be3ae95b33 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Export QQmlLocale symbolsVolker Hilsheimer2020-09-281-4/+4
| | | | | | | | | After 8e222a70d19d5eef616e1d6306415da64fbab4cb, QQmlLocale is a namespace and doesn't export any symbols. Export the member functions explicitly, as they are needed by Qt Quick Controls. Change-Id: I867cb5c0325c6c19200408b514c086c8057c82a9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Adapt to changes in QMetaSequenceInterface and iterablesUlf Hermann2020-09-251-7/+7
| | | | | | | | metaSequence() became metaContainer() and we should ask for canConvert() as there are two ways to convert to a container. Change-Id: Iba868491ff9d2cc8fc89de1cab29818b834b53f4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlDirParser: Treat dependencies like importsUlf Hermann2020-09-252-24/+15
| | | | | | | In particular, allow auto and latest versions. Change-Id: I4a6b26112950d066ae2d8a37dc0e9fa1dec24724 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: Rename internal functions to contain qt_internalAlexandru Croitor2020-09-251-4/+10
| | | | | | | | | Offer compatibility wrapper functions until we update all of the Qt repos to use the new names. Task-number: QTBUG-86815 Change-Id: I834ac1d5d6549bd4e33b9916a2198a7a03c0d183 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QQmlTypeCompiler: Resolve aliases earlierFabian Kosmale2020-09-231-11/+12
| | | | | | | | | This is a prequisite for determining whether a change handler of an alias should use its change signal, or whether it can use the alias target's bindable interface. Change-Id: I6f5220a6889601327cb478479c7c9e58f1a64d97 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Condense the different value type creation functions into oneUlf Hermann2020-09-236-51/+26
| | | | | | | They all did the same thing. Change-Id: I7661b19ad16c0713d46c4df337899e3897349b2e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Eliminate QQmlValueTypeProvider::storeValueType()Ulf Hermann2020-09-233-23/+4
| | | | | | | | | | | | 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>
* Eliminate QQmlValueTypeProvider::createVariantFromString()Ulf Hermann2020-09-233-23/+1
| | | | | | | This can be expressed as constructing the variant from a QJSValue. Change-Id: I3140958469423acdc498e26129e349bcfb601198 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Eliminate QQmlValueTypeProvider::createFromStringUlf Hermann2020-09-236-99/+29
| | | | | | | It can be expressed as a special case of create() with a QJSValue. Change-Id: I7342026ad694077d2780dd8a852714fa72dd68d0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove QQmlValueTypeProvider::variantFromJsObjectUlf Hermann2020-09-233-9/+9
| | | | | | | This can be expressed in terms of create(). Change-Id: Id1950390bf4a1c9dfd9364ea351b81c75eb7e28f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlValueTypeProvider: Pass arguments as QJSValueUlf Hermann2020-09-233-74/+26
| | | | | | | | This is so that we can replace them with factory functions as a next step. Change-Id: Ic8619e4e779bd3e47471642c556601555758697b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Allow proper registration of value typesUlf Hermann2020-09-2312-167/+231
| | | | | | | | | | | | | | | | | | | | You can now have an extension object on a value type that offers additional properties. This is how we model the QtQuick value types. It allows us to retrieve the extension's metaobject without using the virtual functions in the value type provider. As before, this mechanism is still rather dangerous and not fit for public consumption. It relies on the extension object having exactly the same layout as the original value type, and it hides any properties the original value type might expose. Furthermore we enforce now that gadgets should have lowercase names. The ones that didn't before are split up into an anonymous value type and a namespace that contains all the addressable bits. Task-number: QTBUG-82443 Change-Id: Ic93d6764538d6ccc0774b3c5648eee08ba0939c0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix ubsan errorAllan Sandfeld Jensen2020-09-231-5/+9
| | | | | | | | memcpy can't officially copy from nullptr, not even 0 bytes. Pick-to: 5.15 Change-Id: Ie6ede9a861cb2ae7ab35a50db5aa6c82cea6ad76 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Avoid crash when module version cannot be resolvedEskil Abrahamsen Blomfeldt2020-09-231-1/+5
| | | | | | | | | | | | | | | When QQmlMetaType::latestModuleVersion() returned an invalid version, we would fail importStaticPlugin() without adding any error. Since we unconditionally called takeFirst() on the errors list, we would later crash. The precondition here is that any failure adds an error, so we now assert to make this explicit. Also, add a simple module not found error when we can't resolve it. Change-Id: I7a13775b2ef56d95b7738ac53e58501b8c68895f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Prevent crash when destroying asynchronous LoaderJoni Poikelin2020-09-231-1/+1
| | | | | | | Fixes: QTBUG-86255 Pick-to: 5.15 Change-Id: I30488b64d910a1409a43e2e98ee7ab084aec33d2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlPropertyCapture: Replace list with forward listFabian Kosmale2020-09-222-1/+11
| | | | | | | | This required adding one missing function from QFieldList to QForwardFieldList, but saves one pointer and one quint32. Change-Id: I022fcd2e6bffe39b2d01f4664fd2ab154445fb00 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Replace QmlVoidT with std::void_tUlf Hermann2020-09-221-14/+11
| | | | | | | Now that we can use C++17 we don't need to invent our own. Change-Id: I6c6e02ac9b48f2fbe88160e7f9ebf9655092c9fc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Handle QProperty inside bindingsFabian Kosmale2020-09-215-6/+74
| | | | | | | | | | | | | | | | | | | If we have a binding containing QProperties, and the binding target is an old style binding, still we have to trigger an update if any of the captured properties changes. We cannot reuse the QQmlJavaScriptExpressionGuards as those depend on Qt's signals, and a QProperty is not associated with a change signal in the general case. Therefore, we introduce a new list of QPropertyChangeHandler, which when triggered cause a reevaluation of the binding. As an optimization, we skip the whole capturing process for QQmlPropertyBinding, as that one already takes care of updating itself. Reverts 845bbb99a41a3e4f05c2b3d05d6db748c825dca0 (because skipping the capture is only possible when _both_ the bindee and the property in the binding are QProperty based.) Change-Id: Iafed2a41dcd708bcc33912ce810d803949379c63 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Rename QQmlQPointer to QV4QPointerUlf Hermann2020-09-218-14/+14
| | | | | | | You can wrap QObject pointers in plain JavaScript. Change-Id: I246a72a7d5d7b2562e722bf9eafc7880b772a806 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Rename QQmlSequence to QV4SequenceUlf Hermann2020-09-213-72/+72
| | | | | | | This feature is available without QML, in pure JavaScript. Change-Id: Iec8a52ed10ed3eeaec24d3955c8c132bf2bd9677 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Adapt to change in QMetaSequenceInterface::valueMetaTypeUlf Hermann2020-09-181-1/+1
| | | | | | | | valueMetaType is a QMetaTypeInterface* now. Change-Id: If7e12e89b1801258d9e0892cbfb3b70b85b52376 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>