aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* examples: Make qmlextensionplugins example usable without installationUlf Hermann2020-01-142-6/+17
| | | | | | | | | | The qmldir file as well as the .qml files have to be placed next to the plugin, the import path has to be added to the .qmlproject, we want the .qmltypes file added to the same place, and the plugins.qml should also be available in the destination directory. Change-Id: I82b369693e612779c6213345cc8f6a30b16d41b4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* qmllint: Consider failure to find imports an errorUlf Hermann2020-01-133-3/+4
| | | | | | | | There is no real reason to tolerate it. We can generate all qmltypes at build time, and if we can't find them, the results are likely to be off. Change-Id: Id935d76ac3ca6b601381b40a73d7fbacca342c4d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Consider attached propertiesUlf Hermann2020-01-133-0/+17
| | | | | | | | | We cannot figure out who attached properties to what, therefore we consider any uppercase property we cannot locate as a potential attached property. Change-Id: I60508b9e4e038a51b87c56edf0796ac492aa3fa0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: parse simple type assertionsUlf Hermann2020-01-137-9/+63
| | | | | Change-Id: Ic24018137d8f989686d4a8f927efb824453d114b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Assume "parent" property is always document parentUlf Hermann2020-01-137-0/+49
| | | | | | | | ... except if the document parent is Component. Then leave the type alone. Change-Id: Id7b2e6efdefe18a8d375967ddedcdf9e07a07946 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Resolve aliasesUlf Hermann2020-01-1311-128/+304
| | | | | Change-Id: Ida53af9774dc72559395064169113d0ee1f47f24 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: Analyze member accessUlf Hermann2020-01-139-78/+312
| | | | | | | | | We can analyze access to many field member expressions and figure out if the accessed members exist. There are limits to this, of course. Generic JavaScript values are out of scope here. Change-Id: Id2e7613e56f06555cc3a2ba1c51683d9ea0bb84b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlMetaObject: Don't assert on validity of list propertiesUlf Hermann2020-01-131-11/+16
| | | | | | | | | | Apparently the memberdata can be nullptr as long as you don't try to access it. This is what readPropertyAsList() does, and the ResolvedList ctor should follow suit. Fixes: QTBUG-81032 Change-Id: I9133ea9f7889884b2e91dba7630c4827fc97136d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Doc: Explain how to specify multiple paths in QML2_IMPORT_PATHUlf Hermann2020-01-131-0/+7
| | | | | | | | And why you cannot specify URLs or resource paths that way. Task-number: QTBUG-69435 Change-Id: Ia6aac89239302bcfe625f4cca877b74be065e800 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add PointerScrollEvent QML registrationShawn Rutledge2020-01-131-1/+5
| | | | | | | | | | Since registration of this type was neglected in 5.14 (yet was still usable in WheelHandler.onWheel() { } anyway), it didn't get included in cc1a604c704f848927b3fa0a97b0a50b0b79d2a4. Task-number: QTBUG-81302 Change-Id: I24645f4f982310655901c45aca6cdccfbafa911e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Generate registrations for all examplesUlf Hermann2020-01-1396-455/+667
| | | | | | | | Now that we can generate all QML type information at build time, we should also use it. Change-Id: I647c72bbe38fdb2deb565b75c86a696af3d15b61 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Binding example: Fix type registrationFabian Kosmale2020-01-131-0/+2
| | | | | | Fixes: QTBUG-81335 Change-Id: Ie93c9b7ad49703bce245592e659ccdb6ea2b7ed9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QML list property: Avoid crash if contained object is deletedFabian Kosmale2020-01-134-9/+66
| | | | | | Task-number: QTBUG-81123 Change-Id: I3dd1a42e444f817722368cd268c2f987a99fbf1c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlImport: Allow importing multiple versions of the same moduleUlf Hermann2020-01-102-1/+24
| | | | | | | | | Previously, once a plugin had been loaded, the static module registrations were disregarded. Therefore, if there were static and dynamic registrations in the same plugin, only one set was ever loaded. Change-Id: I24f52cc579a833041c51f15555caf226a6189c99 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmlformat: Fix default construction of CommentUlf Hermann2020-01-101-2/+2
| | | | | | | m_location would be uninitialized. Change-Id: Ieeeb0c0783a0b8e6f919019bd2ddcc1752993eaf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmllint: parse JS files for methodsUlf Hermann2020-01-105-140/+206
| | | | | Change-Id: I3888231ac82f9babd51e6332af3c5457bf3c9141 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Generate registrations for all importsUlf Hermann2020-01-1074-11038/+158
| | | | | | | | | | | | | | | | Now that we can generate all QML type information at build time, we should also use it. Move the types for QtTest into the testlib import plugin. They don't need to be exported from QtQuickTest. Trigger the resource initialization of the shapes library from the plugin so that we retain a dependency and the linker doesn't optimize the module initialization away. Change-Id: Icc8cb338aa03ef1e3085e29356a5db7b73ba0a01 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make draganddrop example less confusingUlf Hermann2020-01-103-44/+109
| | | | | | | | | | | | Use required properties, rather than context, use direct binding rather than Binding elements, clarify that we're using the drag passed as parameter, not the drag property of DropArea, move Icon to a different file so that we get a distinct type for it. Give the icon a defined color while it is being dragged. Change-Id: I0e8b77abaedb9fc52660dfd4ddef1a4161f1323a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* tst_qqmlmetatype.cpp: Avoid memory leaksUlf Hermann2020-01-101-4/+6
| | | | | Change-Id: Ic4ff36e48a1ff5146ec44f58ed416fd24cce5330 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_qquickanimations: Avoid memory leaksUlf Hermann2020-01-101-93/+125
| | | | | Change-Id: Idc44c6ef91417ec0fe24ec95023f52c8ed61ece0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_qmldiskcache: Increase compile timeoutUlf Hermann2020-01-101-1/+3
| | | | | | | | | Apparently some machines on the CI take north of 10s to compile a component. Change-Id: Ia01c55c0f248e061bea8a3bc194c65e4e5f663b5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* qmllint: Clean up access to m_exportedName2ScopeUlf Hermann2020-01-101-11/+12
| | | | | | | | Don't accidentally overwrite the anonymous scope, and clearly mark where we want to modify the scopes and where we just want to retrieve them. Change-Id: I801d378ccaea6eb2548875766a9d3141dcb9f5e5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Qt Forward Merge Bot2020-01-0937-106/+700
|\
| * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-0937-106/+700
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/particles/qquickitemparticle.cpp src/qmlmodels/qqmladaptormodel.cpp tests/auto/particles/qquickitemparticle/tst_qquickitemparticle.cpp Change-Id: Ibd8fbb91da6893a09f4ffe61ad0b95d8149bbc87
| | * Fix unused variable warning on big-endianShawn Rutledge2020-01-081-0/+2
| | | | | | | | | | | | | | | | | | | | | Fatal because of -Werror. Change-Id: I535848be1c733c0718779c8a4c8c93ed3873cc88 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
| | * V4: Avoid integer overflow on typed array length checkUlf Hermann2020-01-082-2/+41
| | | | | | | | | | | | | | | Change-Id: I370b4c4bd0d7962878849ca7c5edef6cb36eca25 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| | * Check stack limit in FunctionPrototype::method_apply()Ulf Hermann2020-01-082-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | We could just crash there, assuming unlimited memory, but as this particular place seems to be a very attractive target for various mischief, let's just plug it. Change-Id: I3b0369ceb34dafd12ce8dc1f189fc5f9ee82c169 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| | * V4: Don't crash when iterating invalid Proxy objectsUlf Hermann2020-01-083-2/+17
| | | | | | | | | | | | | | | | | | Fixes: QTBUG-81109 Change-Id: I97f37c68d33f414d7bffa9b66e0aaed93370dc68 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| | * V4: Don't crash when sorting arrays with non-stringifyable entriesUlf Hermann2020-01-082-0/+18
| | | | | | | | | | | | | | | | | | Fixes: QTBUG-81108 Change-Id: I7e121776a2416b5338c4c1309ec7cc31c703ad28 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| | * Fix unused variable warningShawn Rutledge2020-01-071-2/+1
| | | | | | | | | | | | | | | | | | | | | This was fatal because of -Werror. Change-Id: Ibe06f77d4728268af3f099554f7151bdaf9ac26b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * Stabilize QQuickItemParticleLouis du Verdier2020-01-074-46/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes two crashes and a memory leak in QQuickItemParticle. The first crash was caused by the list m_loadables that kept pointers on QQuickParticleData, that could in the meantime become dangling pointers if the associated particle expired or got deleted by a call to the reset() method of the particle system. Its role was to keep a list of particles that did not have a delegate instantiated yet, in order to create them in the tick() method. This list is removed and the list of particles to handle is directly deduced in the tick() method. The second crash was caused by the list m_deletables that could in some situations (generally due to a reset()) contain multiple times the same delegate, and therefore cause a double delete in processDeletables(). This list is changed to a set to avoid this situation with a minimum impact on the rest of the code. The memory leak was caused by the m_managed list of delegates that was not freed when QQuickItemParticle gets deleted. Task-number: QTBUG-71193 Change-Id: I6fe30ee59a9a0bb90c14c62c7a48a50f465a9e0c Reviewed-by: Mikhail Svetkin <mikhail.svetkin@gmail.com>
| | * QV4: Support printing arrays with circular referencesFabian Kosmale2020-01-072-4/+22
| | | | | | | | | | | | | | | | | | Fixes: QTBUG-81105 Change-Id: Iaf0597cea3a5572f020c5f87a843774f33cc01fd Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * QV4: Array.includes: Support large arraysFabian Kosmale2020-01-072-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | Creating new ScopedValues in the loop was quite wasteful, and would trigger a crash. We now simply reuse the ScopedValue. Fixes: QTBUG-81104 Change-Id: Ie1efd144886861a21c8f6827d7fd23699a1e0dcc Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * QV4: Check recursion limit in toStringFabian Kosmale2020-01-072-0/+23
| | | | | | | | | | | | | | | Change-Id: I18b7a4e00150f6c47c991a5164901159b7f946b9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * QV4MM: Fix crash caused by MarkStack overflowFabian Kosmale2020-01-074-1/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MemoryManager::collectFromJSStack did push to the mark stack without checking if there is actually still space available. To fix this, we now drain the stack once we hit the limit. The test case is a slightly modified version compared to the reported one, removing one loop. This was required as our regular expression does not throw an exception when there are too many capture groups. However, to trigger the bug, looping was not actually necessary. Change-Id: I4d00865f25a989c380f4f5b221f4068c80b71d2b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * V4: Catch error when compiling broken RegExpsUlf Hermann2020-01-072-2/+19
| | | | | | | | | | | | | | | | | | | | | Otherwise we try to assign an invalid RegExp object, which crashes. Change-Id: I85478406524a2a9d7542758caaa1b42b4090bb93 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| | * V4: Fix sorting of sparse arraysUlf Hermann2020-01-062-1/+22
| | | | | | | | | | | | | | | | | | | | | setArrayData() needs to handle a nullptr argument. Change-Id: I1ea05d9db9beb1fede6d3c068cfcf700702e8aa6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| | * Avoid oob access on Array.concatUlf Hermann2020-01-062-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we have already determined that we're past the end of the allocated space on the source object by checking os->values.alloc, we should conclude that all the remaining values are undefined. Fixes: QTBUG-81037 Change-Id: I664f22b7eb37c26061e8a9e2f88bcf2a7b6e09f3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| | * Emit QQmlEngine::warnings when load failsFabian Kosmale2020-01-063-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | This uses the existing infrastructure for reporting QML errors, instead of simply using qWarning. Fixes: QTBUG-81093 Change-Id: Ie18656a57f28fa9dfe922936fd05b44ebe1281e2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * QV4::Engine: replace std::function with a function pointerFabian Kosmale2020-01-062-5/+5
| | | | | | | | | | | | | | | | | | | | | Turns out, we actually do not need to capture anything Change-Id: I6194b45a1e8053be079d25a6d81212fa226fd3ea Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * QV4::ExecutionEngine: provide QNAM accessorFabian Kosmale2020-01-037-2/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In XMLHttpRequest, we need to get the QNetworkAccessManager from the engine. However, if the request originates from a WorkerScript, there exists no qmlEngine. We therefore add a new indirection to access the QNAM, and set it up accordinly in registerWorkerScript. Fixes: QTBUG-81055 Change-Id: I8915202b6d6b7139c8386304b3d1d7a22a82045e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * QQuickWindow: make subFocusItem a QPointerFabian Kosmale2020-01-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | While running the fuzz tester, a crash was found related to the fact that the subFocusItem was already partially deleted. Task-number: QTBUG-34779 Change-Id: I62c48cf40baabc9f0a81074cc6408e9073459165 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Fix the build with -no-guiLiang Qi2020-01-021-0/+2
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-74602 Change-Id: I08e8df96b10fbc0b58fbdae296c9d54de977e3f9 Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
| | * QQmlAdaptorModel: Guard access to wrapped AIMUlf Hermann2020-01-021-32/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The QAbstractItemModel may be nullptr, in particular when it gets deleted from the outside. In some places we did check for that, via operator T* from QQmlGuard, in others we didn't. The checks were quite hard to read as "if (model)" first invokes a conversion operator on a base class and then implicitly converts the result to bool. Similarly adventurous, "if (*model)" invokes operator* on a base class and then converts the result to bool. Make all the checks explicit, and add new ones where they were missing. Also, as we already retrieve the AIM in order to check it for nullptr, re-use it for the actual operation. Task-number: QTBUG-80963 Change-Id: I3548e22e9d2bef485a1cd4acf70839eb8e599e62 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Use the correct icon filename for QML Runtime on WindowsShawn Rutledge2020-01-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Amends d7b7fed0cddf6236db3cf1bfdf9cc1380929cf5c. Task-number: QTBUG-70826 Change-Id: If9b74d19c4fc2bbe3ae882b4767919c74f3a38af Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
| | * QV4Engine: support conversion of QJSValue to SequenceTypeFabian Kosmale2019-12-203-0/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 8704c640946ac852668638e2980d3e2b78aa27ae introduced new conversions via sequentialIterableToJS. Due to that, QVariant properties which formerly stored e.g. std::vector<QObject*> now would store a QJSValue. Those would still claim to support a conversion to QVariantList, but -contrary to what our documentation says-, we were not able to do a conversion to QSequentialIterable. The default constructed QSequentialIterable would then crash when calling begin(), as that function pointer was null. This patch fixes this by adding the necessary support to convert a QJSValue containing an array. Non-array QJSValues will still return an "empty" QSequentialIterable. Note that this changes what happens when a QJSValue is converted to a QVariantList, as QVariantValueHelperInterface<QVariantList> will check first if there is a converter to QSequentialIterableImpl before attempting to call any directly installed converter to QVariantList. In order to not change the existing behavior, the QSequentialIterable returns the QVariant corresponding to the QJSValue at a given array position, intead of a QVariant containing the QJSValue. Fixes: QTBUG-80609 Change-Id: I8101229c0d2043b3f2d618ed035b279844802dd8 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * Fix usage of qtquickcompiler.prf after lrelease.prfJoerg Bornemann2019-12-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider a project that sets CONFIG += lrelease embed_translations qtquickcompiler qtquickcompiler.prf is loaded first and loads resources.prf. Then lrelease.prf is loaded and extends RESOURCES. The latter changes are never picked up, because resources.prf was already loaded which is recorded in QMAKE_INTERNAL_INCLUDED_FEATURES. Use the newly introduced qtFlattenResources function instead of fully loading resources.prf. Task-number: QTBUG-79672 Change-Id: I1894ede97b4d5de567971a1a8cef407460bba97d Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | | qmlformat/dumpastvisitor: Fix a few segfaultsMaximilian Goldstein2020-01-091-3/+8
|/ / | | | | | | | | | | Change-Id: Ic8e95944cf36000a004d010293a532101433c3af Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | qmltyperegistrar: Improve resolution of module dependenciesUlf Hermann2020-01-081-2/+4
| | | | | | | | | | | | | | | | | | Previously transitive private dependencies would not be resolved as resolve_depends would return a foo_private, for which we wouldn't find a Qt.$${dep}.module. Change-Id: Ie8d91d6c82c0d2f2e441a9eb662a14ef9bd82051 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | qmlformat: Fix whitespace for parameter defaultsMaximilian Goldstein2020-01-082-5/+5
| | | | | | | | | | Change-Id: I7958bf1546cc5854fc9b9856e36928ea932af0ca Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>