aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmlmodels
Commit message (Collapse)AuthorAgeFilesLines
* StringOrTranslation::toString: fix string checkFabian Kosmale2020-07-091-2/+3
| | | | | | | | | arrayData can now be null, because shared null for QString has been removed. Instead of checking for arrayData, we now check whether the stringSize is larger than 0. Change-Id: I81e683bb8394ee84b291098add3f62636a697a8d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Compile against latest qtbaseLars Knoll2020-07-091-1/+2
| | | | | | | Adjust to the lastest changes in QList and QString. Change-Id: I216b2746a3305222a21c5aead3aec6106ac1f035 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add ; to Q_UNUSED and UNUSED_PARAMLars Schmertmann2020-06-261-1/+1
| | | | | | | | | This is required to remove the ; from the macro with Qt 6. Task-number: QTBUG-82978 Change-Id: Iead53d18fd790fb2d870d80ef2db79666f0d2392 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QVariant::setValue: do not force the template parametersGiuseppe D'Angelo2020-06-171-1/+1
| | | | | Change-Id: I198bfd703efe7ad675e4076d1976f2414816dec5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port QtDeclarative from QStringRef to QStringViewKarsten Heimrich2020-06-161-1/+1
| | | | | | | | 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>
* Prevent items from being deleted while removingElvis Lee2020-06-121-0/+7
| | | | | | | | | | | Delegate items can be deleted when remove them from cache list. That may cause a crash. So call referenceObject to keep the item from being deleted. Task-number: QTBUG-83352 Pick-to: 5.15 Change-Id: Id5d7ab6dbf21682940f5393ea4e843c2448f7d81 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* CMake: Regenerate configure.cmake filesAlexandru Croitor2020-06-041-0/+4
| | | | | | | | | This will cause cmake to show the usual configure reports. Needed to add a custom function to find python (not currently used though, except for the configure report). Change-Id: Id68efc5badeaa30834a37fe751c1d5b6bfd96d92 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* QDirModel is deprecated, don't use it in documentation snippetsVolker Hilsheimer2020-06-032-4/+4
| | | | | Change-Id: I1e91f530ac0814329f67f0f6af1ef5b422e47dec Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* CMake: Regenerate qtdeclarative/srcAlexandru Croitor2020-05-291-1/+1
| | | | | | | | | | Includes - renaming of internal plugin api call - generation of QT_QMLTYPES_FILENAME - addition of a few TARGET_DESCRIPTION Change-Id: I72b5647b8c16af9945795ead62a075322b6bb2f6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Remove --dependencies option from qmltyperegistrarUlf Hermann2020-05-261-2/+0
| | | | | | | | | | | We don't need to list the dependencies in the qmltypes files. The information given in the qmldir file should be enough. Ultimately, we should get rid of all hidden dependencies. Task-number: QTBUG-84286 Change-Id: Iaf67d476b449215715270043591d8c4858104ea6 Reviewed-by: Christian Kamm <mail@ckamm.de> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Adapt QML's QString-internal hacks to use char16_t, not ushortEdward Welbourne2020-05-201-3/+3
| | | | | | | | | 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>
* Fix qmltypes file names for qmltypes built from librariesUlf Hermann2020-05-191-0/+1
| | | | | | | We still expect those to be called "plugins.qmltypes" in a few places. Change-Id: I751b2bb9ca264fb7998d11c2f969ee46b32fb2cb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove qtxmlpatterns reference from qdocconfFabian Kosmale2020-05-111-1/+1
| | | | | | | Change-Id: I922a8f2cf777f4da28200f538bc03c60528b57f5 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Simon Hausmann <hausmann@gmail.com> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Change qHash return value to size_tFabian Kosmale2020-04-161-1/+1
| | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-094-16/+23
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/jsruntime/qv4executablecompilationunit.cpp src/qml/jsruntime/qv4executablecompilationunit_p.h src/qml/qml/qqmlobjectcreator.cpp src/qml/qml/qqmlpropertycachecreator_p.h src/qml/qml/qqmltypecompiler.cpp src/qml/qml/qqmltypedata.cpp tests/auto/qml/qmlformat/tst_qmlformat.cpp tools/qmllint/scopetree.cpp src/qml/qml/qqmlapplicationengine_p.h Adjusted tools/qmllint/findunqualified.cpp to use newer API Change-Id: Ibfb4678ca39d626d47527265e3c96e43313873d4
| * QQmlTableInstanceModel: Restore draining behavior of Qt 5.14Ulf Hermann2020-03-272-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt 5.14 model items are directly deleted when draining the reusable items pool, rather than calling deleteLater() on them. This may be slightly more efficient and due to some unknown side effect the deleteLater() call creates a memory leak. Restore the direct delete in drainReusableItems(). Fixes: QTBUG-82000 Change-Id: Ia1027b1004c04e8aceaa5ff16a600849c46bf470 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
| * Trade memory for performance in PropertyUpdater::doUpdateFabian Kosmale2020-03-242-11/+8
| | | | | | | | | | Change-Id: I0117029ecbe7fc369c15fcd8a44f93797e95ab3e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-241-5/+18
|\| | | | | | | Change-Id: I9f0d5adf1ba7d3246b1107a20d145e7aac2c7a77
| * PropertyUpdater: Do not crash on invalid contextFabian Kosmale2020-03-231-2/+5
| | | | | | | | | | | | | | | | | | | | | | If the context is gone, we assume that the object is currently torn down. Therefore we do not print an error message in that case. Fixes: QTBUG-82809 Change-Id: I74e5a4f41490ea9c13639c158a4d5fc0a52a38a4 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * QQmlDelegateModel: Don't require a delegate to cancel an incubationUlf Hermann2020-03-231-1/+1
| | | | | | | | | | | | | | | | | | It is actually not needed, and declining to cancel the incubation leaks memory. Change-Id: I478ed2a4eef34bd27c716762a2fced1e9091607c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * QQmlDelegateModel: On deletion, cancel any remaining incubationsUlf Hermann2020-03-231-2/+12
| | | | | | | | | | | | | | | | This fixes the memory leaks from the "x items in the process of being created at engine destruction" situation. Change-Id: I65fe278ead3d4de0cbddc075972a6774b231814f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Encapsulate QQmlContextDataUlf Hermann2020-03-233-29/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Store a QV4::ReturnedValue in QJSValueUlf Hermann2020-03-182-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'origin/wip/cmake' into devAlexandru Croitor2020-03-122-0/+117
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: dependencies.yaml Change-Id: Ifff48b9d0e7962d481e63c49399e2d304e1011e5
| * | CMake: Regenerate and adapt to merge from devwip/cmakeAlexandru Croitor2020-03-121-2/+2
| | | | | | | | | | | | | | | | | | Change-Id: If8daa6152a563d4309d7342414780ef75b9f5589 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
| * | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-1222-76/+153
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: dependencies.yaml src/qml/qml/qqmlengine.cpp Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
| * | | Regenerate qtdeclarativeAlexandru Croitor2020-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I48d7fd306f3d1b161a8e73029282ee591b1ef612 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
| * | | Regenerate projects to handle private deps correctlyAlexandru Croitor2020-02-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ifcbab0407e93dfc35d0459d7d29dee2cd3508a86 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * | | Post-merge fixesAlexandru Croitor2020-01-301-2/+2
| | | | | | | | | | | | | | | | | | | | Change-Id: I2350df5368ee34d6c7072d456806e518ce533839 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-01-295-19/+21
| |\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: dependencies.yaml Change-Id: Ie3e9dc62031a85e5e81cbdf04694b95159d49fca
| * | | | QML Type Registrar changesLeander Beernaert2020-01-241-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I36254a688f575e6c7f717ee4019e4d49f73a60f7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * | | | Post merge fixesLeander Beernaert2020-01-242-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ie8aca222809f35174fb6c6488832ec3ff5432272 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * | | | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2020-01-1617-337/+430
| |\ \ \ \ | | | | | | | | | | | | | | | | | | Change-Id: I0c5b939c70bdb91ccdf7068784308416dcaa5736
| * | | | | Post Merge FixesLeander Beernaert2019-11-251-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I13bc3aef318d8b497b01c61fcca7760abd96339a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
| * | | | | Merge remote-tracking branch 'origin/dev' into wip/cmakeLeander Beernaert2019-11-2513-2092/+85
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | Change-Id: I48b9c2e4f3a75c18470c55f73f2089dc1401de54
| * | | | | | Regenerate all projects with new CMake API versionAlexandru Croitor2019-11-151-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ie0db35f674137c229eaf049616f38f8e818f7092 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | | | | | Regenerate projectsAlexandru Croitor2019-11-141-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I38044c382e4d84b5865a19cdd04cc8922bd72a77 Reviewed-by: Qt CMake Build Bot Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | | | | | Regenerate required projects after dev -> wip/cmake mergeAlexandru Croitor2019-10-142-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ic5f1909731ec11b4fb6bc8823506d272c529ecfb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | | | | | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2019-10-1438-63/+1643
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removed dependencies.yaml because we don't use it yet in wip/cmake. Fixed conflict in qmlcachegen.cpp. Change-Id: Ie1060c737bee1daa85779903598e5b6d5020d922
| * \ \ \ \ \ \ Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-10-112-2/+2
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I4a91928610f79c8e21a05781953ffa41508c828a
| * \ \ \ \ \ \ \ Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-08-153-2/+4
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I6f2152aeecaeb8e63fdbc1cdf1444132a054b6f5
| * \ \ \ \ \ \ \ \ Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-07-246-48/+19
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I52b2d17d9334313e4b3d84b52432f2ebc77f7415
| * \ \ \ \ \ \ \ \ \ Merge remote-tracking branch 'origin/wip/qt6' into wip/cmakeAlexandru Croitor2019-07-112-3/+52
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I2963c1209316fb6755f572969f368970450d7991
| * | | | | | | | | | | Initial CMake portAlexandru Croitor2019-06-032-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Crude port of QtQml, QtQmlModels, QtQuick and a few tests and a few examples. Task-number: QTBUG-74136 Change-Id: I5de4d8215b33d1a4a72c2c0e7951e4b384f27e3e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | | | | | | | | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-112-6/+0
|\ \ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|_|_|_|/ / |/| | | | | | | | | | / | | |_|_|_|_|_|_|_|_|/ | |/| | | | | | | | | Change-Id: I0d32fc5b99f8c9e4acb922fffe4dd5f3c5be553c
| * | | | | | | | | | Remove hard-coded notes for 'Corresponding handler' for QML signalsTopi Reinio2020-03-102-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QDoc will generate these notes automatically. Task-number: QTBUG-37355 Change-Id: I8ed058ecbbcc630ad0351f6ce167c3fa61936f6f Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | | | | | | | | | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-095-7/+31
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmlirbuilder_p.h src/qml/qml/qqmlpropertycachecreator_p.h src/qmltyperegistrar/qmltypesclassdescription.cpp src/qmltyperegistrar/qmltypesclassdescription.h src/qmltyperegistrar/qmltypescreator.cpp src/quick/items/qquicktext_p.h src/quick/util/qquickvaluetypes_p.h Change-Id: Ic209741592e7b85820bf3845722023a190ebc1c5
| * | | | | | | | | | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-03-032-1/+21
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qmlmodels/qqmltableinstancemodel.cpp src/qmlmodels/qqmltableinstancemodel_p.h Change-Id: I89339b1cb41ba27fe30c79530859a1c2bfbecc69
| | * | | | | | | | | | QQuickTableView: Immediately delete delegates when possibleUlf Hermann2020-02-282-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the dtor we don't need to care about any side effects a direct delete may have. Rather, any deleteLater() may not take effect anymore as the event loop may be gone already. Task-number: QTBUG-82000 Change-Id: I97935dc47fbbfd0c050e80c333c36a05f685c45d Reviewed-by: Joni Poikelin <joni.poikelin@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * | | | | | | | | | QQmlTableInstanceModel: Fix refcounting of metatypesUlf Hermann2020-02-272-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The reusable items pool should only hold unreferenced objects. Therefore, we can immediately delete them when draining. release() is not suitable here because it unconditionally decreases and therefore underflows the refcount. Furthermore, the metatype is also refcounted, which means we should keep it in a QQmlRefCounter in order to not leak references. Task-number: QTBUG-82000 Change-Id: Iefdaaecc34342eb2e3b1e5a3281f2e46ac472347 Reviewed-by: Joni Poikelin <joni.poikelin@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>