aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/ftw
Commit message (Collapse)AuthorAgeFilesLines
* Use a QDoubleEndedList for the children of animation group jobsUlf Hermann2021-02-051-0/+292
| | | | | | | | | | This way it's fundamentally impossible to add the same animation job to two different group jobs. The pointers are not exposed anymore and no one can re-order the jobs. Task-number: QTBUG-90401 Change-Id: Iebff4b64960c853915dd32714acd144fc5cdc00d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove the qmake project filesFabian Kosmale2021-01-151-26/+0
| | | | | | | | | Remove all qmake project files, except for examples which are used to test that qmake continues to work. Change-Id: Ic4abb72dc2dcd75df7a797c56056b6b3c5fe62ac Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-12-161-1/+1
| | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in QtDeclarative. As the two are synonymous, this patch should have no impact on users. Task-number: QTBUG-86829 Change-Id: I5bb418483a3b06619abb4ff62cf0290a7b3bcd4f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlPropertyCapture: Replace list with forward listFabian Kosmale2020-09-221-0/+10
| | | | | | | | 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>
* Add equality operators for QQmlError and QQmlRefPointerUlf Hermann2020-07-151-0/+1
| | | | | | | We need those to declare QProperties. Change-Id: I49bf656607931e5d50f6a07cac92b7e176bb2b75 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Compile against latest qtbaseLars Knoll2020-07-091-6/+11
| | | | | | | Adjust to the lastest changes in QList and QString. Change-Id: I216b2746a3305222a21c5aead3aec6106ac1f035 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port QtDeclarative from QStringRef to QStringViewKarsten Heimrich2020-06-162-4/+4
| | | | | | | | Task-number: QTBUG-84319 Change-Id: I2dcfb8a2db98282c7a1acdad1e6f4f949f26df15 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Adapt QML's QString-internal hacks to use char16_t, not ushortEdward Welbourne2020-05-201-5/+5
| | | | | | | | | The QML engine pokes around in QString's privates, so will break when we change those privates to use char16_t; this patch shall fix that up, once the char16_t-ification of QString has landed in qtbase. Change-Id: I5302c339f3c892ff977c8ebb521ff4c82d237885 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Change qHash return value to size_tFabian Kosmale2020-04-161-2/+2
| | | | | | | | Else on Windows there's a warning: conversion from 'size_t' to 'uint', possible loss of data Change-Id: Ifed4899409a13fed31c206ae1e0f195280ee2925 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Replace QFlagPointer with QTaggedPointerSimon Hausmann2020-04-035-276/+77
| | | | | | | | The latter has the advantage of allowing the use of a real type for the tag, instead of the generic flag/flag2 boolean accessors. Change-Id: Icc9e854ce4af3eb5808a4bed45aa22f377e223da Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix workflow for shutting down busy type loader threadsUlf Hermann2020-02-121-12/+10
| | | | | | | | | | | | | | We need to set the shutdown flag right away in order to prevent further thread events from getting scheduled. Those might lead to deadlocks. On the loader thread's side, however, we need to process the existing events before we process the shutdown flag, in order not to leak the events. After we are done with this routine, the thread will finish by itself. We don't need to wait on our mutex anymore. It's enough to wait on the thread itself. Task-number: QTBUG-75777 Change-Id: Id0afcb492d84617c78ff3bf94d0cc402aef2faa4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-01-202-0/+20
|\ | | | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlvaluetype.cpp tests/auto/qml/qml.pro Change-Id: I78f992f83212bb9fd5e09b64163f15f046185224
| * QHashedStringRef: add split methodFabian Kosmale2020-01-172-0/+20
| | | | | | | | | | Change-Id: I971e8d7ceb4acfbe53d8b35c249eaa872f181839 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Make QtQml work with the latest changes in qtbaseLars Knoll2020-01-142-25/+37
|/ | | | | | | | | | | | Adjust the code to work with the new QString and QVector data structures that have inlined size and data pointers. Fix a large bunch of compiler warnings from QFlags. Update dependencies for qtbase and qtsvg Change-Id: Iba237aed90c140b822e0cf501b9fb7156ec27c2d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QFlagPointer/QBiPointer: insert static assertions in addition to dynamicThiago Macieira2019-10-161-0/+16
| | | | | | | | | Static assertions weren't really a thing back in 2012 when Aaron wrote this code. Change-Id: I8d95fbaf90e842b9b44dfffd15cde4c154e22810 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QML: Extend QML loader thread's stack sizeErik Verbruggen2019-10-161-0/+3
| | | | | | | | | | | By default, on some platforms non-main threads have a very limited stack size. Extend it so that we can parse more deeply nested QML/JS files. The parser expects a stack size of 8MB. Task-number: QTBUG-71078 Change-Id: I5edd6630c870e45c3dbe66e6a2a178f5c6991677 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-09-121-0/+4
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4engine.cpp src/quick/handlers/qquicktaphandler.cpp src/quick/items/qquicktableview.cpp Done-With: Richard Moe Gustavsen <richard.gustavsen@qt.io> Done-With: Ulf Hermann <ulf.hermann@qt.io> Done-With: Shawn Rutledge <shawn.rutledge@qt.io> Change-Id: If9558a33f01693ce96420c094e0b57dfff0626cd
| * Doc: Fix documentation warnings for qtdeclarativeTopi Reinio2019-08-291-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After recent changes to QDoc, it now correctly warns about missing documentation for QML method parameters - fix all of these and also do some minor language editing. Remove duplicated entries for - \qmlmodule Qt.labs.qmlmodels - \group qtjavascript as they were causing issues. Change-Id: I55cd670cc8a0cc6427cdb7945dbd7c28ea94f796 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-011-0/+14
|\| | | | | | | | | | | | | | | Conflicts: src/imports/imports.pro src/qml/qml/qqmlmetatype.cpp Change-Id: I308436caf55402cb2246cb591c6ac8f83e1febf8
| * Make QQmlThread work for no-thread debug modeMorten Johan Sørvig2019-05-081-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | Disable isThisThread asserts: there is only going to be one thread. Add a no-thread implementation for internalCalMethodInMain(), which calls the message immediately, similar to the current internalCallMethodInThread() implementation. Change-Id: I554cacf572b5f47c9921d247773cc3d9127b8203 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* | Port towards load/storeRelaxed atomicsGiuseppe D'Angelo2019-06-251-4/+4
| | | | | | | | | | | | | | | | | | | | Plain load() / store() have been deprecated, so port away to their straight replacements. Task-number: QTBUG-76611 Change-Id: I79935b889cf7b2ba7698f70cc5e33994b034aa09 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Clean up QStringHashUlf Hermann2019-04-305-180/+195
| | | | | | | | | | | | | | | | | | Make it completely inline, move the (4 times duplicated) primeForNumBits function into its own file, address some warnings, move QHashedString::compare into qhashedstring.cpp. Change-Id: I778bb3d3e176cfec45eda9be9d7e5982585e6474 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Make QQmlRefCount usable for immutable typesUlf Hermann2019-02-081-13/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | refcounting should still be possible if the object is const. You can safely take and release references to const objects, after all. operator delete also works for const pointers. Therefore, make the refCount member mutable and declare addref() and release() as const. Additionally, drop the unused destroy() method and make the dtor protected for marginally more protection from accidental manual deletion. Plus, refcounted types should really not be copied or moved. Change-Id: I28fdc96c60b6ed5a056782568717c16b76234883 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Remove debug code from QStringHashUlf Hermann2019-02-074-26/+0
| | | | | | | | | | | | | | Now that we've split the classes, this doesn't work anymore. Change-Id: I9b18075db7895183f21045d199e8ac8b04245945 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Add a mutable iterator to QStringHashUlf Hermann2019-02-072-10/+54
| | | | | | | | | | | | | | And use that in QQmlTypeModule to get rid of a const_cast. Change-Id: Ifbb39293b6f0e159355dd7780febba0eed149025 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Split QStringHash and QLinked(Multi)StringHash apartUlf Hermann2019-02-073-236/+299
| | | | | | | | | | | | | | | | The plain QStringHash can have a mutable iterator. The linked one can not. We never use a non-linked MultiStringHash. Change-Id: I69b66f7952e6e47b79c0995f389e6219744dfc76 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Move QStringHash into its own fileUlf Hermann2019-02-065-979/+1086
|/ | | | | | | QHashedString and QStringHash are different things. Change-Id: Ifcac58ef41bf15dd6172fa0c42b86eca385c2ce0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make QtDeclarative work for the no-thread configMorten Johan Sørvig2018-09-051-0/+10
| | | | | | | | | | | | | Force use of the basic render loop, adapt qqmlthread and qqmltypeloader to work on a single thread. Disable components and features that require worker threads: qmldb_server, worker script, shapes, folderlistmodel, threaded render loop, software renderer. Done-with: Lorn Potter <lorn.potter@gmail.com> Change-Id: I77d965947f684f8b7d19284b5decd893395316cb Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Use QScopeGuard instead of library local helper templateSimon Hausmann2018-07-222-76/+1
| | | | | Change-Id: Ia96accbd0522554aef65839eb12062f4facd2604 Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
* Remove bindings that have no dependenciesSimon Hausmann2018-05-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the initial enabling of a binding we can quickly determine if there is a chance whether this binding will be re-evaluated again in the future as a consequence of dependency changes (properties or translations). If that is not the case, then we can save memory by removing that binding again. One implementation consequence of this change is that such constant bindings used with the "when" property of states require a proper reference count increase, which was previously implicit through the binding association with the target object. In tst_qqmlecmascript a test that verifies that we don't create run-time bindings for assignments of literal "null" to QObject pointer properties now also covers the more complex case where we don't know the property at parse time. We still evaluate the binding once though and perform one property assignment. Similarly on the QtQuick Designer Support API test side a binding such as x: Math.max(0, 200) will not create a persistent binding anymore and needs a tweak to remain. On a large scale application this optimization saved up to 5% of all bindings on start-up (~9000 of ~180000). On Linux x86-64 one binding is approximately 144 bytes, so the savings are in the range of ~1.2 MB of heap, as well as reduced fragmentation. Task-number: QTBUG-64541 Change-Id: Id3653008346fdf36611f5b4c4e82f5f78b5319aa Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Minor cleanup in QQmlRefPointerSimon Hausmann2018-04-261-0/+16
| | | | | | | | | Add rvalue constructor and assignment operator, to reduce the amount of atomic operations as a consequence of the typeloader changes that replace the manual reference counting with QQmlRefPointer usage. Change-Id: Id36be54e717cf2e83b0027b818f11e20b4fde0ce Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Clean up manual reference of QQmlTypeData and QQmlPropertyCacheSimon Hausmann2018-04-261-1/+3
| | | | | | | | | | | | | | | | | | | | | | | We have a few places in the type loader where we do adventurous manual reference counting, where getType() returns a raw pointer that has been addref()'ed and then sometimes somehow we call release() later. Commit 0b394e30bba4f6bb7e6f7dbe5585a2e15aa0f21d is an example of where this can easily go wrong. As a consequence and also in preparation for future work on the type loader, this patch starts replacing the manual reference counting there. Changing the return type from QQmlTypeData *getType() to a QQmlRefPointer<> itself is not sufficient though, as the implicit operator T*() will still allow the caller to store the result as a raw pointer. Therefore this patch removes the "unsafe" implicit extraction operator. As a result of that change, other types that are sometimes stored in QQmlRefPointer are also affected and their usage needs to be adapted to QQmlRefPointer usage or manual raw pointer extraction with .data(). Change-Id: I18fd40634047f13196a237f4e6766cbef3bfbea2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Reduce the overhead of type loader lockingSimon Hausmann2018-03-162-0/+8
| | | | | | | | | | Allow pulling the shared mutex out of the QQmlThread for the type loader so that the lock and unlock calls can be inlined. We do a lot more of those now. Task-number: QTBUG-41465 Change-Id: I42f3d17feb08863f51b003b061d89f49c5a6d574 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Silence another GCC 8 warning in qpodvectorVille Voutilainen2018-02-281-1/+1
| | | | | | | | qtdeclarative/src/qml/qml/ftw/qpodvector_p.h:119:22: error: ‘void* memmove(void*, const void*, size_t)’ writing to an object of non-trivially copyable type ‘class QQuickBasePositioner::PositionedItem’; use copy-assignment or copy-initialization instead [-Werror=class-memaccess] ::memmove(m_data + idx, m_data + idx + count, Change-Id: I049703a0a6bb4432dfd3d3ce3c8cef13e9c2e31a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Silence GCC 8 warnings in qpodvectorVille Voutilainen2018-02-281-4/+4
| | | | | | | | | | | qpodvector_p.h:90:34: error: ‘void* realloc(void*, size_t)’ moving an object of non-trivially copyable type ‘class QQuickBasePositioner::PositionedItem’; use ‘new’ and ‘delete’ instead [-Werror=class-memaccess] m_data = (T *)realloc(m_data, m_capacity * sizeof(T)); qpodvector_p.h:94:22: error: ‘void* memmove(void*, const void*, size_t)’ writing to an object of non-trivially copyable type ‘class QQuickBasePositioner::PositionedItem’; use copy-assignment or copy-initialization instead [-Werror=class-memaccess] ::memmove(m_data + idx + 1, m_data + idx, moveCount * sizeof(T)); Change-Id: I37088986a0f8613152a355ed6f3f9572316fa607 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* init variables where they are declared when possible (clang-tidy)Shawn Rutledge2018-02-264-42/+32
| | | | | | | | clang-tidy -p compile_commands.json $file -checks='-*,modernize-use-default-member-init,readability-redundant-member-init' -config='{CheckOptions: [{key: modernize-use-default-member-init.UseAssignment, value: "1"}]}' -header-filter='qtdeclarative' -fix Change-Id: I705f3235ff129ba68b0d8dad54a083e29fcead5f Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-2611-66/+66
| | | | | | | | | | | | | From now on we prefer nullptr instead of 0 to clarify cases where we are assigning or testing a pointer rather than a numeric zero. Also, replaced cases where 0 was passed as Qt::KeyboardModifiers with Qt::NoModifier (clang-tidy replaced them with nullptr, which waas wrong, so it was just as well to make the tests more readable rather than to revert those lines). Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2017-11-061-10/+17
|\ | | | | | | Change-Id: I1ed923d72566af663555898c3ec708191eef8ae9
| * QQmlTypeLoader: Drain events before shutting down the threadUlf Hermann2017-10-201-10/+17
| | | | | | | | | | | | | | | | | | | | We take references to types when sending events to the other thread. If we don't process the events, the references are kept, which leads to memory leaks. Therefore, when shutting down a QML engine, we have to make sure the event queues are emptied. Change-Id: Id8b0440029cfd7d03a9e540747eaedbcaa7c9ff3 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Replace Q_NULLPTR with nullptrKevin Funk2017-09-271-2/+2
|/ | | | | Change-Id: I0c01862dbb475494c84e39c695cb563df8cbcfa8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Qml: add missing 'override'Anton Kudryavtsev2016-10-072-15/+15
| | | | | | | ... and drop redundant 'virtual' Change-Id: Ib1f68c1ebd0468cb4a77eecc986bbf718f6bf789 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Adjust decarative after qtConfig changes in qtbaseLars Knoll2016-08-191-1/+1
| | | | | | | | | Most of the changes are optional, but cleanup our QT_CONFIG usage. Change-Id: I5253d53f72f6fb03c2cfedae1e17d94f424a6bbb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Remove unused delete watcher classSimon Hausmann2016-08-182-112/+0
| | | | | Change-Id: I8ccb3ae9029d17dcb4d60239d225393b1da88993 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Centralized deferred cleanup handlingSimon Hausmann2016-08-092-0/+75
| | | | | | | Move the lambda cleanup code into a shared header file for re-use. Change-Id: Ib9fb7dce98200bcad2bb688740f9b6c2a1e4aae7 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* V4: allow for String::createHashValue to be inlinedErik Verbruggen2016-07-132-26/+32
| | | | | | | Notably into QHashedString(Ref)::computeHash. Change-Id: Icf8487ed3da0f117cb0911f20c9b88498f61510a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QtQuick: clean up shader effect property connectionsErik Verbruggen2016-07-051-2/+2
| | | | | | | | | | | | | | | - Don't use a signal mapper, but handle the mapping using a custom slot object and a lambda to do the dispatching ourselves. - Don't do meta-calls by property name, but by index. - Cache the meta-object. - Resolve the property indices by using the QML property cache. For a shader with 6 property connections, the time spent goes from 320k instructions to 80k instructions (valgrind on x86_64). Task-number: QTBUG-53901 Change-Id: I2809198cf62f9716b3683798222203fc3e97fbb3 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* V4: calculate the hash only once when inserting a string.Erik Verbruggen2016-05-121-2/+2
| | | | | | | Reduces the number of instructions of IdentifierTable::identifier by ~15%. Change-Id: I5a234fa96a6ee3e7202150ded512d1be0b36560d Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove unused QPointerValuePair templateFrank Meerkoetter2016-04-182-195/+0
| | | | | | Change-Id: I93bc5951d555f799bb956020433d3087504e8f9f Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-082-119/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change also fixes the build of two benchmarks, tst_affectors and tst_emission. Conflicts: src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro src/qml/qml/ftw/qhashfield_p.h tests/benchmarks/particles/affectors/tst_affectors.cpp tests/benchmarks/particles/emission/tst_emission.cpp tests/benchmarks/qml/pointers/pointers.pro tests/benchmarks/qml/pointers/tst_pointers.cpp tests/benchmarks/qml/qmltime/qmltime.pro tests/benchmarks/qml/qquickwindow/qquickwindow.pro Change-Id: I595309d1e183c18371cb9b07af6e4681059de3b2
| * qml: Remove unused QHashField class.Robin Burchell2016-04-062-113/+0
| | | | | | | | | | | | Change-Id: I8dd234d06048e6d8e7b2dfccb59d639ad167022b Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>