aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlproperty
Commit message (Collapse)AuthorAgeFilesLines
* Make it possible to handle pointers to QObject derived in QML.Stephen Kelly2013-09-101-2/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This way, properties of QObject derived types can be read in QML code for example: Q_PROPERTY(MyObject* obj READ obj CONSTANT) Previously, only QObject* types could be read by QML: Q_PROPERTY(QObject* obj READ obj CONSTANT) This meant that multiple properties and methods had to be created for classes which were relevant to both QML and non-QML code. This patch lifts that restriction. As a consequence, we can also remove a Q_EXPECT_FAIL from the qqmllanguage unit test. That test was introduced in commit 92562eacbc3c (Allow signal parameters which are custom QML object-types, 2012-07-13) to document knowledge of the limitation while fixing it as much as possible. Task-number: QTBUG-26662 Change-Id: Ic85fa73c6f3655189438ec509765bae2eab9993a Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Get rid of the signal expression rewriterSimon Hausmann2013-07-031-17/+17
| | | | | | | | | | | | | This replaces the entire rewriter with more or less: expressionToEval = "(function(<named params here>) { " + expr + " } )" This also fixes crashes at run-time when the signal rewriter was executed from the loader thread and tried to use a v4 identifier hash with the same engine that's also in the main thread. Change-Id: Ib1e4927d330706a593411fbff64ed3da1e23d0e0 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix qqmlproperty::warnOnInvalidBindingSimon Hausmann2013-06-152-2/+2
| | | | | | | | | * Add column to expected warning message * Get rid of eval that doesn't make sense with only one JS engine and doesn't work in strict mode Change-Id: I63cd3784cd8c255af8832ea5ca1e6e5e2d48431e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix compilation with built-in v4vm JS engineSimon Hausmann2013-04-151-1/+1
| | | | | Change-Id: Ieda9267e296acf6392a5461f4cfb9233a7a409a0 Reviewed-by: Lars Knoll <lars.knoll@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>
* Avoid dynamic lookup of signal handler argumentsMichael Brasser2012-08-241-19/+20
| | | | | | | | | | | Rewrite signal handlers to include the parameters in the rewrite. Also check whether parameters are actually used when possible, and if not don't provide them to the expression. Change-Id: I7d65c05f4639979dd61035cf7478119ef7647c25 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Trim trailing whitespace.Stephen Kelly2012-08-221-7/+7
| | | | | Change-Id: I3d268d3ce8d73c7287f51abe9a28c165cb75acb9 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-011-0/+1
| | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I6988c2360e9d88916311374a0c910bfc5b607439 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Decode directory separators in source URLsMatthew Vogt2012-06-251-1/+2
| | | | | | | | | 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>
* Lazily create QMetaObjectsAaron Kennedy2012-05-241-1/+1
| | | | | | | | | | 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>
* Improve composite property type unit testChris Adams2012-05-171-13/+60
| | | | | | | | | | | | | | | | Previously, the test ensured that the (variant) value returned by QQmlProperty::read() was identical to that returned by QMetaProperty::read(), which isn't the case if an engine is passed to the QQmlProperty constructor. This commit expands the unit test to ensure that the actual QObject-ptr value is identical, rather than the variant value (which may have differing type information), regardless of whether an engine is passed in or not. For list properties, the individual values are (in general) not able to be accessed, and so the unit test for list properties is relaxed. Change-Id: Iec40dca147a0bb793359b28facbcae69cc49c1ad Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
* Fix composite type property supportChris Adams2012-05-164-0/+111
| | | | | | | | | | | | | | | | The metatype changes caused a regression in composite type properties for which there was no autotest. In particular, declarative previously used the transitional QMetaType::registerType() function, whose implementation specifies a zero-size, which means that accessing a property of that type via QObject::property would fail. This commit adds some unit tests to track the issue, and also fixes the implementation of QQmlEnginePrivate::registerCompositeType to use the updated metatype registration functions. Task-number: QTBUG-25697 Change-Id: Ic4abc1711aee8cf4a50a2ef1769465ef73f5d022 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* More robust tracking of signal handler expression ownership.Michael Brasser2012-05-011-17/+17
| | | | | | | Reference count the expressions, and improve testing. Change-Id: I810509eae1c7608b367e9ff5f7891a294667a692 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
* Update test after QUrl minor behaviour changeThiago Macieira2012-04-121-7/+9
| | | | | | | | | | | | | | | Changes required: - Uppercase the hex in percent-encodings - The tolerant decoder treats all % as broken if any one is broken (Input "%2B50%" is rendered now "%252B50%25", where previously it was "%2B50%25) The extra test is just so we use QString first. If the test fails, we get a nicer output from QtTest, instead of the hex dump it uses for QByteArray. Change-Id: I4c5cbfa3be962c648b50a69dc8bc3c4acc551e62 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Merge remote-tracking branch 'origin/master' into api_changesLars Knoll2012-04-112-60/+114
|\ | | | | | | | | | | | | | | | | | | | | | | 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-042-0/+6
| | | | | | | | | | | | | | | | | | 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>
| * Loosen shared binding testsAaron Kennedy2012-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously we blocked all function calls, but only because we were trying to prevent "eval" calls from appearing in shared bindings. Instead this test allows function calls as long as the identifier "eval" doesn't appear. This also exposed a crash with v8 bindings that is also fixed. Change-Id: I22eefd290c7b82d9c01b2cd2907a46e560ae4db9 Reviewed-by: Chris Adams <christopher.adams@nokia.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
| * Use minimal javascript expression for bound signalsChris Adams2012-03-291-60/+74
| | | | | | | | | | | | | | | | | | | | | | 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-282-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | 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-191-23/+21
|\| | | | | | | | | | | | | | | | | | | 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-21/+21
| | | | | | | | | | | | | | | | 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-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Adapt to Qt5 meta-object changesKent Hansen2012-03-131-13/+13
|/ | | | | | | | | | | | | | | | | | | 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>
* Remove unneeded dependencies to QtWidgets and QtOpenGLLars Knoll2012-03-121-1/+1
| | | | | Change-Id: I43bb54524f5786a838073df8812107dda7b0d56e Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Skip test that accesses deleted QML engineKent Hansen2012-03-121-0/+2
| | | | | | | | | | The test is blocking the CI because it crashes on linux/x64. By "luck" it doesn't crash on the other test machines -- valgrind still complains, though. Task-number: QTBUG-24734 Change-Id: I6bc12ca72f8900339bc9139b40cf828aff8e47ba Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Changed qml tests to work from install directoryKurt Korbatits2012-03-071-3/+1
| | | | | | | | | | - Changed tests to use TESTDATA - moved qqmlcontext to private test as it contains private header - added check for cross_compile option to skip when sources not available Change-Id: I0f68f58ffcb1b41b8e40a9851e3e003fe72ee2f9 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com> Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
* Rename QDeclarative symbols to QQuick and QQmlMatthew Vogt2012-02-248-0/+1785
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>