aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix failing assertion in debug builds for JS that calls constantsSimon Hausmann2015-01-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | For true() we generate IR that looks like this: temp = true result = call temp() and therefore the move at isel time has IR::Call as source and a temp as base for the call. However constant propagation in the optimizer transforms this to result = call true() and that's a case we didn't handle in the IR visitor. Since we have Runtime::callValue we can however handle this case as well and the run-time will consequently produce the expected run-time error. Change-Id: Ia94a8116388e66f9f339913307f68e33a5c18a19 Task-number: QTBUG-43819 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net> Reviewed-by: Jan Kundrát <jkt@kde.org> Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
* TextEdit: fix construction time text cacheJ-P Nurmi2015-01-081-0/+12
| | | | | | | | | | | QQuickTextEdit does not apply cached text to the underlying document until component construction is complete. However, if text() was called during the construction (eg. because of a binding), it would blindly overwrite the cached text with (still) empty document content. Task-number: QTBUG-41583 Change-Id: I6c5c1b6283d70d8a5ec2c8bd986095ee3c35a14c Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
* Parse dates as Qt::RFC2822Date tooAlbert Astals Cid2015-01-082-1/+8
| | | | | | | | [ChangeLog][QtQml] Fix JavaScript Date parsing to correctly accept RC2822 dates. Task-number: QTBUG-38011 Change-Id: Ic7d3f5b8c624d6780d4c3595fd2efe22c427ffd3 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* V4: fix reverse type propagationErik Verbruggen2014-12-181-2/+2
| | | | | | | | | Only do integer add/sub/mul when all operands are known to be integers. [ChangeLog][QtQml] Fixed invalidly opportunistic truncating of non-integer values for additions/subtractions/multiplications in JavaScript and binding expressions. Change-Id: I21b3bede2fb3e8033305591110b98cc9e6bf52f8 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* V4: only optimize out to-int32 conversions when the operands are int32.Erik Verbruggen2014-12-181-0/+12
| | | | | | | | | The operands of bit-ops are not typed as int32 when no type-inference is done, like for the interpreter. Task-number: QTBUG-43309 Change-Id: I67af18e14ddbc0649530ac23601332ee7d7a1f34 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Change Qt bugtracker URL to qt.ioAlex Blasche2014-12-162-2/+2
| | | | | | Change-Id: I3dde034b2a36c324df9f4e1fd2e05a07a7237c04 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
* QML Debugging: Fix breakpoints/stepping in a with-statement.Erik Verbruggen2014-12-101-0/+18
| | | | | | | | Also fix the stack-trace generation, otherwise the debugger engine would report a breakpoint hit on the wrong line. Change-Id: I6eb4b508fbdca64d03badd8f9312a05c78781ded Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* QML Debugging: Fix crash when stepping through try-catch block.Erik Verbruggen2014-12-091-0/+20
| | | | | | | | | Also fix the stack-trace generation, otherwise the debugger engine would report a breakpoint hit on the wrong line. Task-number: QTBUG-42723 Change-Id: I1f655a5174b28a1c9c31c85bbe023fbce5ddbb96 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* QML: fix warning in testsErik Verbruggen2014-12-091-1/+7
| | | | | | | | Mark unused fields as Q_UNUSED. They are still "used" to check if the compiler will generate warnings/errors (which it shouldn't). Change-Id: I38e1668e88d94ab8f26a92a06f5207b77369e136 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* QML: fix warning in testsErik Verbruggen2014-12-091-23/+0
| | | | | | | Remove unused function that wouldn't be emitted anyway. Change-Id: I623d5d44bca9a1358cf9e66ff557992aba9ae451 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* QML: fix warning in testsErik Verbruggen2014-12-091-1/+0
| | | | | | | Remove unused constant. Change-Id: I3fb3512f7ea54102450eeeda1a56c73fe6b26025 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Merge "Merge remote-tracking branch 'origin/5.4.0' into 5.4" into ↵Simon Hausmann2014-12-0972-71/+76
|\ | | | | | | refs/staging/5.4
| * Merge remote-tracking branch 'origin/5.4.0' into 5.4Simon Hausmann2014-12-0572-71/+76
| |\ | | | | | | | | | Change-Id: I5978bab8a4fde4c2ee33907fd81f49cb69e4fb26
| | * qttest: make findChild available only for QtTest 1.1Fawzi Mohamed2014-12-0571-71/+71
| | | | | | | | | | | | | | | Change-Id: I4ceb1a969bd4296b82f899088b02b5e8cf100bcd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
| | * Add string::arg method in installTranslatorFunctionsKai Koehne2014-12-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QJSEngine::installTranslatorFunctions install the translator functions to any given JS object. However, the custom string::arg() method is only added in qqmlbuiltinfunctions.cpp, making the use of qsTr() in other pure-JS programs quite hard. Task-number: QTBUG-43113 Change-Id: Ia9ed97a4c07a4d167c792f3ea13e4f6e96c97423 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | | QML: fix warning in testsErik Verbruggen2014-12-091-2/+0
| | | | | | | | | | | | | | | | | | | | | Remove unused class field. Change-Id: I90981546e33d4839a91c418a8746e6f2ebc3bf46 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | | Quick: fix testErik Verbruggen2014-12-091-1/+1
|/ / | | | | | | | | | | | | | | | | /Users/erik/dev/qt5-stable/qtdeclarative/tests/auto/quick/qquickgridview/tst_qquickgridview.cpp:1561:60: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int] items << qMakePair(QString("new item " + j), QString::number(j)); ~~~~~~~~~~~~^~~ Change-Id: I94bd952abf82a8f174772482330b5fdd636578ad Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* | Fix QtQuick2 module unload supportChris Adams2014-12-044-0/+208
| | | | | | | | | | | | | | | | | | | | | | | | | | This commit ensures that the value type providers installed by the QtQuick2 QML module during initialization are uninstalled when the plugin is unloaded. It also fixes a bug in the type compiler so that it now works with types from plugins which get unloaded and then reloaded. Task-number: QTBUG-43004 Change-Id: I4b3fb75aae65dfbc5de9c88701ed82514087ab7d Reviewed-by: Matthew Vogt <matthew.vogt@qinetic.com.au>
* | Fix conditional breakpoints in QMLSimon Hausmann2014-12-031-0/+39
| | | | | | | | | | | | | | | | | | | | We need to set "inheritContext" to true for the QV4::Script that's used during conditional break point evaluation, because that will also disable fast property lookups, which is still required for QML lookups to work. Change-Id: I8976df1c827b5058eae9bdce6e86e5ea856cbfe1 Task-number: QTBUG-43018 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Fix expression evaluation in specific frames in the debuggerSimon Hausmann2014-12-031-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | Expressions from the QML/JS console are intended to be executed in a specific frame / context. However that wasn't implemented properly, we should pop the current context frameNr times. [ChangeLog][QtQml] Fix inspecting objects in QML/JS console in different frames. Change-Id: If575d4005c52a9fe6805538a7b1a02b9e32049d6 Task-number: QTBUG-42831 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Merge remote-tracking branch 'origin/5.4.0' into 5.4Simon Hausmann2014-12-021-0/+5
|\| | | | | | | Change-Id: I89bbb2977350a03c156d531f810d08a5560ffbb3
| * Skip tst_qquickwindow::headless() when using ANGLE/Windows.Friedemann Kleint2014-12-021-0/+5
| | | | | | | | | | | | | | | | | | The test crashes frequently. Task-number: QTBUG-42967 Change-Id: Ic17c6187bfa657154a9b04eb9c5b9a3de291cb1e Reviewed-by: Andrew Knight <andrew.knight@theqtcompany.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Stabilize tst_qquickflickable.Friedemann Kleint2014-11-281-4/+20
|/ | | | | | | | | - Use one engine per test - Use QQuickView for the margins test - Verify QWindow cleanup. Change-Id: Id2a10b56101832c362822963a2a7bd1d66daa143 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* QQuickWindow autotest: verify that onClosing can block close()Shawn Rutledge2014-11-071-0/+20
| | | | | | Task-number: QTBUG-40093 Change-Id: I800259f45d95736172d500494e68042180178e93 Reviewed-by: Caroline Chao <caroline.chao@theqtcompany.com>
* Inspector: Do not assert when trying to stream QModelIndexKai Koehne2014-11-071-1/+39
| | | | | | | | | | | | | | | | | | | | Some QVariant's like QModelIndex cannot be streamed in a meaningful way: QDataType::save() will return false for them. However, this leads to a qWarning and Q_ASSERT in QVariant::operator<<(). To prevent this we're calling QDataType::save() manually beforehand. We however throw away the result if it succeeds, and still call QVariant::operator<<() to get the benefits of the QDataStream version handling. The alternatives would be to make QVariant::operator<<() not assert, or blacklist all known types with problems manually. Both seem to be difficult though ... Change-Id: I4f5fe6d5a3a076c24fbc73371a4d12d720de53da Task-number: QTBUG-42438 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Stabilize tst_QQuickAccessibleJan Arve Sæther2014-11-061-4/+0
| | | | | | | | There is no reason to wait for the window to activate Task-number: QTBUG-42355 Change-Id: I5faaff5bddd367e6dd57a6a922011c87c847148e Reviewed-by: Tony Sarajärvi <tony.sarajarvi@digia.com>
* Add attached Window::contentItem propertyJ-P Nurmi2014-11-052-0/+4
| | | | | | | | | This is essential to the Qt Quick Controls for implementing floating text selection handle popups. Change-Id: Ibae65110a5db6d65dacd197fef3ad567d11342dc Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* text input: always let cursor rect have a width == 1Richard Moe Gustavsen2014-10-301-0/+21
| | | | | | | | | | | | | | | | Instead of using a cursor width of null when a cursor delegate is set, we should to use a value of 1. Otherwise the rect we e.g return from cursorRect() will be invalid. An alternative would be to use the width of the delegate, but that was found to be controversial. On iOS we saw a bug with this when telling iOS to position text spelling popups underneath the cursor. Since the cursor rect we got was invalid (zero-width), no popup would show. Change-Id: Ice51b9a1bd33f331183e3acec61b7d9c0f5163cd Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* Repeater & itemviews: fix setModel() JS array handlingJ-P Nurmi2014-10-294-0/+114
| | | | | | | | | | | | QVariant comparison in setModel() started failing because JS arrays are now passed as a QJSValue. Re-assigning the same array content should not trigger a model change. This change restores the old behavior it had before, when JS arrays were passed as QVariantLists. Change-Id: I1882b3531f2893b116dbd817edeecab1ae812ce8 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Remove mouse grabber if touch used for mouse emulation has been grabbedDaniel d'Andrada2014-10-292-10/+97
| | | | | | | | | | | | | | | | | | | | If an item grabs a touch that is currently being used for mouse pointer emulation, the current mouse grabber should lose the mouse as mouse events will no longer be generated from that touch point. Example of what happens without this patch: -User touches a MouseArea. It gets pressed. -Some other item grabs that touch. -This touch eventually ends. -The MouseArea would still be pressed. And what will happens instead after this patch: -User touches a MouseArea. It gets pressed. -Some other item grabs that touch. -The MouseArea gets canceled and released -This touch eventually ends. Change-Id: I24114f18be564553a4a768243bb20379affe7a8f Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Move action handlers to the Accessible attached objectJan Arve Saether2014-10-271-3/+2
| | | | | | | | | | | | | | | | | | | | With this change, instead of writing: function accessiblePressAction() { submit() } You should write: Accessible.onPressAction: { submit() } For the moment, only 4 actions are added: press, toggle, increase and decrease. The old style action handlers are deprecated, and removed from the documentation. New style action handlers will be preferred in case an item declares both styles. Change-Id: I11919e631d8476d55540f94252757b911c44ade4 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Properly handle negative years when printing JS Dates to strings.Ulf Hermann2014-10-242-0/+25
| | | | | | | | | | JavaScript knows a year 0. That is correctly translated into QDateTime terms when creating a Date object, but it's not correctly translated back when converting the JavaScript date to a string. Task-number: QTBUG-29491 Change-Id: I46b200a144434187656d08e87f422f97523acd0e Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix syntax error when trying to declare read-only object propertiesSimon Hausmann2014-10-243-0/+29
| | | | | | | | | | | | | | | | | | | | The grammar did not allow for the declaration of readonly property QtObject foo: QtObject { ... } and it required a workaround through an alias: readonly property alias foo: _foo property QtObject _foo: QtObject { ... } This was merely a glitch in the grammar, I see no reason not to support this. The semantics are like a const pointer in C++, the property itself is read-only but the object pointed to has per-property defined read/write semantics. Task-number: QTBUG-41971 Change-Id: I99e2e7ed58731e387a38e46ec39922d280a21ceb Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix crash in SpriteSequenceAlex Blasche2014-10-243-0/+146
| | | | | | | | | | When QML declares sprites and goalSprite in wrong order the goalsprite attempts to set it on null spriteEngine. This patch ensures that the order doesn't matter anymore. Task-number: QTBUG-40595 Change-Id: I57f1c8754b2e2af91e0c7f72d1d67fec3ad4ede5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Relayout rich text when width increasesEskil Abrahamsen Blomfeldt2014-10-231-0/+29
| | | | | | | | | | | | | | | | | | | In updateSize() we were trying to force relayouts for RichText when the width changes by always setting widthExceeded to true. But further down in the same function, we overwrote this with textWidth() < idealWidth(), which doesn't work, because both properties are the wrapped width of the document and should only differ if the text cannot be wrapped properly. The result was that when increasing the width of a Text element, we would hit the optimization and skip the relayout. [ChangeLog][Text] Fixed Text with the RichText format to correctly update wrapping when the width of the element grows. Change-Id: I5fd87052a5ba7e8ee2549be0cfac4adc8ddf8290 Task-number: QTBUG-33020 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix assignment to QObject pointer propertiesSimon Hausmann2014-10-231-0/+28
| | | | | | | | | | | This commit ammends 59ed8c355b99df0b949003a438ab850274261aa0 to always query the Qt meta-type registry to retrieve the QMetaObject for a QObject pointer type. Change-Id: I70d876a5acfa23967fd1a57c96fcd5ac853eaf49 Task-number: QTBUG-39614 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: Ulf Hermann <ulf.hermann@digia.com>
* Screen attached property: expose devicePixelRatio propertyShawn Rutledge2014-10-232-0/+3
| | | | | | | Change-Id: I08b22766b3e389b7d27ca4c56729f550b0647a08 Reviewed-by: Jens Bache-Wiig <jensbw@gmail.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Fix line ending for test fileKai Koehne2014-10-221-10/+10
| | | | | | Task-number: QTBUG-40574 Change-Id: If1fcc4cb00c8e477b3afff92eb4a3099424fcfa6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Support Accessible.ignored on non-leaf itemsJan Arve Saether2014-10-214-4/+166
| | | | | | | | | | Ignoring items with children will make the children appear as children of the parent of the ignored item. Since setAccessibleFlagAndListener now only sets the flag we also rename the function to just setAccessible Change-Id: I79fc311509a3e454b4698274c63ad0e879fb93e3 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Check list property before component when validating bindingsUlf Hermann2014-10-213-0/+14
| | | | | | | | | There are lists that won't accept a component as element. For example QQuickItem's children will only accept QQuickItems. Task-number: QTBUG-41848 Change-Id: I0fc7b0d1a4770d596caf681be92dff216f48d32b Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* qmlstatemachine: Rename StateBase to StateKevin Funk2014-10-218-34/+34
| | | | | | | | | | | | As discussed with Brett Stottlmyer and Alan Alpert. Add a section about the implications when importing both QtQml.StateMachine and QtQuick in one single QML file. Change-Id: I8755f4b578e2a6ff4c2377c7a8a0b996ba9b7129 Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Make test more robust against ignored children.Jan Arve Saether2014-10-204-33/+84
| | | | | | | | With the upcoming change that changes the semantics of Accessible.ignored, some assumptions in the test does not hold anymore. Change-Id: I9b34f1ecc61fc0d4e8abe5a5505a5bcff44501d4 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Fix tst_qquickpositioners on OS XFrederik Gladhorn2014-10-201-0/+3
| | | | | | Done-with: Jan Arve Sæther Change-Id: Iff66f62167a5977354319aac311d2cb81d9f3842 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* Stabilize and fix comparisons in animator tests.Gunnar Sletta2014-10-1011-64/+60
| | | | | | | | | | | | | compare() will compare properties of objects and neither Qt.rgba nor image.pixel created objects has enumeratable properties so compare is pretty much useless. Use verify + == which will rely on toString() which is ok. A few of the tests relied on execution order of signals emitted on animation.running being changed and would occasionally fail. Change-Id: I531c7f21b58a922a6be9ca2b6de120a68209a6d6 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* PathView: Fix QML engine thinking currentItem is null when it's notSérgio Martins2014-10-102-0/+42
| | | | | | | | QML didn't re-evaluate any bindings using currentItem because a notification was missing. Change-Id: Icdaa3022e0b01644a060e577d87f011b4ea9fabb Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Fix QQmlExpression/QQmlScriptString/QQmlBinding crashesSimon Hausmann2014-10-092-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | In the QQmlScriptString we store the binding id and it is an index into the runtimeFunctions array of the compilation unit. However we don't store the compilation unit and instead in QQmlBinding and QQmlExpression try to retrieve it from the cache via the context url (we have the context after all). That turns out to be not a reliable way, as sometimes the URL might slightly differ from the originally compiled cache (qrc:/// turning to qrc:/ maybe). Consequently the type is (unnecessarily) compiled again and unfortunately not _linked_, therefore the runtime functions array is empty. Another option is that when the component was created from a QByteArray, then no entry exists in the cache in the first place. This patch addresses the problem by storing a reference to the compilation unit in the QQmlContextData. That we can safely retrieve and it'll make sure the compilation unit also stays alive. In the process of that the manual reference counting was switched over to QQmlRefCount and QQmlRefPointer for QV4::CompilationUnit. Task-number: QTBUG-41193 Change-Id: I9111f9a3b65618e453954abcd789c039e65a94f7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix memory leak and crash with transform animators.Gunnar Sletta2014-10-091-0/+77
| | | | | | | | | | | | | | | | | | Every time initialize() was called, we would increment the ref on an item. However, initialize is called every time the job is started, so the ref would increase and only decrease once, leading to a leaked helper. Change it to only increment the first time. A different problem was that when an item was destroyed, we could run the risk of the QQuickTransformAnimatorJob destructor being called with the helper's item being null. This would lead to the helper not being removed from the cache and a dangling helper would remain in the transforms cache. Now change it so that when a target is destroyed, we explicitly destroy the helper as well (as no animation can happen then anyway) and reset all pointers in the job. Change-Id: I1ce76db134bbc1871d32f1224ba5b68a4a4eeafa Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Compare doesn't work for colors, so compare the channels explcitily.Gunnar Sletta2014-10-091-1/+3
| | | | | Change-Id: I7a21328700c85b5b79dbb4342817e28833dece70 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Relax ShaderEffectSource's sourceItem vs window handling.Gunnar Sletta2014-10-091-0/+82
| | | | | | | | | | | For dynamically loaded items, the window may not be set on either the source or the item, so we need to be a bit more relaxed in our checking. This fixes a regression for dynamically loaded GaussianBlur. Change-Id: I3e888405a95058ca79ecd2dff42c0ed4c8fff065 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Fix missing glyphs in selectionEskil Abrahamsen Blomfeldt2014-10-091-0/+17
| | | | | | | | | | | | | | | | | Change 198009db79a85d3cab7fe3a6432635d36123a2d6 revealed a bug in the new selection algorithm which would occur sometimes when a given run of text spanned several script items. Since we are checking the glyph runs for overlaps in the actual text, we need to report the exact characters spanned by the glyph run. We use the new enabler for this in QGlyphRunPrivate. Added a new test case which is an error case we did not yet cover, which is when there is only a single script item, but several font engines are used to produce it (fallback fonts). Change-Id: Ie4c3e79ad98a033d5c75fd67ada4ae83df33435b Task-number: QTBUG-41808 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>