aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickvisualadaptormodel.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fixed missing virtual destructors in qtdeclarative.Samuel Rødal2012-09-241-0/+4
| | | | | | Change-Id: I0b0e63b572617a56874e27361479de2690644aa3 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Explicitly initialize base class.Andrew den Exter2012-08-071-0/+1
| | | | | | | Fixes warning. Change-Id: I29a694fae4408639ebf7e57993139f39a518e0d4 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Fix handling of changes to the root index of a VisualDataModel.Andrew den Exter2012-08-021-0/+17
| | | | | | | | | | Store the root index as a QPersistentModelIndex so the index remains valid as the model changes, and in the case the root index is removed from the model invalidate the contents of the VisualDataModel until a new root index or model is set. Change-Id: I1cbc27f2068f99a02ff3d43373905dec7e35e900 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove QListModelInterface.Andrew den Exter2012-07-251-135/+5
| | | | | | | | | | Implement ListModel and XmlListModel using QAbstractListModel instead. Task-number: QTBUG-15728 Change-Id: I14e03d90883d341f4b1d89c1e9fc9dc1534fde78 Reviewed-by: Glenn Watson <glenn.watson@nokia.com>
* Add a static object template for variant list model types.Andrew den Exter2012-07-231-22/+74
| | | | | | | Also cache any reused strings so a copy isn't created per model. Change-Id: I32f6685df8c1ecc965c9dd7192fa9972655f0ce4 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Don't cache visual data model v8 handles.Andrew den Exter2012-07-101-0/+2
| | | | | | | | | | The external resource is reference counted and resused irregardless of whether the handles are cached, and the reduction in the number of handles allocated needs to be comes at the cost of keeping persistent handle which have a negative impact on garbage collection. Change-Id: I92996faab08a0ff76d21e56dbdafdd7522882d2c Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Add some private V8ASSERT macros.Andrew den Exter2012-07-041-12/+6
| | | | | | | | Simple variation on the V8THROW macros to consilidate the normal usage pattern of if (!condition) THROW. Change-Id: I71aaabab705c3f73922efdaf8bb40b5dcc390101 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* section.property cannot deal with nested propertiesMartin Jones2012-07-021-13/+13
| | | | | | | | Handle nested property names in section.property. Task-number: QTBUG-24569 Change-Id: I0ea6003313108b8232bcd3a3015a4dbbd0753cec Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Pass the right signal index in visualadaptormodel proxy meta-objectKent Hansen2012-06-221-2/+2
| | | | | | | | | | For QMetaObject::activate(), the index must be relative to the class's own signals (excluding non-signal methods). For QMetaObjectBuilder, the notifier index must be relative to the class's own methods. Change-Id: I22f55d1fc55d56c997135dc78f51b710b37bb01a Reviewed-by: Andrew den Exter <andrew.den-exter@nokia.com>
* Don't cache item indexes in VisualDataModel.Andrew den Exter2012-06-081-17/+17
| | | | | | | | | | | | | | Sacrifice constant time lookup of indexes for rarely used features for reduced memory usage. Applications which use neither Packages, nor the VisualDataGroup api don't ever need to query the index of an item so caching and maintaining those indexes in unnecessary. Where they are used this add a cost scanning for the index of an item in the cache, and in some instances a lookup cost in the compositor. Change-Id: I7d3c21a27a8a3c068c5ae2e1e326ff573c44d712 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Use a shared meta-object for VisualDataModel list context objects.Andrew den Exter2012-05-301-29/+19
| | | | | | | | | The objectDestroyed() function on QAbstractDynamicMetaObject makes it possible to reference count dynamic meta objects so there is no longer a need to construct an instance per item. Change-Id: I6f32b803b97db015212284718239dc3062dcefe7 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Lazily create QMetaObjectsAaron Kennedy2012-05-241-20/+20
| | | | | | | | | | For internal QML built types, creating a metaobject each time is just wasteful. Additionally, as the property caches were always created from the intermediate QMetaObject, it was difficult to pass information directly from the compiler to the property cache. Change-Id: I769526b0edaaf16a86883f3065b75618b94e4077 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Fix performance regression in VisualDataModel.Andrew den Exter2012-05-241-0/+4
| | | | | | | | Restore assignment of the shared property cache to individual items created. Change-Id: I7d4bc0253d644e07a8803f47b3afabaa8ef47146 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Refactor QQuickVisualAdaptorModel to reduce memory consumption.Andrew den Exter2012-05-211-824/+716
| | | | | | | | | | | | Don't inherit from QObject. Use a single QQmlGuard for all model types, and reset the model property if the model is deleted. Construct v8 object template on demand. Store model type specific data in a separate class that is allocated on demand. Change-Id: Id4f7b235741555b6ffba3fcf11727d85d6920e9e Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove warning about not explicitly initializing base class.Andrew den Exter2012-03-201-1/+2
| | | | | Change-Id: I786f2936a4e6c813a041950a550f06951f06bada Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Don't leak function objects created by VisualDataModel.Andrew den Exter2012-03-151-12/+12
| | | | | | | | | | Function objects created from a FunctionTemplate are not short lived, and the objects created by a VisualDataModel can change between instances meaning a template is needed per instance. So use an object template as a constructor instead of a function. Change-Id: I364c6e4f714a623b7adb7475a3ee9862eeeeb119 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-19/+19
| | | | | | | | | | | | | Symbols beginning with QDeclarative are already exported by the quick1 module. Users can apply the bin/rename-qtdeclarative-symbols.sh script to modify client code using the previous names of the renamed symbols. Task-number: QTBUG-23737 Change-Id: Ifaa482663767634931e8711a8e9bf6e404859e66 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: If39bd256b0fa85eba17ea30f8ab87ea27d758908 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-231-1/+1
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I6a730abc0c396fb545a48b2d6938abedac2e3f1c Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Remove out-of-line uses of qMalloc/qFree/qRealloc.Robin Burchell2012-01-121-2/+2
| | | | | | | | | Per http://codereview.qt-project.org/#change,11562, we are trying to remove these in favour of direct allocation, or (in the case of inline code) specialised out-of-line wrappers. Change-Id: I113609c4f97dc5c8020a72cbd398572cdb5b7505 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I0a8d99909cac867dce72da70b1bbcb649989a51b Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Insert items into VisualDataModel.Andrew den Exter2011-12-231-100/+263
| | | | | | | | | | | Add API for inserting data directly into a VisualDataModel which can be used among other things to create temporary items that are later resolved to an actual item in the source model. Task-number: QTBUG-21516 Change-Id: I835f0e8d6c5edfb3a21029687de5b700f7400317 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Minimize the number of objects created per item in VisualDataModel.Andrew den Exter2011-12-231-187/+280
| | | | | | | | | | | | | | Derive from QDeclarativeContext and reference count the context object instead of parenting it to the context. Combined with a weak persistent v8 handle the allows the context object to be returned by javascript accessors instead of creating a new instance for every use. In addition to the efficiency advantages of creating fewer objects, routing all data access through a single object means that object can also persist data instead of just acting as a proxy. Change-Id: I107dc8c901f16f2a4b420ff1cbffa7a6be27de89 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Utilize the property cache for item view context objects.Andrew den Exter2011-12-151-3/+6
| | | | | | | | A common QDeclarativePropertyCache was being constructed for dynamic objects but never bound to the constructed objects. Change-Id: I83b3841d8b78e2f2dd8e0494ea2601c20d6e6e88 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Fix QQuickVisualDataModel test failure.Andrew den Exter2011-12-051-8/+10
| | | | | | | | | | | | | | When connecting the source object's notify signals to the proxy object's the objectName property wasn't being skipped, this didn't matter much before because the object name property didn't have a notify signal and so was skipped anyway. Adding a notify signal resulted in all the signal connections being off by one. The object list proxy meta-object also shouldn't assume that QObject has only and only ever will have one property. Change-Id: I238e05153446cbfdceea643963e3a26f665e41a1 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Say hello to QtQuick moduleKent Hansen2011-12-021-0/+889
This change moves the QtQuick 2 types and C++ API (including SceneGraph) to a new module (AKA library), QtQuick. 99% of this change is moving files from src/declarative to src/quick, and from tests/auto/declarative to tests/auto/qtquick2. The loading of QtQuick 2 ("import QtQuick 2.0") is now delegated to a plugin, src/imports/qtquick2, just like it's done for QtQuick 1. All tools, examples, and tests that use QtQuick C++ API have gotten "QT += quick" or "QT += quick-private" added to their .pro file. A few additional internal QtDeclarative classes had to be exported (via Q_DECLARATIVE_PRIVATE_EXPORT) since they're needed by the QtQuick 2 implementation. The old header locations (e.g. QtDeclarative/qquickitem.h) will still be supported for some time, but will produce compile-time warnings. (To avoid the QtQuick implementation using the compatibility headers (since QtDeclarative's includepath comes first), a few include statements were modified, e.g. from "#include <qsgnode.h>" to "#include <QtQuick/qsgnode.h>".) There's a change in qtbase that automatically adds QtQuick to the module list if QtDeclarative is used. Together with the compatibility headers, this should help reduce the migration pain for existing projects. In theory, simply getting an existing QtDeclarative-based project to compile and link shouldn't require any changes for now -- but porting to the new scheme is of course recommended, and will eventually become mandatory. Task-number: QTBUG-22889 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Change-Id: Ia52be9373172ba2f37e7623231ecb060316c96a7 Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>