aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix infinite loop in method overload resolutionSimon Hausmann2014-03-241-0/+20
| | | | | | | | | | When resolving overloaded slots in a situation without property cache, then we need to detect that we've reached the end of the overload lists and exit from RelatedMethod with zero. Task-number: QTBUG-37157 Change-Id: Ifaab8cc1b377725c99c1bb89bb9bb74d5a0af1b8 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* tests: fix tst_qqmllanguage::importIncorrectCase() and errors(incorrectCase)Liang Qi2014-03-241-13/+19
| | | | | | | | | It gives different error message based on the case sensitivity of the file system on Mac. Task-number: QTBUG-37622 Change-Id: I567eb4a0b9a413f6eb51683b568f6a6284e6458d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Don't crash on Runtime::getQmlImportedScriptsAlbert Astals Cid2014-03-243-0/+56
| | | | | | | Task-number: QTBUG-37303 Change-Id: I083ca0cc3223fe0dbf1c768ad43a0d4927579867 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Implement high-dpi "@2x" image handling.Morten Johan Sørvig2014-03-2012-0/+441
| | | | | | | | | | | | | | | | | | | | | | | | Make QQuickBaseImage::load() load "@2x" image files on high-dpi displays. Reload images on screen change in order to load the correct version depending on screen dpi. Modify QQuickImageBase::updatePaintNode() to work with @2x images. QQuickBaseImage::load() now looks at the target window's devicePixelRatio and checks for the presence of a "@2x" file on disk. If found the @2x version will be used. Unlike QPixmap, QQuickPixmap has no special knowledge of "@2x" files. They pixmap system will be asked to load "@2x" files and will cache them and report the (device) pixel size, like any other pixmap. Add auto-test and manual test. Task-number: QTBUG-32862, QTBUG-33069 Change-Id: I1f57a10075e499f6eee61df5421e1986521c6ab0 Reviewed-by: Andy Nichols <andy.nichols@digia.com>
* Behavior fix when creating QML windowsFabian Bumberger2014-03-194-3/+97
| | | | | | | | | | | | | | | | | | | | When a QML window is created it is set visible after the QQuickWindowQmlImpl component is complete. This works fine for a single window, but because componentCompleted is called first for the last created windows, the behavior is not as the user might expect (and different compared to version 2.0 of the QML Window API). One of the results is e.g. that a window which is created as a child object in QML will have a lower z-Order than the parent. On some platforms (e.g. BlackBerry) an even bigger problem arises because the first created window acts as a container for the whole application and is always shown fullscreen. On other platforms (Linux) the initial window position and the window focus ares not set correctly. This patch postpones showing windows until the "transientParent" is visible. [Changelog][QtQuick] Making a QtQuick Window visible is postponed till its transient parent is visible Task-number: QTBUG-37440 Change-Id: I09a94ff038c066a5d3298c6c103dafde50bef1fa Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Invalidate all batches potentially affected by a change.Gunnar Sletta2014-03-192-0/+104
| | | | | | | | | | | | When two separate changes have occurred, we need to not only invalidate the batches directly overlapping those, but also any batch which has render orders between the two. So, keep track of the range of invalidated render orders and invalidate everything in between. Task-number: QTBUG-37422 Change-Id: Ie5a289d5c569b84917ec9ac52671173c566e69b3 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Clear the chain of incubated objects in QQmlIncubatorPrivate::clearAlbert Astals Cid2014-03-194-23/+87
| | | | | Change-Id: I432310c0e6006d567fd59b4b1021a9e1538ef78f Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Fixes to for...in statementLars Knoll2014-03-191-2/+31
| | | | | | | | | | | Properly convert the argument to an object if it's not null or undefined as mandated by the standard. Add a similar test case for the with statement. Change-Id: Idd8e245e8dae4803eb0e2010e3d43bb912670444 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Dynamic GL in QuickLaszlo Agocs2014-03-181-2/+3
| | | | | | | | | | The counterpart to I716fdebb. Implements the dynamic path in scenegraph. Task-number: QTBUG-36483 Change-Id: I2dc613ba84560b7b8e36d3cd1da61c050ab08db0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Register animation profiler callback also from render threadUlf Hermann2014-03-181-1/+3
| | | | | | | | | | | The QUnifiedTimer in the GUI thread doesn't cover the render thread animations. We need a separate registration for those. We also need to keep track of which animation events are coming from which threads. Task-number: QTCREATORBUG-11659 Change-Id: I1fdd80a5630cc6a33e527b99be7347f3bd63510f Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* FolderListModel: pessimize change signals when the filter changesShawn Rutledge2014-03-183-11/+38
| | | | | | | | | | | FileInfoThread doesn't have separate signals for insertions, deletions and updates, so QQuickFolderListModel shouldn't make an assumption that if the list got bigger, an insertion was the only thing that happened. Task-number: QTBUG-36576 Change-Id: Ibb02d64e1645dd6df231d28a93e424aaad0effff Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Item views: improve initial Z-value handlingJ-P Nurmi2014-03-189-45/+299
| | | | | | | | | | Respect the initial Z-values of item, highlight, header, footer and section delegate instances. Mention also the default values in docs. Change-Id: I2ce4bb537898a0f5fdfa776b79d5747b1c080a7b Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com> Reviewed-by: Martin Jones <martin.jones@jollamobile.com>
* Use QUrl::toLocalFile() when decoding a string URLAndrew Knight2014-03-182-0/+7
| | | | | | | | | | | | | | | Some percent-decoded characters may still be present in the string URL, so it is best to use QUrl::toLocalFile() to process the string properly. This also makes some drive handling "magic" obselete as QUrl already handles this. This fixes an issue whereby QML apps residing in local paths requiring percent-encoded characters (or which import local file URLs with percent-encoded characters) would fail to load, as the path was passed to the file system engine without fully decoding the URL. Change-Id: I8ec2b06f0661e0ac7cc9df79d35ec5cee211f672 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Namespace cleanupSimon Hausmann2014-03-171-1/+1
| | | | | | | Move the QML IR types into the QmlIR namespace and clean them up. Change-Id: I2125449e5a519034e23670651efa620f405730b4 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Stabilize tst_qquickwindow and tst_scenegraph.Gunnar Sletta2014-03-172-3/+39
| | | | | Change-Id: I6f1b6c0ed86869149658e3ce07545217ce9797a7 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix crash with lazy binding initialization and compile time calculated ↵Simon Hausmann2014-03-173-0/+31
| | | | | | | | | | | | | dependencies During lazy binding initialization we may execute bindings where we calculated dependencies to the context object at compile time. In order to register those dependencies, the contet object needs to be set in the QQmlContextData. This patch makes sure to set it before setting up the bindings. Change-Id: Iacd360140cd9c389487bda82f6a7e6cc3a44c154 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Canvas: do not emit paint when resized but hiddenJ-P Nurmi2014-03-162-13/+20
| | | | | | | | | | | | | | | It turns out to be a bad idea (as in, breaks the enterprise controls) to block paint() altogether when hidden. The original bug report QTBUG-31830 only complained about paint() being emitted upon resize while _hidden_, so this change solves exactly that. User is still free to call requestPaint() even when hidden, and Canvas now doesn't recklessly ignore the request. Task-number: QTBUG-31830 Change-Id: Icd82188f65406b3ef6ae3b19b5984944576886ff Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Fix crash when calling concat on an empty arraySimon Hausmann2014-03-151-0/+1
| | | | | | | | | Make sure to create the array data. The earlier called copyArrayData() doesn't have to do that. Task-number: QTBUG-37506 Change-Id: I6671769fcd471234c4c2eaa1614aa61266db0e5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix crash on shutdown with statesSimon Hausmann2014-03-155-0/+56
| | | | | | | | | | | | When populating deferred properties, we must not set the rootObjectInCreation flags on the root context and (consequently) on any sub-objects objects created when initializing deferred properties. Doing so otherwise will end up us incorrectly linking QQmlContextData together, causing QQmlData::linkedContext to point to iself and crash on exit upon deletion. Task-number: QTBUG-37484 Change-Id: Ia5dc92a04e0f66499f15fbac10f14859d387b021 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* WinRT: Disable qml debugger autotestOliver Wolff2014-03-141-1/+1
| | | | | | | | As the test heavily depends on QProcess and QProcess is not implemented for WinRT, this auto test should be disabled. Change-Id: I765db54072ffaefe028b34d37090cfc2ad8dbd48 Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* Fix crash when appending arrays to sub models in list modelsSimon Hausmann2014-03-141-0/+2
| | | | | | | | | | | | | | The elements are still inaccessible, but at least it doesn't crash. This is consistent with the behavior in Qt 5.0, where it didn't crash because the v8 object handle returned an empty array for the property names because the individual array element wasn't an object. Bug QTBUG-12117 tracks support for arrays in list models. Task-number: QTBUG-35891 Change-Id: Ief446341344977a1473bca474ca5ba934e950468 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Don't crash if a ScriptAction changes state mid-transition.Michael Brasser2014-03-132-0/+87
| | | | | Change-Id: Ia85cb128c7410e2276bf4da02f946d3d0bf44989 Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Ensure TextEdit's text is vertically aligned after resizing its height.Mitch Curtis2014-03-131-0/+13
| | | | | | | | | | | | | The current code only updates the alignment if the width of the TextEdit changed, but we must also check if the height has changed. Task-number: QTBUG-36069 [ChangeLog][QtQuick][TextEdit] Fixed TextEdit not vertically aligning its text after having its height changed. Change-Id: I0b2d6a7384457ca1018fc9899c82699e8ecfcbd4 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Fix property caches out of sync with grouped properties that have a VME meta ↵Simon Hausmann2014-03-132-0/+31
| | | | | | | | | | | | | | | | | | | | | | object Because QQmlObjectCreator::populateInstance would take the property cache to install from the outside and also pass it as the cache to use for the VME meta object to install, it could happen that the wrong cache was installed - the one supplied by engine->cache(propType) instead of the cache created together with the VME meta-object at type compilation time. This patch ensures that they're always in sync and correct by removing the responsibility of the caller to supply the cache to use and install. Instead the function will always use the cache calculated at type compile time (and also use that when installing the VME meta object). Installation of the property cache on the declarative data of the instance is now done only at createInstance() time, which fortunately also simplifies the code. Change-Id: Ia722cd57bc48007aaf725f1f59daa2f21569e324 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Item views: avoid fixing up the position while moving/flickingJ-P Nurmi2014-03-132-0/+43
| | | | | | Task-number: QTBUG-35920 Change-Id: Id6a68400eed69d880dd1c218ec4a1beda8a8fbb9 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Don't crash when a signal/slot connection outlives the engineSimon Hausmann2014-03-121-0/+22
| | | | | | | | | | In the test case in the bug, the signal was emitted from the QApplication destructor (somewhere from the qpa plugin when the platform windows were destroyed) Task-number: QTBUG-37351 Change-Id: Ieec59e12be10bab1428743b80eecdf22ef9d8bf6 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove redundant QQmlBinding members.Michael Brasser2014-03-112-1/+2
| | | | | | | | | This reduces the size of QQmlBinding by 12 bytes. Task-number: QTBUG-37134 Change-Id: Id55257edec8cee88d863374e8a96d7eebbeaf523 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Michael Brasser <michael.brasser@live.com>
* Add support for resolving translation bindings at compile timeSimon Hausmann2014-03-113-9/+70
| | | | | | | | | | Simple calls to qsTr and qsTrId are detected at type compile time and reduced to a special Translation and TranslationById binding type, which avoids allocating a QML binding at type instantiation type just to perform a translation. Change-Id: I61e4f2db2a8092b5e6870e174b832d9c20cd62b5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix incorrectly initialized property cache on group objectsSimon Hausmann2014-03-114-0/+37
| | | | | | | | | | | | When initializing bindings on group objects, we would accidentally set the property cache for the property type instead of preserving a possibly earlier initialized cache on the ddata of the QObject. Task-number: QTBUG-37390 Change-Id: I4d6a4ce6b3382f378f9a9ddfe11924860a15979d Reviewed-by: Sérgio Martins <sergio.martins@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Cleanup our runtime methodsLars Knoll2014-03-111-1/+1
| | | | | | | | | Move all our runtime methods into the QV4::Runtime struct and give them nicer names without underscores. Sort them logically and remove a few unused methods. Change-Id: Ib69b71764ff194d0ba211aac581f9a99734d8180 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* MultiPointTouchArea: make nested.qml autotest easier to debugShawn Rutledge2014-03-101-5/+54
| | | | | | | Visual feedback Change-Id: I8f670d5f4729149e5ee02c2e9a36b5570ac3c5a7 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Fix TextEdit::lineCount to update as appropriateJ-P Nurmi2014-03-101-0/+51
| | | | | | | | | | The total line count needs to be updated when geometry, document size or wrapping mode changes. Task-number: QTBUG-37263 Change-Id: If58a2f77022475e8bcb7cca0f2a091ee837b39a5 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* MultiPointTouchArea: handles mouse too, unless mouseEnabled is falseShawn Rutledge2014-03-104-0/+438
| | | | | | | | | | | | | | | | | | | A new boolean property mouseEnabled is introduced (true by default). If set to true, then it will handle any non-synthetic mouse event as if it were a touch point. If set to false, the area becomes transparent for real mouse events so that a MultiPointTouchArea can be stacked on top of a MouseArea in order to separate handling of touch and mouse. In either case it continues to absorb and ignore synthesized mouse events (including touch-to-mouse synthesis in QQuickWindow). [ChangeLog][QtQuick][MultiPointTouchArea]handles mouse as a touchpoint; added mouseEnabled property to permit transparent pass-through to mouse-sensitive items Change-Id: I4af94d838f0060154494589c0f15c6858ee89ddb Task-number: QTBUG-31047 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Fixed qqmlapplicationengine autotest build for QT_NO_PROCESSOliver Wolff2014-03-101-0/+4
| | | | | Change-Id: Ie5993fac36a29a7d7edcadf5030dc2b5bf95b506 Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* Remove old compiler and VMESimon Hausmann2014-03-074-774/+0
| | | | | | | | | | | | This removes the bulk of the code. A few smaller cleanups remain, to be done in smaller changes as they move code around. Additionally the "optimize" option of qqmlbundle was removed. It called QQmlScript::Parser::preparseData, which however was not implemented and always returned an empty QByteArray. Therefore "optimize" would not do anything and the class is gone now :) Change-Id: I0c265e756704cb53c5250be1f69e4a3e1b6e64d5 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add the features of QLoggingCategory to QML's debugging methods.Giorgos Tsiapaliokas2014-03-073-4/+7
| | | | | | | | | | It is now possible to modify the output of QML's debugging methods. Also the prefix of "qml" makes it possible to capture the output from the QML files using qInstallMessageHandler. This commit depends on qtbase/4967c7106568d5df0be4d40bf793583c7c6bdb69 Change-Id: I2c7a2cb96a0b91fd3249dc2dacbab63e6ac68243 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Switch the code path from the old compiler and VME to the new code pathSimon Hausmann2014-03-061-1/+0
| | | | | Change-Id: Ib1b38ec07830f8df9fa4caacd00879434608053b Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Stabilize tst_QQuickPathView:dataModel()J-P Nurmi2014-03-062-5/+4
| | | | | | | | | | | | | | | - QQuickPathView::setCurrentIndex() result must be immediate => no need for random QTest::qWait(100) there. - Remove another random QTest::qWait(100) after inserting a model item. Instead, wait for the desired result ie. delegate creation with QTRY_VERIFY(). - Furthermore, disable the default highlight move duration to avoid the auto test and QQuickPathView's internal timeline fighting over the current index. Task-number: QTBUG-35705 Change-Id: Ie53fdcc8f7955a03027da38b075e6042a3aea7f2 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Make tst_qqmlincubator::chainedAsynchronousIfNested more robustSimon Hausmann2014-03-051-5/+3
| | | | | | | | | | Don't rely on the exact number of instructions executed in the VME to determine the loading state of the incubator. With the simpler object creator that's not based on instructions we might end up creating objects in less steps, so make the test work with both. Change-Id: If8a3628cac97251036c9b2cd8f26e75eca1d39ed Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix auto component creation with composite typesSimon Hausmann2014-03-053-8/+29
| | | | | | | | | | | | | A binding like this property Component foo: SomeComposite {} should not do an implicit component insertion if SomeComposite is actually a component. The property assignment is compatible and can proceed normally. Fixes tst_qquickcanvasitem, but added a separate unit test for this case. Change-Id: I7221eebd38dba3f2a82b59341739b9b67211e352 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix qquickfolderlistmodel test compilation on WinRTAndrew Knight2014-03-051-3/+3
| | | | | | | | Like WinCE, the changeDrive() test should be disabled on WinRT. Change-Id: I85749b84fef372e166fe52c263225478094ccdb4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Fix crash when accessing var properties in objects with invalid contextSimon Hausmann2014-03-042-0/+42
| | | | | | | | | | | | | | | | | | We've had two indepedent reports of people running into the issue of their QML code accidentally trying to access var properties in item view delegates that were on the path of destruction, i.e. their QQmlContext was already marked as invalid. Any such access would cause a failing assertion in debug builds or a crash in release builds. This patch removes the dependency to QQmlContextData for accessing the var properties and adds a test-case that covers this use-case. This is a regression from Qt 5.1.x. Task-number: QTBUG-37227 Change-Id: Icf55d5fa8c15e45974e78086e9e11b2401ea9bad Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Prefer to use normalised signal/slot signaturesSergio Ahumada2014-03-0310-15/+15
| | | | | | Change-Id: I9856c110399c4b6b1ea6aba2d92392cecff04656 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix a crash in the register allocatorLars Knoll2014-03-031-0/+14
| | | | | | | | The base for an indexed access can be a constant. Change-Id: Icc529c02fb0ff2ac30d6f40088781b6ecfba81fc Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Make it possible to call QQmlEngine::setObjectOwnership at any timeSimon Hausmann2014-03-021-0/+13
| | | | | | | | | | | | | QJSEngine::newQObject should call setObjectOwnership only if it wasn't called before, to preserve any policy set by the user earlier. Otherwise it's only safe to call after newQObject and then you'd have to call it _every_ time the QObject is wrapped, at all call sites. Instead this patch preserves any policy set. Task-number: QTBUG-37160 Change-Id: I6178fa38cd7f4b09d818b6f18762c21588562422 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix calls to overloaded slots for QObjects not created by QMLSimon Hausmann2014-03-021-0/+68
| | | | | | | | | | | If we don't have a property cache, we need to fall back to a slower method of determining the overload methods. We have the code for that in RelatedMethod, once we determine that we're calling overloads, but we never hit that code path because we did not _initially_ determine that the method was an overload. Task-number: QTBUG-37157 Change-Id: I8ff39156e5668236b3797400b4086ed545624398 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Add the correct object index to the custom parserSimon Hausmann2014-03-022-5/+7
| | | | | | | | Without the correct index the calls to astForBinding run out of bounds. Fixes tst_qqmllistmodel crash. Change-Id: I6fb8b77866cbf247e7373cdbece6833c92be3615 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Add a column to the default method error messageSimon Hausmann2014-03-022-2/+2
| | | | | | | | This brings both compilers in sync by reporting line and column if doing a signal object assignment without a default method. Change-Id: I8b1bf90c4ce3cd7b117ad7eecdbfe319b07b1191 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix implicit component determination inside group propertiesSimon Hausmann2014-03-023-0/+23
| | | | | | | | | Don't only scan full-typed objects for property bindings that may define components implicitly, do this for any types we know (propertyCache populated) and that aren't explicitly of Component type. Change-Id: I918b636be6d524e919cdd4efd49c33e63da64de3 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* [new compiler] Fix evaluateEnum for custom parsersSimon Hausmann2014-03-024-0/+100
| | | | | | | | | When storing the string for a script binding - next to to the AST node - then for expression statements skip the (potentially synthetically inserted) semicolon. Its omission is required for the use of QQmlCustomParser::evaluateEnum. Change-Id: I3b556fd6a884f5c9c290d7d793eeab4dd135343e Reviewed-by: Lars Knoll <lars.knoll@digia.com>