aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlpropertybinding.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Shortcut conversions of common data typesLars Knoll2020-11-271-0/+59
| | | | | | | | | | | When returning the result of bindings, shortcut the conversion of common data types and do not go through QVariant. Removes ~20% of the overhead in the evaluation of simple bindings of types bool, int, double, float and QString. Pick-to: dev Change-Id: I0323cae12892b8ca52aedfe5e58a23e614a10d45 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove compatibility shim from qmlinfo.{cpp|h}Ulf Hermann2020-11-191-1/+1
| | | | | | | | | | | | We don't need to handle symbol clashes with QtQuick1 anymore. [ChangeLog][QtQml] The functions qmlDebug, qmlInfo, and qmlWarning are no longer available in the QtQml namespace. Use their counterparts in the global namespace. Fixes: QTBUG-88637 Change-Id: Ia74510bd711790cebf55de4cd668891712f6835e Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Adjust to QPropertyBindingPrivate not using std::function anymoreFabian Kosmale2020-11-041-7/+7
| | | | | Change-Id: Id197f3d4bf8ab60256040e0a177d5596ce78a0a8 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Avoid various warnings about deprected QMetaType methodsUlf Hermann2020-09-161-7/+6
| | | | | Change-Id: I8f4b2703fdd08ff341904219cec33c321e0511c7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QQmlPropertyBinding: detect binding loopsFabian Kosmale2020-08-121-0/+14
| | | | | | | | | | | | | | Calling markDirtyAndNotifyObservers bypasses the currently existing mechanism in QProperty to detect binding loops. Moreover, simply changing updating from private to protected and setting it to true does not help us here: That would trigger a binding loop warning every time the static callback of a QNotifiedProperty acesses its current value. Thus, we add another bool to detect expressionChanged loops. To reduce memory usage, we store it as a second flag in m_error (from QQmlJavaScriptExpression). Change-Id: If931d7ff58b5f9bb277e803826b28e133b2c15dc Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QQmlPropertyBinding: use QMetaType::equals for comparisonFabian Kosmale2020-08-121-4/+4
| | | | | | Change-Id: I5f36e9543a32e7d271a5a4217ea3b55cc03bea32 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Adjust qqmlpropertybinding to the changes in QPropertyLars Knoll2020-07-151-14/+17
| | | | | Change-Id: Iaea6428fe9a6de69d8022089da590c42f94ea977 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QQmlPropertyBinding: convert to correct typeFabian Kosmale2020-06-251-2/+4
| | | | | Change-Id: I5b7b4d670c6308b33a2fd0580790934345bb3504 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Fix QQmlPropertyBinding::evaluateFabian Kosmale2020-06-151-1/+6
| | | | | | | | | | | | When a class is in a semi-deleted state (QQmlData::wasDeletet returns true, but the QQmlElement has not been removed yet), we can still end up calling evaluate under some circumstance. This can be observed in qqc2's tests, for instance tst_palette. In those cases either ctxt or ctxt->engine() might be nullptr. We handle this by returning an error; as the object is about to be gone, the result does not matter anyway. Change-Id: I8a42263a9b44012822f5a827da8eae97d3160165 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Update dependencies.yaml and adapt to API changes in qtbaseSimon Hausmann2020-04-221-15/+6
| | | | | | | | | | | | | | | | The evaluation callback does not have to perform the comparison anymore and the shared pointer of the private is not used in the API anymore. Also, the versionFunctions() has been moved out of QOpenGLContext and renamed QOpenGLVersionFunctionsFactory::get(). QHash doesn't keep iterators stable under erase(), so clean up the code relying on it, and avoid an intermediate QList at the same time. Task-number: QTBUG-74409 Change-Id: I90176be1067d88c8f2b1ea07198a06d432f5be9c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add support for binding ahead-of-time compiled bindings to QPropertiesSimon Hausmann2020-04-221-0/+15
| | | | | | | | | | When the ahead-of-time built binding returns the same type as the QProperty, then we can connect them directly with a small shim and pass through the context and scope objects. Change-Id: I9cb49d1fa35490a4ccb06965397674d5534c067d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add support for translation bindings on QProperty based propertiesSimon Hausmann2020-04-021-1/+23
| | | | | Change-Id: I439653123cdc96df97a1801664655c9d28a8b9b5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add support for binding directly to QProperty instancesSimon Hausmann2020-03-301-0/+101
Avoid going through externally managed bindings and instead allocate a more lightweight property binding. It's basically a QQmlJavaScriptExpression and one pointer plus the overhead of QPropertyBindingPrivate. Change-Id: I1530330926d351b61f2b3bbad39301c628a8bef1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>