aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlproperty.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Restrict v8 property lookup to the execution contextMatthew Vogt2012-08-271-4/+4
| | | | | | | | | | | | | When resolving property names, only properties known to the current context of execution should be available. If a property name has been overriden by a component extension, code executing in the context of the base component should resolve the property name to the property available inside the base component or its bases. Task-number: QTBUG-24891 Change-Id: I9687cc28e108226d5a939627a901c8254344b598 Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Permit value types with metatype IDs >= QMetaType::UserMatthew Vogt2012-08-101-73/+37
| | | | | | | | | 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>
* Trim trailing whitespaceStephen Kelly2012-07-171-52/+52
| | | | | Change-Id: Iafc5a94bb07c499b581bfec300d01e0fde165146 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Use V4 binding for non-final properties where possibleMatthew Vogt2012-07-091-0/+26
| | | | | | | | | 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>
* Decode directory separators in source URLsMatthew Vogt2012-06-251-2/+8
| | | | | | | | | URLs with encoded directory-separator characters are not correctly processed by QUrl. Task-number: QTBUG-25981 Change-Id: I78173ef44c4850774b56753335bea34db04c0735 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Disallow signal-handler-specification for non-signal methodsChris Adams2012-06-211-1/+1
| | | | | | | | | | | | | | Previously, the code which checked whether a signal handler specification was valid was incorrect, in that it only checked that a method of the appropriate name existed (rather than specifically a signal method). This commit ensures that the appropriate code is updated to check the method for signal-ness. Task-number: QTBUG-26223 Change-Id: I306f6622aaa710d86c01d5bbc5146eecce7cf2c3 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Adapt to connection-related changes in qtbaseKent Hansen2012-06-121-12/+41
| | | | | | | | | | | | | | | | | | | 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>
* Avoid unnecessary QByteArray creationKent Hansen2012-06-051-1/+1
| | | | | Change-Id: I5e76a6f74c39bbffdf31aef2367efeecf1dcf19c Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Delay conversion of v8 exceptions to QQmlErrors.Michael Brasser2012-06-051-9/+9
| | | | | | | | | This conversion in relatively expensive, and not required for transient exceptions that occur during startup due to the order of binding evaluation. Change-Id: I29a16c075890c8966c0bad0a77412ad232c791bb Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Remove dead codeKent Hansen2012-06-011-28/+0
| | | | | Change-Id: If93723e48e1088d1e0664b315058803e2f61bdab Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Fix another crash due to unregistered enum typesChris Adams2012-06-011-0/+2
| | | | | | | | | | f62ab0a3dfaa873bb15cd1526f98f50a17228a9c missed one other case, when binding valid property values to invalid property types. This commit fixes that case, and adds both binding and assignment tests for that case. Change-Id: Iaca889e4214d2218012d30c4a00f2aac886375f7 Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Fix crash caused by unregistered enum typesChris Adams2012-05-281-1/+6
| | | | | | | | | | If the enum type isn't registered with Q_ENUMS, the metatype lookup fails, which results in a crash in certain circumstances. This commit ensures that when assigning an undefined value to an unregistered-enum-type property, no crash occurs. Change-Id: I0b539b591c9c9d6262c748300e4f4b6813d4f9a6 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Use static dispatch tables for QQmlAbstractBindingAaron Kennedy2012-05-241-3/+3
| | | | | | | | | 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>
* Lazily create QMetaObjectsAaron Kennedy2012-05-241-94/+90
| | | | | | | | | | 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>
* Enable binding to properties of type QJSValue.Andrew den Exter2012-05-241-1/+9
| | | | | | | | | This allows javascript objects of all types to be bound to properties declared in c++. Compared to a QVariant the primary benefit this offers is a type which functions and objects with functions can be bound to. Change-Id: Idb3313e7ff1d616ab12d44f616083c8296201f3a Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Simplify QVariant::convert and QVariant::canConvert calls.Jędrzej Nowacki2012-05-211-1/+1
| | | | | | | QVariant::Type casts are not necessary in Qt5. Change-Id: Ia2e7d8fa367a59c23bd06993db36d96a0a46a229 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Allow the existence of a VME metaobject to be assertedMatthew Vogt2012-05-211-2/+2
| | | | | | | | | Test for the existence of a VME metaobject. Otherwise, assertion of a static cast result is not meaningful. Change-Id: Ic9e9c38e5dce65c41d20e405c33e179334c37b00 Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* QtQuick: Fix string related warnings, single character strings.Friedemann Kleint2012-05-141-1/+1
| | | | | | | | | - Fix warnings about truncation from size_t to int (MSVC 2010, 64bit). - Remove single character strings. Change-Id: Iaf4406e4e04d55d2d8b762f3433269868842a6f9 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* Permit signals to be emitted in a different threadAaron Kennedy2012-05-111-1/+2
| | | | | | | | | | | | The QQmlNotifier approach to connecting to signals did not support the cross-thread signal/slot model used elsewhere in Qt. This change allows one specific case of that - emitting a signal in a different thread than the one the QObject lives - to work. Task-number: QTBUG-25647 Change-Id: Ia8fdaf4c7d7e2ccd7ff7657bb1d8e26277eb60aa Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* More robust tracking of signal handler expression ownership.Michael Brasser2012-05-011-10/+25
| | | | | | | Reference count the expressions, and improve testing. Change-Id: I810509eae1c7608b367e9ff5f7891a294667a692 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Use QUrl constructor directly.Michael Brasser2012-04-201-22/+6
| | | | | | | | | setEncodedUrl is deprecated, and no longer required as the new QUrl makes this behavior default. This is a partial revert of 3aa53b8bc383ebcdf8dc922b2670170ec012949f. Change-Id: I14f29cbe2a2e2cd9c41f7afc92b1cb66b53996bb Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Merge remote-tracking branch 'origin/master' into api_changesLars Knoll2012-04-111-13/+24
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/debugger/qqmlprofilerservice_p.h src/qml/qml/qqmlboundsignal.cpp src/qml/qml/v4/qv4bindings.cpp src/quick/items/qquickshadereffect.cpp src/quick/particles/qquickcustomparticle.cpp src/quick/qtquick2.cpp Change-Id: Ia9c6517035ae912fa75e77473a452bd3383def56
| * Do not crash on invalid binding diagnosticMatthew Vogt2012-04-041-2/+3
| | | | | | | | | | | | | | | | | | If there is no meta object for the property type of the recipient of an invalid binding, fall back to QMetaType::typename(). Task-number: QTBUG-25161 Change-Id: I0bb768cbc166c04f62d20d8bb19e6ae883d7dc2f Reviewed-by: Chris Adams <christopher.adams@nokia.com>
| * Use scope, not owner to look up enums in QQmlBoundSignal.Michael Brasser2012-04-031-1/+0
| | | | | | | | | | | | | | | | With this, we no longer need to keep a pointer to the owner, so remove it as well. Change-Id: I0c38645b924bf5b0caadb46444cf6dd09abc1eb2 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
| * Revert "Add QQmlBoundSignalNoParams"Michael Brasser2012-04-031-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ec7deb3d123bb44b5d57590615a60ed48b1d2860. Other Qt modules may be relying on QObject::receivers() to know when there is a QML signal handler for a signal, and using QQmlNotifierEndpoint in QQmlBoundSignalNoParams breaks this assumption. Change-Id: I1b8085254697d909f85a88617eb4e3f258b88950 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>
| * Warn on incompatible v4 binding object typeMatthew Vogt2012-03-281-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | For QObject-derived properties, verify that the type of the source object is convertible to the type of the target object, and report an error for incompatible assignment attempts. Task-number: QTBUG-24986 Change-Id: Ieece29a017222e48351cd433c1b2f9e2d93a5fd7 Reviewed-by: Chris Adams <christopher.adams@nokia.com> Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* | Merge master into api_changesKent Hansen2012-03-271-19/+32
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/debugger/qqmlenginedebugservice.cpp src/qml/debugger/qqmlprofilerservice_p.h src/qml/qml/qqmlboundsignal.cpp src/qml/qml/qqmlpropertycache.cpp src/quick/util/qquickimageprovider.cpp Change-Id: I0609aa5ed54c7769f1e2773a96a7cd43a69f133c
| * Add QQmlBoundSignalNoParamsqt-v5.0.0-alpha1Michael Brasser2012-03-271-1/+5
| | | | | | | | | | | | | | | | This class is used for signal handlers with no parameters, and is more lightweight than QQmlBoundSignal. Change-Id: Ie63eb989d334906657fd16fe35386df198654c28 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
| * Update documentationAlan Alpert2012-03-271-1/+4
| | | | | | | | | | | | | | | | | | Added \inmodule tags for qml module classes which were lacking them. Also updated the \since to 5.0. Change-Id: Ia5d393d593fdb484893cd4e3796b6854d4c637b3 Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com> Reviewed-by: Chris Adams <christopher.adams@nokia.com>
| * Remove QObject parenting from QQmlAbstractBoundSignal.Michael Brasser2012-03-261-17/+23
| | | | | | | | | | Change-Id: If549cf57bbac18a986a2a0e63fdc76902d2dae43 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
| * Use QQmlAbstractBoundSignal where appropriate.Michael Brasser2012-03-261-2/+2
| | | | | | | | | | | | | | Prepare for the addition of another subclass. Change-Id: I340f735503e661d9d735f3316a065f807294921b Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* | Merge master into api_changesKent Hansen2012-03-191-18/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/qml/debugger/qqmlenginedebugservice.cpp src/qml/qml/v8/qv8qobjectwrapper.cpp src/quick/util/qquickimageprovider.cpp tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp Change-Id: Ie78ba2fabd32f4812bcae9dbdd66ed289dc11dcb
| * Remove binding dependency on QQmlExpressionAaron Kennedy2012-03-151-18/+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>
| * Move binding and expression classes to separate filesAaron Kennedy2012-03-131-0/+1
| | | | | | | | | | Change-Id: Ia9c6996a606e140f31681ecd26d93b1b0fdedf02 Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
* | Crash fix after QMetaType change.Jędrzej Nowacki2012-03-131-1/+1
| | | | | | | | | | | | | | | | QMetaType::UnknownType was added so we can distinguish between "void" and an unregistered type. Change-Id: If8cee21b3f84bf129343dc457d10ab31a9bfc8b8 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* | Adapt to Qt5 meta-object changesKent Hansen2012-03-131-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMetaMethod::signature() has been renamed to methodSignature(), and it now returns a QByteArray. Also, the new function QMetaMethod::isValid() should be used to determine whether a method is valid, instead of relying on signature() returning a 0 pointer. Where it makes sense, the existing code that was using signature() and parameterTypes() has been changed to use the new API QMetaMethod::name(), parameterCount(), and parameterType(int). Also, in the new meta-object revision (7), the QMetaObject stringdata member is now of type QByteArrayData*. QFastMetaBuilder will be ported to generate the new format, but for now it's sufficient to reinterpret_cast the stringdata assignment to keep it compiling. Change-Id: Ie340ef17bcebc3afa4aae6450dfe2d06e4d881a4 Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* | Improve support for var propertiesChris Adams2012-03-051-5/+15
|/ | | | | | | | | | | | | | | | | | | | | This commit changes the semantics of function assignment in QML. Previously, function assignment was interpreted as binding assignment. Now, function assignment is interpreted as function assignment, and therefore fails for all property types other than "var" properties. To support imperative binding assignment, a new function was added to the Qt object: Qt.binding(function) which takes a single function parameter and returns a function object which will be interpreted as an assignable binding expression by the QML engine. Finally, this commit also slightly changes the semantics of var properties in that the "special" JavaScript values of null and undefined may be assigned to var properties, rather than being interpreted as reset requests. Task-number: QTBUG-21842 Change-Id: Iee99a878b9badf0fb76e983da7ebfa493f55ceb5 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-241-0/+1917
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>