aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
Commit message (Collapse)AuthorAgeFilesLines
* V4: fix range splitting when split is between intervals.Erik Verbruggen2014-01-173-1/+168
| | | | | | | | | | | Also added some "white-box" unit tests and sprinkled in a bit of documentation. The case that went wrong is covered by the test rangeSplitting_1: before the fix, the new interval would have two ranges: [66-64],[70-71]. The first range is invalid and should not be there at all. Change-Id: If0742f4e6a96d98ea5d696f95126886ba66f92bb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Increase the timeout for QPacketProtocol testsUlf Hermann2014-01-161-1/+1
| | | | | | | | | Recent failures when testing a completely unrelated one-line commit (https://codereview.qt-project.org/74584) suggest that the timeout is actually too small. Change-Id: I9c3fd0b09c6be2d42f92485c3c223fe88bb8328e Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Make sure that profiling can only be started if debugging is enabled.Ulf Hermann2014-01-154-3/+91
| | | | | | | | | | | Enabling the profiler doesn't make much sense if there is no debug service as the messages can't be sent anywhere then. Furthermore, the profiler instance is only properly initialized if debugging is enabled and thus enabling profiling without debugging being enabled can cause problems. Change-Id: I784a110126d45a9a2bc9d9e14d9a22e2980c3a42 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Fix some compiler warnings in tests and examples.Christian Kandeler2014-01-151-0/+1
| | | | | Change-Id: Ia739c995005635caf6fd0bd4e495ed8567350e83 Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* [ChangeLog][QtQml] Fix JavaScript Array.pop() not updating the internal ↵Simon Hausmann2014-01-071-0/+13
| | | | | | | | | | | | | array length correctly While the length property was reporting the correct value, the internal array length was out-of-sync. Task-number: QTBUG-35979 Change-Id: I68820a349cf1ce88c6aabc6a2301a8a861018a10 Reviewed-by: Liang Qi <liang.qi@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix property access to QQmlPropertyMap objects when addressed via idSimon Hausmann2014-01-021-2/+27
| | | | | | | | | | | | Property access to id objects is optimized at compile time, but we cannot do that for QQmlPropertyMap instances (or generally fully dynamic types). This issue was a regression against Qt 5.1 Task-number: QTBUG-35906 Change-Id: I759a1a899f6a3a1f6466282f455b289ad7451086 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix lookups of enums in singletonsSimon Hausmann2014-01-024-0/+39
| | | | | | | | | | | | | | | | | | | This is a regression against 5.2.0 (which didn't have this bug), due to optimizations introduced in the stable branch after the release. The code path for optimizing access to the members of C++ based singletons through the regular meta-object properties would end up excluding access to enums when the lookup happens at run-time. The run-time getter for the singleton itself would return a wrapped QObject instead of a QQmlTypeWrapper, and only the latter includes enums. As QML based singletons (composite singletons) cannot declare enums, we can continue to do fast lookups on these, but otherwise have to fall back to the slower code path. Task-number: QTBUG-35721 Change-Id: Icc66bdaf3572622cdb718f82b706e3204afa0167 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4: re-enable test cases disabled for QTBUG-34047Erik Verbruggen2014-01-021-9/+1
| | | | | | | Task-number: QTBUG-34047 Change-Id: Idcce254f3594e1f7021705704dbe6a2330aa7e65 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-12-122-1/+9
|\ | | | | | | | | | | | | Conflicts: src/qml/qml/qqmlcompiler.cpp Change-Id: I802731139d47c5b733dd805f7bf432d67d7331e1
| * Fix a crash in JSON.parseLars Knoll2013-12-041-0/+8
| | | | | | | | | | | | | | | | | | | | Properly set members that are actually array indices and don't crash when trying to set those. Task-number: QTBUG-35383 Change-Id: I04d4b65c27e97a2e9db19541ed46ee1bb202f780 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
| * Revert "Revert ffaf39e9a7f11d4e2800b3b37160a2a952795614"Alan Alpert2013-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | This reverts commit 27052dcad9810869a9065da4c06e9f14379411d7. While the additional flexibility would be nice, I've been reminded that we already did commit to it back in July. Change-Id: Iaf990dda98ee46eb028b4737bdeeafd050d9513f Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* | Fix regression in QML string list concatenationsSimon Hausmann2013-12-111-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | String lists and other QList property types (wrapped as QQmlSequence) should behave like arrays and have the Array prototype. Therefore it should be possible to pass them also as parameter to concat and they get composed correctly, i.e. the individual items get appended instead of the list being appened as one item. In the spec for concat this "special" casing should be applied if the "class internal property" is "Array", and concat appears to be the only place where this check is done. Therefore this patch adds another exception to match the expected behavior in QML and extends the "internal class is Array" meaning to QML list types. This is a regression from Qt <= 5.1.x Task-number: QTBUG-33149 Change-Id: Iab9522ac3c4ae6b746e790a99d87501b1cc1b655 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix broken Maroon game / regression in PropertyChanges {} elementSimon Hausmann2013-12-104-0/+115
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 0aadcf8077840068eb182269e9ed9c31ad12f45e that pre-compiles the expressions in PropertyChanges {} introduced a regression in where the evaluation context was incorrect and thus bindings would not be able to access the correct properties. For example PropertyChanges { target: someObject y: height / 2 } Here height should be looked up in the context of "someObject", not of the PropertyChanges element. This patch introduces an auto-test that verifies that the lookup context is correct and fixes the bug by disabling accelerated compile time property lookups for binding expressions that are requested from a custom parser. Change-Id: I5cb607d07211b453ddfc9928ccbf5f9ecec85575 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix dependency calculation for context and scope propertiesSimon Hausmann2013-12-052-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were incorrectly calculating writing to a context or scope property as a dependency for an expression. We don't know whether a property is being written only or also being read from at lookup time, but we can make that decision in the isel then when generating the move instructions. So initially context and scope properties end up in a candidate set first and get promoted to real dependencies when they're being used in reading moves. Task-number: QTBUG-35210 Change-Id: Ia67057abafc2d611e1e6605327b4965ebe91cbed Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix dynamic properties in QQmlPropertyMap not always being visible in QMLSimon Hausmann2013-12-051-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQmlPropertyMap is a fully dynamic class that can add properties at any point in time. In order for these properties to be visible inside QML, we must disable the property cache (instead of trying to unsuccessfully re-fresh it). What happened in this particular case is that the QQmlPropertyMap derived type was instantiated and the VME instruction for creating it would also assign the property cache the compiler determined. There's no way for QQmlPropertyMap itself to access this property cache instance (stored in output->types[id].typePropertyCache) or invalidate it, so instead don't use the compiler's property cache when instantiating the type. This patch also disallows the adding properties to QQmlPropertyMap when it is used as base type for a new QML type, as we cannot provide the derived type to the QQmlPropertyMap constructor - this is only possible in C++. Task-number: QTBUG-35233 Change-Id: I7fa9e4a2224ccfdd7ccb3fd9f73919ecd46058a8 Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net> Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Encapsulate the current context and fix it's usageLars Knoll2013-12-042-4/+4
| | | | | | | | | | | | | | | | | | | | | | Encapsulate accesses to the current context, and rework the way we push and pop this context from the context stack. Largely a cleanup, but simplifies the code in the long term Change-Id: I409e378490d0ab027be6a4c01a4031b2ea35c51d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix url type testLars Knoll2013-12-041-2/+2
| | | | | | | | | | | | | | | | it passed before, but wasn't testing two methods it should be testing. Change-Id: I5784ecfe1b5a00620832c7b995ed3cf5ed7e27dd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix qsTr() in .js contextJ-P Nurmi2013-12-043-31/+134
| | | | | | | | | | | | | | | | | | Don't assume a four characters long file name suffix (.qml) Task-number: QTBUG-32850 Change-Id: I522c06b71bf1b38f32f2947a6c06017f83eb50be Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* | Adapt tests to new events from qqmlprofilerserviceUlf Hermann2013-11-291-10/+10
| | | | | | | | | | Change-Id: I59baa1f9aa0751d4bffc6eff0332318efc6fe9a8 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix JavaScript signal connect on alias without other handlersSimon Hausmann2013-11-292-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | The changed handlers for aliases are connected lazily in the engine. QQmlPropertyPrivate::flushSignal is responsible for that and called in other places, for example when installing a onSomeAliasPropertyChanged handler. However we were missing a call to flushSignal when doing onSomeAliasPropertyChanged.connect(...), i.e. using the JavaScript connect API. Task-number: QTBUG-30493 Change-Id: Ia3f008626fd7af3f2cfbdd30d13fb83158bed4d5 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | tst_qqmlxmlhttprequest: Use QScopedPointer.Friedemann Kleint2013-11-211-196/+99
| | | | | | | | | | | | | | | | Ensure resources are cleaned up in case of failing tests. Change-Id: Ie27800da37beac09fec34111af276ed029dcde20 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
* | Merge remote-tracking branch 'origin/release' into stableFrederik Gladhorn2013-11-2025-23/+505
|\| | | | | | | Change-Id: Id732233d56e8d1706f62ef7a153d4a471406c551
| * V4: fix Array.indexOf() for QStringListLiang Qi2013-11-202-0/+15
| | | | | | | | | | | | | | | | | | Autotest is included. Task-number: QTBUG-33542 Change-Id: I46c3a81006019c6613a3d35aa018217f85a15d0b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Liang Qi <liang.qi@digia.com>
| * V4: remove failing assert and fix code.Erik Verbruggen2013-11-192-0/+26
| | | | | | | | | | | | | | | | | | | | Assert failed for cases where the node’s ancestor with lowest semi-dominator number was not the same as the parent. The test case exemplifies this. Task-number: QTBUG-34792 Change-Id: Ie6847b22a27211801bff7479bfcbfaf329c6005a Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
| * Fix failing assertion when trying to assign to an id referenced QML objectSimon Hausmann2013-11-192-0/+18
| | | | | | | | | | | | | | | | | | | | References to id addressed QML objects are member expressions, which are unlike other member expressions by not being lvalues. Handle this correctly. Task-Number: QTBUG-34890 Change-Id: Ied6230edbc561128ad36bf0d1a1918185204deec Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Make comparison of singletons and qobjects workAlbert Astals Cid2013-11-183-0/+120
| | | | | | | | | | | | | | | | | | | | | | Otherwise you can end up with some weird situation in which you have two objects, you print them and then you print the comparison and get a Foo(0x858480) b Foo(0x858480) a == b false Task-number: QTBUG-34651 Change-Id: Id2444d919f039be085eb5ed9112345db691540a5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Fix interaction between head room and appending in arraysLars Knoll2013-11-181-0/+13
| | | | | | | | | | | | | | | | | | | | We reserve space on both ends of the JS array for appending and prepending. Make sure they interact well with each other and don't cause any memory corruption. Task-number: QTBUG-34853 Change-Id: I184280178690e3cb12ab9b199a8436b32383af38 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * Don't assert in QQuickItem::updateLars Knoll2013-11-182-0/+22
| | | | | | | | | | | | | | | | | | | | | | The method can actually be called from QML, so we can not have an assert in that method. Instead simply return if the item has no contents Task-number: QTBUG-34060 Change-Id: Ib28ffa5c6c63fbec956abe25020010ed73a9cfa9 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| * Limit the amount of memory we allocate on the stackLars Knoll2013-11-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setup limits for both the C and the JS stack, and check them before entering functions. If we run out of space, throw a RangeError exception. Be careful and recheck the stack bounds when things go outside. This catches the case where the engine got moved to another thread changing the stack boundaries. Windows currently uses an unsafe fallback implementation, this needs to be fixed later on. Task-number: QTBUG-34568 Change-Id: I22fbcbec57b28f9cc8a49e12f1cc6e53e4f07888 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
| * Don't call receivers from disconnectNotifyAlan Alpert2013-11-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | A pending documentation update is going to explain that you can't call into QObject functions from disconnectNotify, or it may deadlock on the signalSlot mutex. Task-number: QTBUG-34829 Change-Id: I57e7b4e457d813d4255c8cdbe36228b2e0f45aaa Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Remove '-enable-debugger' argument from qml executableKai Koehne2013-11-165-7/+3
| | | | | | | | | | | | Task-number: QTBUG-34836 Change-Id: I3ab2a16036a1086c0ac1f50880a402caf9f54f2d Reviewed-by: Alan Alpert <aalpert@blackberry.com>
| * Fix === operator for value typesLars Knoll2013-11-154-1/+69
| | | | | | | | | | | | | | | | | | Fix === comparison for urls and other QML value types. Task-number: QTBUG-33546 Change-Id: I4a7066e6bbc7de7c599fe2c7b2fdfb75e0ff5196 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * Don't crash when trying to assign to null.propLars Knoll2013-11-153-0/+32
| | | | | | | | | | | | | | | | | | | | Fixes a regression introduced during the exception handling refactoring. Task-number: QTBUG-34544 Change-Id: Ib751274d759030db3e5d3b1380b30dc07ec85f83 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * Make tst_qqmlprofilerservice more robustKai Koehne2013-11-151-2/+3
| | | | | | | | | | | | | | | | Don't expect only application output to be printed. E.g. a stray qDebug somewhere in Qt could break this test so far ... Change-Id: Ibdc31fba3bd8d822c264bd44515d16e648db9a8e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * V4 debugging: Fix instable test.Erik Verbruggen2013-11-141-2/+2
| | | | | | | | | | | | | | | | | | Request the scripts after hitting a breakpoint. The reason this test could fail before, is that the engine might be calling into the debugger even before any script was loaded. Change-Id: Iba49f445ab97afaf2bb168b04063432ca2f9dddd Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Allow passing qmlRegisterSingletonType QObjects to C++ as QObject*Albert Astals Cid2013-11-144-0/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | At the moment you can pass them as their FinalType* or as one of their ParentType* but not as QObject* which does not make much sense to me Task-number: QTBUG-34617 Task-number: QTBUG-30730 Change-Id: Id5cfb7bbb123456ef43f44f33b450f8966a7641a Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| * Revert ffaf39e9a7f11d4e2800b3b37160a2a952795614Alan Alpert2013-11-131-1/+1
| | | | | | | | | | | | | | | | | | Making it public right now seems a little premature, given all the work happening on the engine now (and for 5.3). We'll be in a better position to commit to it or not next release. Change-Id: Ib7b14afeb9205fb8a87ed16a6d38b1f468b2bbbb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * Polish up QQmlFileSelectorAlan Alpert2013-11-132-9/+20
| | | | | | | | | | | | | | | | Incorporate beta feedback, and hide QQmlAbstractUrlInterceptor as the implementation (instead of making that "the API"). Change-Id: Ib7b14afeb9205fb8a87ed16a6d38b1f468b2aaaa Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * V4 IR: scan arguments when entering function scope in QML.Erik Verbruggen2013-11-122-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | When doing IR generation for a function declaration in a QML object, call through the helper methods to check for forbidden names, and most importantly, also checks if the function has parameters. If the latter is the case, they need to be added as a member for the current scope in order to get IR generation correct. Task-number: QTBUG-34493 Change-Id: I0ade15ee19e1b1ac8ee2f2d3fa186d1551800199 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
| * V4: fix loop block marking for initializer blocks.Erik Verbruggen2013-11-122-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Any new blocks generated as part of the initializer were incorrectly marked as belonging to a loop. For example, if a LocalForStatement would contain a ternary expression, the generated then and else blocks would be marked. This would confuse the block scheduling, because all blocks are postponed unil the condition block (“group start”) is scheduled. Task-number: QTBUG-33754 Change-Id: I45919ebeac356f015bb91fe0210472b3df0b56d8 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Stabilize tst_qpauseanimationjobFrederik Gladhorn2013-11-201-34/+17
| | | | | | | | | | | | | | | | | | This test is highly timer dependent and contains so many windows special cases that indicate problems (when timers are not accurate or the machine is busy). Change-Id: Ie057d560d39300252ffb6c19b4d1446179c0e56a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | qqmldebugclient.cpp: Fix warning about missing return.Friedemann Kleint2013-11-181-0/+1
|/ | | | | | | | | | | In file included from ../shared/qqmldebugclient.cpp:473:0: ../shared/qqmldebugclient.cpp: In member function 'QString QQmlDebugClient::stateString() const': ../shared/qqmldebugclient.cpp:452:1: warning: control reaches end of non-void function Change-Id: Ic5422dcff41591691621077ade45b6ea3ea3a8f1 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Intercept qmldir files with the url interceptorAlan Alpert2013-11-116-1/+31
| | | | | | | | | | | There's another code path which loads qmldir files directly, and it did not use the interceptor when available. Note that this, like other interceptors, does not affect baseUrl and so any other qmldir file still must have paths relative from the initial URL. Change-Id: I620943c36d488d22fbaf1793514075d31ab76e3e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Debugging with V4Erik Verbruggen2013-11-103-319/+177
| | | | | | | | | Currently missing, but coming in subsequent patches: - evaluating expressions - evaluating breakpoint conditions Change-Id: Ib43f2a3aaa252741ea7ce857a274480feb8741aa Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Add a new variant of qmlRegisterSingletonType for QML singletons.Antti Piira2013-11-093-0/+123
| | | | | | | | | | | | | | Adds a new public API to register a QML based singleton type from C++. This is the equivalent of the the qmlRegisterType, but for singletons. qmldir file is not needed for types registered through this function, but the type still needs to include the following pragma statement among the import statements: pragma Singleton Change-Id: Icb35b665fe2a8605667fe8ac575347be2a60490c Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix a few more compiler warnings in release buildsLars Knoll2013-11-091-7/+0
| | | | | Change-Id: I826226b7ddd4a74037b5bbe9a4a7322d404f53a9 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove debugging tests for commands not used by Qt Creator.Erik Verbruggen2013-11-091-122/+0
| | | | | | | These are also not (yet) implemented in the V4 debugging engine. Change-Id: If47b97535e69117193b87d278131f19bd4120c57 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Simplify & speed up function callingLars Knoll2013-11-091-2/+2
| | | | | | | | | Get rid of the SimpleCallContext, instead simply use the CallContext data structure, but don't initialize the unused variables. Change-Id: I11b311986da180c62c815b516a2c55844156d0ab Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Ensure the this object is set correctly to the scope object in binding ↵Simon Hausmann2013-11-052-0/+20
| | | | | | | | | expressions This is a regression from 5.1 Change-Id: I61ad372a02d937c195dad74bd9fcb8fd4410d97a Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix rounding behavior of Qml when assigning doubles to integer propertiesSimon Hausmann2013-11-051-4/+4
| | | | | | | | | | | | The engine used to round, but that is inconsistent with ECMAScript's way of converting doubles to integers by truncation. With this patch we can also enable the propagation of integer type information into the IR, but we have to be careful not to utilize it when writing properties. Change-Id: I04af4879ba5131349eca2eeff2b27f4598f5267b Reviewed-by: Lars Knoll <lars.knoll@digia.com>