aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlproperty_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Split CompiledData::CompilationUnit in twoUlf Hermann2019-05-161-0/+1
| | | | | | | | We need a CompilationUnit that only holds the data needed for compilation and another one that is executable by the runtime. Change-Id: I704d859ba028576a18460f5e3a59f210f64535d3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML: Split propertyCache into multiple filesUlf Hermann2019-02-011-1/+3
| | | | | | | I want to be able to read the code. Change-Id: I063143ff63b0a476d783c892e1d328e7f5133fab Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* 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>
* Speed up PropertyChange state applicationSimon Hausmann2018-01-171-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Every time we decode a potential binding of a PropertyChanges{} object, we call qmlContext(this) and we go through a full QQmlProperty construction (which involves property name decoding by dots and property lookups), just to determine if we're doing a binding on a property or a signal. QQmlProperty::isSignalProperty() will only return true if the property is valid and if it's a "function" type. The QQmlProperty constructor on the other hand only constructs a valid regular property if it's _not_ a function type and a signal property _has_ to start with "on" followed by an upper case character. We can copy this shortcut out into decodeBinding() to avoid the QQmlProperty construction in the common case of plain property bindings. This is also legit in the scope of group properties, as signal bindings on group properties are not supported (we always use the state's target object for signal lookup, never the group object). In addition, avoid creating a public QQmlContext for the PropertyChange object by allowing for the construction of the QQmlProperty object via the QQmlContextData, as that's the only data structure we really need. These two changes used to be separate, but they need to go together to keep the tests passing, as the property validation and warning issuing is now moved from decodeBinding() into ::actions() itself. Shaves off 1.5% off delegates_item_states.qml Task-number: QTBUG-65708 Change-Id: I32a17d815bd3495a907a51068a971eb7cb69c6ef Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix coding styleLars Knoll2016-12-091-10/+6
| | | | | Change-Id: I2d6d67273533930aaa9fc61c5f4cdbef2f0bcf53 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML: Make all fields in QQmlPropertyRawData privateErik Verbruggen2016-08-101-1/+1
| | | | | | | | And add accessors. This makes it easier later on to change the storage of the fields. Change-Id: I21163668ac83a7d52f398981baf3c27ef161c177 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML: Split off value type information from property dataErik Verbruggen2016-08-091-9/+9
| | | | | Change-Id: I2ae2fb0f18af9b866cc9482fd4f42d9d4269f8cb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QML: Introduce QQmlPropertyIndexErik Verbruggen2016-08-041-4/+4
| | | | | | | | 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-13/+5
| | | | | | | | | 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>
* Fix some function signatures and remove an unused functionLars Knoll2015-06-181-2/+2
| | | | | | | | The returned value of these methods is never used, so save some cycles and return void. Change-Id: I7e2430130853af12de9685c4383197c80c151175 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Make bindings refcountedLars Knoll2015-06-101-5/+4
| | | | | | | | | | | 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>
* Move the writeBinding method into QQmlBindingLars Knoll2015-06-051-5/+2
| | | | | | | | It's only called from there; this simplifies the code and will allow some further optimizations. Change-Id: I1f0befe620beaa0bbf961fc829881ef7b5c2e435 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Smaller cleanupsLars Knoll2015-04-271-2/+1
| | | | | Change-Id: Ib8a222c26316ad31699d3becaa945ac4035e437b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Get rid of QQmlBinding::property()Lars Knoll2015-04-271-1/+2
| | | | | | | The method is slow and not required anymore Change-Id: I8c2bc6eeedbd15b901b60aa08408fe8c32a81707 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Simplify binding setup code furtherLars Knoll2015-04-271-12/+13
| | | | | | | | Reduce the number of setBinding/removeBinding overloads and simplify their internal handling. Change-Id: I87174a3b2dc0ecb8380e8fc28f8969fbf475c728 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Make removal of bindings explicitLars Knoll2015-04-251-0/+2
| | | | | | | This simplifies the code for further refactoring. Change-Id: I6bcb5ce397f642242af80ce37dc8bba1fa9bf3f5 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Get rid of QQmlAbstractExpressionLars Knoll2015-04-241-0/+1
| | | | | | | | | The class is always used together with QQmlJavaScriptExpression, so we can just as well fold the functionality together into one class and simplify our code. Change-Id: I23820e51efaaea16ae5db7e2153a827d7b22999e 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>
* Get rid of most uses of ValueRefLars Knoll2015-01-231-1/+1
| | | | | | | | | | | | Instead pass a const Value & into the functions With our new inheritance structure, we can get rid of ValueRef and instead simply pass a pointer to a Value again. Pointers to Values are safe to use again now, as they are now guaranteed to be in a place where the GC knows about them. Change-Id: I44c606fde764db3993b8128fd6fb781d3a298e53 Reviewed-by: Simon Hausmann <simon.hausmann@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>
* fix whitespaceOswald Buddenhagen2014-01-221-2/+2
| | | | | | | remove trailing spaces and expand tabs Change-Id: Ieacb9d096b612c45d1a64700044c114d1f7522bc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix Persistent/WeakValue APILars Knoll2013-09-261-1/+1
| | | | | | | Don't use unprotected Values in the API anymore. Change-Id: I8851628227fca374de24701bc8ee0908b5ae3923 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of the first half of QQmlGuard usageLars Knoll2013-07-051-3/+2
| | | | | | | | | QQmlGuard was being used as a more performant replacement for QPointer. QPointer got now fixed in Qt 5.0, making this class obsolete. Change-Id: I77eef066c4823af4b074ef32d4d78dbd67c36cd0 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of Get/SetHiddenValue in the v8 APILars Knoll2013-05-241-2/+2
| | | | | | | | | | It was only used to mark an object as something to be used as a binding. Simply use one of the free bits in QV4::Managed for that. Also changed a bit more code over from v8 to v4. Change-Id: I6e787e611041e058fe109df1d7a13598655f8eba Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove QV8Bindings classLars Knoll2013-05-241-2/+0
| | | | | | | | | This class tries to optimise binding compilation with v8. With the approach in v4 where we don't rewrite binding expressions anymore, this is not required anymore. Change-Id: I616aeeba85bc17a950d4c7341b3042ed8aa42bff Reviewed-by: Simon Hausmann <simon.hausmann@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 V4 binding for non-final properties where possibleMatthew Vogt2012-07-091-0/+2
| | | | | | | | | When a property referenced in a binding is not marked as final, do not automatically abort optimization. Instead generate both V4 and V8 binidngs, and only fall back to the V8 binding if necessary at run time. Change-Id: I1bcc7e2b495935c5d519a9a223f640c1972cdb4e Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Adapt to connection-related changes in qtbaseKent Hansen2012-06-121-0/+2
| | | | | | | | | | | | | | | | | | | The QQmlData hooks signalEmitted() and receivers() now receive the index in the signal index range (i.e., excluding non-signal methods). This was done to avoid Q(Meta)Object having to compute the class's method offset; the signal offset should be sufficient for everyone. This required adapting QQmlNotifier, QQmlBoundSignal, QQmlPropertyCache and friends to use the signal index range whenever a property's notify signal is involved in the internal connection lists and property captures. Using the signal index range also reduces the memory used for NotifyList::notifies, since useless entries for non-signal methods will no longer be created. Change-Id: I62872fbea5a1f829b8b03bae3fc1e6acd84cf886 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Lazily create QMetaObjectsAaron Kennedy2012-05-241-7/+4
| | | | | | | | | | 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>
* More robust tracking of signal handler expression ownership.Michael Brasser2012-05-011-3/+5
| | | | | | | Reference count the expressions, and improve testing. Change-Id: I810509eae1c7608b367e9ff5f7891a294667a692 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Use minimal javascript expression for bound signalsChris Adams2012-03-291-4/+4
| | | | | | | | | | | Previously, QQmlBoundSignal used QQmlExpression internally. This commit adds a new, more optimal QQmlJavaScriptExpression subclass specifically designed for QQmlBoundSignal, and converts the code to use it instead of QQmlExpression where appropriate. Task-number: QTBUG-24460 Change-Id: I2865a119ce840235e27a7722d8052ca61c265f69 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Remove binding dependency on QQmlExpressionAaron Kennedy2012-03-151-5/+0
| | | | | | | | This is the first step to creating much lighter weight bindings that are tuned for the specific scenario in which they're used. Change-Id: Ib985dcff25679b711b5c634bbc891aa7902bf405 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Fix crash when writing property after engine deletionChris Adams2012-03-131-1/+2
| | | | | | | | | | | | Previously, the engine pointer stored in a QQmlProperty could be stale due to engine deletion. This commit ensures we guard that pointer. Also reverts cbb7f8b10e99fad675839d7625d3236ed67b3e01 Task-number: QTBUG-24734 Change-Id: I5349c51fbd19fa46a8710280173c1d224358b96e Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-0/+171
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>