aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlvaluetypeproxybinding.cpp
Commit message (Collapse)AuthorAgeFilesLines
* use nullptr consistently (clang-tidy)Shawn Rutledge2018-02-261-3/+3
| | | | | | | | | | | | | 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>
* Add API to learn about QQmlBinding's dependenciesAnton Kreuzkamp2017-08-131-0/+5
| | | | | | | | | | | Adds a method `dependencies()` to QQmlBinding, that returns a QVector<QQmlProperty> of all properties the binding depends on. The API is meant to be used in debugging tools (e.g. in GammaRay). Also adds a public method subBindings() to QQmlValueTypeProxyBinding in order to be able to access their dependencies. Change-Id: Ib833703ec9e632661626c4532b8d73997f38e62b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Qml: mark some methods as constAnton Kudryavtsev2016-10-241-1/+1
| | | | | | | These methods do not modify objects. Change-Id: Iefe8effa97e6f6142308d61d57d08f9dc14a7709 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QML: Introduce QQmlPropertyIndexErik Verbruggen2016-08-041-3/+3
| | | | | | | | This helps in making it clear when an index is a plain old number and when it consists of an encoded value type index. Change-Id: Ic50d95caf244ed0ee2d62bdba53910a371cfee04 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML: Unify property reads/writes and use accessorsErik Verbruggen2016-07-251-1/+1
| | | | | | | | | Pass property reads/writes through utility functions in QQmlProperty, which in turn will try to use accessors when available (and no interceptors have to be called). Change-Id: I60ecfc202b6024bfe4a33206a46299787b152546 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Updated license headersJani Heikkinen2016-01-191-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Make bindings refcountedLars Knoll2015-06-101-13/+6
| | | | | | | | | | | Refcounting our bindings greatly simplifies our memory management of the objects and ensures we safely clean them all up. In addition, it allows us to remove the m_mePtr and weak reference handling from QQmlAbstractBinding as we can safely handle this through the same mechanism. Change-Id: If23ebc8be276096146952b0008b62018f5d57faf Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Replace bindingType() method by a virtual getterLars Knoll2015-06-051-1/+6
| | | | | | | | | This removes the need to save some bits in the abstract binding object, and should make it easier to move QQmlAbstractBinding over to be reference counted. Change-Id: Ib46cb3217f3dc462f1dcaa6153d90ea2f7401f48 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Move the target property index into the common base classLars Knoll2015-06-051-6/+1
| | | | | | | | This unifies some more code between the different binding classes Change-Id: I891dc9358cf9598a0c1e21df8a62d6f8a4193985 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Move the target object into the base classLars Knoll2015-06-051-7/+5
| | | | | Change-Id: I912d7665b49c8e9b2d38e78bfcfc4b3d39ca7459 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* CleanupLars Knoll2015-04-261-4/+4
| | | | | | | | Rename QQmlAbstractBinding::object() and propertyIndex() to targetObject() and targetPropertyIndex() Change-Id: Ic50da69e7a7c6412b5abb36f433be046e6566763 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Smaller cleanupLars Knoll2015-04-261-26/+4
| | | | | Change-Id: If6b041a18b4f13ead13f560b62dd5f4495088f2c Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Remove the manual vtable from QQmlAbstractBindingLars Knoll2015-04-261-33/+3
| | | | | | | | | it's rather hard to maintain, and not really worth it. I believe we can more easily save the one pointer in other places with easier to maintain code. Change-Id: Iaba2d62b82ebe58947fa35b0812b4c70f318007a Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9 Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
* Changed value type property index encodingSimon Hausmann2014-12-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | We used to encode property index and value type property index in one int with 16 bits each, for example font.pixelSize with index of "font" in the lower 16 bits and "pixelSize" in the upper 16 bits. Detecting if a given encoded index was using value types or not was based on whether the value type index (upper 16 bits) were non-zero. That assumption holds given that all valid property indicies of value types are > 0 because they are all sub-classes of QObject, which provides the first property (objectName). With the introduction of gadgets property index zero will become popular again, and value types are a core use-case for gadgets. Therefore we need to change the encoding to allow for zero to be a valid value type property index. This is implemented by centralizing all decoding call sites to call one function that indicates -1 as non-present value type core index return value. That way we can encode the index with an offset of 1. Change-Id: I266abf140211a4f7204b47b94d07c364f0a8f408 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 & LICENSE.GPLv2 - Removed LICENSE.GPL Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0 Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.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>
* Permit value types with metatype IDs >= QMetaType::UserMatthew Vogt2012-08-101-1/+1
| | | | | | | | | Remove the assumption that value types must be types defined by Qt, having metatype IDs below QMetaType::User. Task-number: QTBUG-26352 Change-Id: Ib5a56ff2e7892e82adf17a3a1e7517a0c9fe0534 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Use static dispatch tables for QQmlAbstractBindingAaron Kennedy2012-05-241-17/+41
| | | | | | | | | This saves us the space of the virtual table pointer, but does somewhat limit us to the 4 QQmlAbstractBinding types that we have today. Change-Id: I03d06ef2ec0c51271c28e7a5aab6dc689d369da4 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Reduce size of QQmlAbstractBindingAaron Kennedy2012-05-241-6/+17
| | | | | | | | | | The doubly-linked list is unnecessary. Most bindings are created at startup, and removed only when the object is destroyed. In these cases the double-link buys nothing other than wasted space. Even when the bindings are removed earlier, searching the list is not that slow. Change-Id: I22e1376b78ba712dafd171c7447fbc6ed212b891 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Move binding and expression classes to separate filesAaron Kennedy2012-03-131-0/+138
Change-Id: Ia9c6996a606e140f31681ecd26d93b1b0fdedf02 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>