aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Fix QNX build on WindowsSimon Hausmann2017-09-061-1/+1
| | | | | | | | | | | | | | | | | | | Configure on Windows in Qt 5.6 does not detect the target gcc version correctly and reports the host gcc version instead. That means we'll end up enabling -fno-lifetime-dse with a gcc version that doesn't support it and consequently fail to build. Since in the 5.6 branch we only support QNX 6 and we know that the gcc version is 4.7 and thus not affected by the DSE problem, we might as well unconditionally disable the workaround there. This change is only for 5.6 as 5.8/5.9 and newer detect the gcc version correctly _and_ don't need the -fno-lifetime-dse workaround anymore. Task-number: QTBUG-62820 Change-Id: I55baf532a9126eb2f8c5f11858d52cccad6c355b Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Don't crash: Connections with a signal on a nonexistent objectShawn Rutledge2017-08-312-0/+21
| | | | | | | | Task-number: QTBUG-56551 Change-Id: Ide09f177d3f6a3e9902f8ea904b3e6e4b998bd39 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit 02830aae1f3e9aaf89ca37637d40313babbff7b8) Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix crash in QQuickAnimatedImageAleksei Ilin2017-08-151-0/+43
| | | | | | | | | | | Check d->_movie pointer before dereferencing Task-number: QTBUG-62380 Change-Id: I62314c7c0d4a7e41fa6f8c4629d16f30d6036156 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry-picked from fc3ecd2522deb3f6d8d48b66dbd89402e1ab4b53)
* Fix build of animation benchmarkErik Verbruggen2017-05-121-0/+5
| | | | | | | | | This was using symbols exported only by a developer build. Change-Id: If2e80a7f7831366a23c5c52669915385cfb3e7c6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit 720a88be5ba98a71a085ec5977d87ecb22c20008) Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Another benchmark fixErik Verbruggen2017-05-122-1/+3
| | | | | | | | | | Again JS ownership, now shown as an attempt to free a non-malloced pointer. Change-Id: I00a9b1e4918da96aa5bc99a321edc94d76c4f45b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit 63f0406cfbf58e8c3e3369beb8ae6995a7a21650) Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Disable particle benchmarksErik Verbruggen2017-05-122-2/+4
| | | | | | | | | They are broken. See QTBUG-60621 for details. Task-number: QTBUG-60621 Change-Id: Ibf55c64ef1b367bc2058d1c2284cd378ffa826ec Reviewed-by: Robin Burchell <robin.burchell@crimson.no> (cherry picked from commit 23a3018fc6a1e650b7eb291009c20d46c9e5c9af)
* Fix qml file loading for tst_affectorsErik Verbruggen2017-05-122-5/+9
| | | | | | Change-Id: Ifb1b6f6d71d42c1642167725526c054f1dce0c90 Reviewed-by: Robin Burchell <robin.burchell@crimson.no> (cherry picked from commit 9064d077e411aab9a2aea9f9e5a14ae029a94e14)
* Fix benchmark: remove benchmarks containing old v8 referencesErik Verbruggen2017-05-122-89/+2
| | | | | | | | | | | The removed benchmarks don't make sense anymore: they were testing the QQmlEngine part, while another test was doing the QJSEngine. These days the QQmlEngine is a subclass of the QJSEngine and the test would call the QJSEngine (which, as said, was already done in another benchmark). Change-Id: Id1982dc118c399938a2dca8fb3c0a733e52fb20e Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 9abcbbd3ab68da3cf7ee977c82b860e2ac42bb2c)
* QQmlComponent: Fix heap buffer overflow with bogus inputPeter Hartmann2017-05-091-0/+12
| | | | | | (cherry picked from commit 30dbe57521c9b1f4cac74db8f5f15a3c466c20d0) Change-Id: I20a030ddba6ae42b9959473fe68e622c6a42a8bf Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix a QJSValue benchmarkErik Verbruggen2017-05-092-2/+2
| | | | | | | | | | The benchmark added the tst_QJSValue instance driving the benchmark to the engine, which then takes over ownership. This would result in a use-after-free, leading to a crash. Change-Id: I524445487a1dabb3fb3fbbfb7fca084f7736c124 Reviewed-by: Robin Burchell <robin.burchell@crimson.no> (cherry picked from commit 365d43a22050a4ea69e36b8d1033bf6ab3189264)
* Remove outdated QJSValue benchmarkErik Verbruggen2017-05-095-120/+2
| | | | | | | | | Now that the oterh QJSValue benchmark is fixed (yes, there were two benchmarks with the same name), this benchmark is superfluous. Change-Id: I39a7f9cc79dccef8aac3d4c3999a3d75e1b1aa3d Reviewed-by: Robin Burchell <robin.burchell@crimson.no> (cherry picked from commit 448104e4a09f66b62ff279d65ecc4658833e20f3)
* QML: clear the property cache on QObjectWrapper destuctionErik Verbruggen2017-04-261-0/+15
| | | | | | | | | | | | | If an external QObject is exposed to an engine through a QObjectWrapper, make sure to deref and clear the propertyCache reference in the object's declarative data when the QObjectWrapper is destroyed. This makes sure that there is no dangling propertyCache pointer when the object is subsequently exposed to another engine. Task-number: QTBUG-57633 Change-Id: I37f6793d8be65b23b4e81bb4ed91db18271261b0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit 749a7212e903d8e8c6f256edb1836b9449cc7fe1)
* Enable PropertyChanges to correctly restore binding on aliasMichael Brasser2017-02-032-11/+52
| | | | | | | | Change-Id: I88ffdd1d1224705e980e449b6c799c9f186143b1 Task-number: QTBUG-58271 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> (cherry picked from commit 22b03fd6d3efdfa0385ced2450c6c7dfcf555d6e) Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
* Fix support for QJSValue as C++ signal parameter type, part 2Simon Hausmann2017-01-192-2/+13
| | | | | | | | | | | | | | | | | After commit 0e3380f9c6ab6e3ea7398caccf5aa84f1575f1cd we wouldn't crash anymore, if QJSValue::UndefinedValue was provided as value for a QJSValue C++ signal parameter. However that was not a complete fix for the regression of commit aa869cbb06bcf005e238059a2cb0205947ff0b5f, as other primitive values stored in QJSValue as QVariant were not converted, so for example QJSValue(42). So let's fix this once and for all by using QJSValuePrivate::valueForData, that handles all types of QJSValuePrivate encodings. Task-number: QTBUG-58133 Change-Id: Ib7c0461b18df6260ccd4bce729ae2348281eb7f3 Reviewed-by: Arnaud Vrac <avrac@freebox.fr> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 89c6bee139422b17534f79129eea2820d2ce952e)
* Fix crash when C++ QJSValue parameterized signal interacts with JSSimon Hausmann2017-01-143-0/+4
| | | | | | | | | | | | | When converting the parameters of a C++ signal to JS values to provide to a signal handler written in JS, the conversion of a QJSValue to a QV4::Value* may yield a null pointer in case of a default constructed QJSValue for example. This is a regression from commit aa869cbb06bcf005e238059a2cb0205947ff0b5f and we must check for this. Task-number: QTBUG-58133 Change-Id: I528b606b2851dfb3072e54902bd8843d31571a55 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 0e3380f9c6ab6e3ea7398caccf5aa84f1575f1cd)
* Improved robustness of the optimizer when removing expressionsSimon Hausmann2016-11-221-0/+8
| | | | | | | | | | | For example during dead code elimination we may invalidate statements, but at the same time there may still be instances left in the work list of optimizeSSA(). When we encounter then, we should not process them any further. Task-number: QTBUG-56255 Change-Id: I4c24b1a225ce1bde112172e9606f91c426c19f19 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Fix binding re-evaluation when list model properties changeSimon Hausmann2016-11-182-0/+40
| | | | | | | | | | | | | | | This is a regression from commit 4876ea6a18ccdfd72014582aa5d50ab9f6b6ec9e, which avoided returning an expensive QObject when calling get() but also lost the ability to perform binding captures when accessing the properties. This change restores the captures by performing them by hand in get() and also triggering the notifiers directly when the values change, without creating the QObject. Task-number: QTBUG-52356 Change-Id: Ia429ffafd4032b63d3e592aa63bb0864a24e0965 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QML: Fix memory leak in a benchmarkErik Verbruggen2016-11-161-1/+4
| | | | | | Change-Id: I64b671243a107c518da2000e2ffd964f441af037 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* QML: Change C++ benchmark to reflect QML benchmarkErik Verbruggen2016-11-161-1/+2
| | | | | | | | | | The QQmlListReference will build a property cache entry, but it won't assign it to an engine when none is available (meaning: it would create the entry every time a QQmlListReference is created). QML won't do that, because it (obviously) has an engine available. Change-Id: I46eeaf3dffcb690902dd3d78be48c8509be6e84d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix reading of enum properties from gadgetsSimon Hausmann2016-11-161-0/+34
| | | | | | | | | | | | | | | | | QMetaProperty::type() maps an un-registered enum to QMetaType::Int, and so if a property cache is created for a gadget with enum properties, then their type will be int and we'll correctly read enum properties as ints in JavaScript. However if the enum is registered at the time we create the cache, then the property type will be the specific type and not QMetaType::Int. The property reading code in QV4::QObjectWrapper can deal with that, but the property reading code in the gadget value type wrapper code did not. [ChangeLog][Qt][Qml] Fix reading of enum properties from gadgets / value types when the enum was registered with qRegisterMetaType(). Change-Id: I7812b216a276dcc95c36e313507e1a1142250d0b Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Setting Connection's target to null should disconnect implicit targetMichael Brasser2016-11-152-0/+36
| | | | | | Change-Id: Id7c8c7080e6db8bb6d09c1df13cddaef047cf611 Task-number: QTBUG-56499 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Fix more cases where DSE would optimize out too many storesErik Verbruggen2016-11-101-0/+5
| | | | | | | | | | | | | | GCC5/6 do aggressive dead store elimination on memory passed to placement-new. This resulted in the Heap::Object::prototype being a nullptr. qml.pro already contained the -fno-lifetime-dse flag, but there are other places where we ask the memory manager to allocate data. This is temporary band-aid, and is already fixed in 5.8. Change-Id: Ia61a69f65fab351068a588cfc36b5b3d762ffc9f Task-number: QTBUG-56932 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QV4String: properly detect overflow when trying to convert to an array indexGiuseppe D'Angelo2016-11-042-0/+29
| | | | | | | | | | | | | | | A wrong overflow detection caused strings like "240000000000" to pass the conversion, even though they would not fit into a uint when converted into base-10. This mis-conversion to uint then caused all sorts of side effects (broken comparisons, wrong listing of properties, and so on). So, properly fix the overflow detection by using our numeric private functions. Change-Id: Icbf67ac68cf5785d6c77b433c7a45aed5285a8c2 Task-number: QTBUG-56830 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add a test for bitmap font rendering in Qt QuickEskil Abrahamsen Blomfeldt2016-10-251-0/+18
| | | | | | | | | | The "fixedsys" font is available on Windows at least, so while this test may not add any value on other platforms, it won't hurt either, and this was something that regressed on Windows before. Task-number: QTBUG-56659 Change-Id: Id01dedcbdc2fe74027caf31dd0dde6729ade8c63 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Make tst_qquicktextedit::mouseSelection() passJ-P Nurmi2016-10-242-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | Since qtbase commit beef975, QTestLib avoids generating accidental double click events by adding 500ms timestamp delta on release events. The test requires a press-and-drag-and-release type of sequence with double and triple clicks. The triple-click case is handled fine with QTest::mouseDClick() + press + move + release, but the double-click case is using QTest::mouseClick() + press + move + release and relies on the accidental double-click event generation that QTestLib now deliberately prevents. I can't think of a nice way to inject the move event in the middle of a double-click sequence generated by QTest::mouseDClick(), so we just send the missing double-click event by hand. We can also remove the QStyleHints::mouseDoubleClickInterval waits, which were there to prevent the aforementioned accidental double click events that can no longer happen. This reduces the total execution time of mouseSelection() by roughly 90%. Task-number: QTBUG-50022 Change-Id: I252e87d6a49ea86a44cfa347a29eebee12fd36d1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* tst_qquicktextedit: remove mouseDoubleClickInterval waitJ-P Nurmi2016-10-231-3/+0
| | | | | | | | | | | | Since qtbase commit beef975, QTestLib avoids generating accidental double click events by adding 500ms timestamp delta on release events. Thus, now we can remove the QStyleHints::mouseDoubleClickInterval wait, which were there to prevent the aforementioned accidental double click events that can no longer happen. The default inverval is 400ms, so this saves us nearly half a second on most platforms. Change-Id: I7a670b70c012ac027dc951ebafdf5e7d53b89ce9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* tst_qquicktext: remove bogus blacklistingJ-P Nurmi2016-10-231-2/+0
| | | | | | | There's no such test as mouseSelection in tst_qquicktext. Change-Id: I09bf4c61b53acd9811e020379a29c80fce9fe48b Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* QQuickWindow: don't discard timestamps for wheel eventsJ-P Nurmi2016-10-151-2/+5
| | | | | | | | | | | Noticed while debugging QTBUG-56075 on XCB. QQuickFlickable did not receive timestamps for wheel events provided by XI2. This alone does not fix the flicking speed issue with high-precision trackpads, but is needed to be able to calculate the appropriate velocity. Task-number: QTBUG-56075 Change-Id: I458e6302aee72863cdc1f8e8f7d99449016905a9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix corruption when adding or changing properties of JS objectsArnaud Vrac2016-10-101-0/+14
| | | | | | | | | | Commit 833c99db20 introduced this regression by only moving part of the value data to the proper offset. Task-number: QTBUG-53261 Change-Id: I11241c57057a57794bc3ca60ee437206e524f355 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Flickable: add a trackpad (touchpad) autotestShawn Rutledge2016-10-041-0/+45
| | | | | | | | | | We've had this feature for a long time, to use pixel deltas and scroll phase effectively, but no autotest until now. It's still not very thorough but it's a start. Task-number: QTBUG-55871 Change-Id: Iaf6e7a842ce90828da3253e8673cac9905abd046 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Fix vtable for QQuickPaintedItemSimon Hausmann2016-09-302-2/+2
| | | | | | | | As mentioned in QTBUG-54404 this is an unfortunate breakage we choose to accept. Change-Id: Id511188a2dcd35e8e16e7651c9764c8be1b5afb1 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* BC test data files for Qt 5.6 for QtDeclarativeMilla Pohjanheimo2016-09-304-0/+54475
| | | | | | | Data files for bic test added for QtDeclarative Change-Id: Id576ca010b9f18a6b8a4c79625375ee4cc3cbf93 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* qv4jsonobject: Make use of QVariant::toString in stringificationRobin Burchell2016-09-302-0/+22
| | | | | | | | This covers a whole host of missing cases, notably QUrl stored in a QV4::Value. Task-number: QTBUG-50592 Change-Id: I8afd772046c7bfbbcf916a7e90a57be5257b9df8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix crash with window-less QQuickItemsSimon Hausmann2016-09-301-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | Mark QQuickItem visual children directly in QQuickItem instead of relying on the item being a (grand) child of a window. [ChangeLog][QtQuick] Fix crash with QQuickItems created via JavaScript being garbage collected sometimes when they're not assigned to a window. This may happen even in qmlscene when between the creation of the root item and the assignment to the QQuickWindow the garbage collector runs. The previous approach of a persistent in QQuickView marking the visual item hierarchy relies on the existence of a view. The only thing left to do in the view and qml window implementation is enforcing the CppOwnership policy set on the content item in QQuickWindow by ensuring the presence of the JS wrapper, replacing the persistent with a weak value. This also introduces a new internal mechanism for QObject sub-classes to provide their own V4 JS wrapper types. Task-number: QTBUG-39888 Change-Id: Icd45a636a6d4e4528fc19165b13f4e1ca7967087 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* Fix incorrectly aligned text whose size depends on its implicit sizeMitch Curtis2016-09-292-0/+73
| | | | | | | | | | | | | | The if statement in QQuickTextPrivate::setupTextLayout() was missing an OR clause for the case where the line width is neither greater nor less than the old width/natural width, but has actually changed. If that sounds confusing, it's because it is. Basically, the outer layouting loop in that function needs to run twice for this scenario, so that's what this patch makes it do. Change-Id: I13777667eb13506d50f05e9766785a1c2c46125c Task-number: QTBUG-50738 Task-number: QTBUG-50740 Reviewed-by: Liang Qi <liang.qi@qt.io>
* QQuickText: fix paddings when wrapping or eliding is usedJ-P Nurmi2016-09-291-0/+12
| | | | | | Change-Id: I8ec8c8eff41e77225ef42f7bd9e52f4558d00130 Task-number: QTBUG-55779 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Flickable: do not emit movementEnded until it really doesShawn Rutledge2016-09-292-1/+24
| | | | | | | | | | This was occurring when using a physical mouse wheel: movementEnded was emitted, then contentYChanged would still be emitted a few more times. Task-number: QTBUG-55886 Change-Id: Ib5e833d5d84633bb07b8c240ea3ccc9977e443f8 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* Fix crash on Array.prototype.join.call(0)Robin Burchell2016-09-291-0/+9
| | | | | | | | | We (incorrectly) didn't check the return value to make sure we had a valid self. At the same time, rename the self variable to match up with other methods. Task-number: QTBUG-53672 Change-Id: Ia0ae5a553e49c4c3b2834c7fdf649fe6373951a2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix MouseArea sticky grab with drag.filterChildren enabledMartin Jones2016-09-222-0/+137
| | | | | | Task-number: QTBUG-56036 Change-Id: Iad776f42cc776e0d397173b3d2f3922eb7914392 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* Propagate window enter event as hover enter event in QQuickWindowEike Hein2016-09-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickWindow currently propagates window leave events as hover leave events to its content item, but it does not propagate window enter events as corresponding hover enter events. Instead, hover enter is only triggered implicitly by mouse moves. This can cause problems when there is no mouse movement inbetween the window being entered and a subsequent button press event. A common example where this occurs is dismissing a mouse-grabbing popup window (e.g. a QMenu) by clicking outside the popup, and then clicking in the same spot that was clicked to dismiss the popup. Without this patch, hover state is not realized until movement occurs, so there may be no no visual feedback and code that needs to update state based on what is being hovered prior to handling a press event can't work correctly. This patch synthesizes a QHoverEvent and delivers it in response to QEvent::Enter, similar to how QEvent::Leave is already handled. QWidget handles this correctly via QWidget::enterEvent. The equivalent in Qt Quick is QQuickItem::hoverEnterEvent, ultimately called with the synthesized event. The patch also updates the touchmouse::hoverEnabled autotest. Due to the window enter event now being handled correctly, exitSpy2 would run up a count() of 2, as the cursor was not in a neutral position after previous test cases. The change makes sure the cursor is in a neutral position before test case activity. [ChangeLog][QQuickWindow] The relevant child item is now sent a hover event when the window receives a QEnterEvent, making sure hovering is recognized without waiting for mouse movement. Change-Id: If0586f6cd971df0dfc266bb1a39c9cdb184fd286 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Destroy an incubating delegate if it is removed before incubation completesMartin Jones2016-09-151-3/+4
| | | | | | | | | Removing an item from a model after its delegate has started incubation, but before it has completed results is an orphaned item. Task-number: QTBUG-55901 Change-Id: I3d3136dc05a950ca38d53687ae7d38a6d0c7ec35 Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
* Allow for garbage collection of types with errors in trimCache()Michael Brasser2016-08-305-0/+54
| | | | | | | Change-Id: I821ea14f60871735bface4e2cf4e61fcb61b2784 Task-number: QTBUG-55567 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Prospective fix for the plugin check on Apple platformsSimon Hausmann2016-08-251-0/+4
| | | | | | | | | | After enabling separate debug info for Apple platforms, the toolchain creates dSYM directory hierarchies that mirror the real hierarchy. The contained .dylib files are not dylib files, they cannot be loaded. Try to skip any paths that may point to such a hierarchy. Change-Id: Iaee98a657495f31229c29ecd53a63e6493e70aff Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* PathView: fix infinite construction/destruction loopAnton Kudryavtsev2016-08-122-0/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | ... when all (or almost all) items are in the cache. When all items are in cache, check lower bound is equal to upper_bound. In rare cases, especially when almost all items are in cache, the inserting code was used (not only appending and prepending). In this code there was not bound check before creation of item and there was such situation: 1. Create item by inserting code (without bound check) 2. At the next call of refill() remove this item by life cycle because this item does not meet the conditions. And go to step 1. In other words at the first call we create some item, at the second remove this item. And again. So we had infinite construction/destruction loop. To break it we should check position of new item before creation in inserting code too (like we do in appending and prepending code). Task-number: QTBUG-37815 Change-Id: I015cdeb67ca5fcd06c34b3145b49cbd3e38d4078 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix test failure: wait between mouse events the proper wayJan Arve Saether2016-08-121-19/+12
| | | | | | | | | | | | | | | | | | | Apparently, QTest::mouseEvent() disregards the wall time for the time stamps for events, but synthesizes the timestamps instead. The proper way is to specify the waiting time in the delay argument. This will adjust both the timestamp and perform a qWait() before the event handler is called. Without this patch, the qWait(doubleClickInterval) was disregarded, which lead to that a doubleclick event was generated, and it failed with the following message: Actual (((window->rootObject()->property("doubleClicks").toInt()))): 2 Expected (1) : 1 tst_qquickmousearea.cpp(1105) : failure location Change-Id: Ieda3b670d3cda0bd522db2f9677dad5745c88a21 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* PathView: fix item creationAnton Kudryavtsev2016-08-122-0/+101
| | | | | | | | | | | | | | | | | | | | First call of QQuickPathView::refill() did not use currentIndex for item prepending and there was situation when items were not created, e.g.: PathView with current item in center and currentIndex was set so that item with index 0 was after current item and before path end. The result of this situation: items from path begin to current item were not created. The reason was that idx always equaled (modelCount-1) for item prepending. Now first filling uses currentIndex to calculate valid idx. Task-number: QTBUG-53464 Change-Id: I7e343b0712c9c5c5cd56b1d8e020cf8c0f6e6301 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix char conversions in QMLChristian Strømme2016-08-092-39/+32
| | | | | | | | | | | | | | This is a partial revert of 90b06e2773842, as it had unwanted side effects. The original intention was to make assignment from char to string possible, or more specifically, we wanted a solution where a QChar could be assigned to a QString, as a character and not a string representation of its value. While this behavior is desirable for QChar, we most likely want the opposite for the regular character types. Task-number: QTBUG-49232 Change-Id: I82d5f72b900fe984c4db1478fd52a9eb69ad2ee6 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix crash with Component.onDestructionSimon Hausmann2016-08-052-0/+105
| | | | | | | | | | | | | | | A call to a handler of Component.onDestruction may end up causing WeakValues such as QQmlData::jsWrapper to be set again, even though they've been set to undefined in an earlier iteration of the loop that walks through the weak references. That in turn may result in invalid object references to objects that are scheduled for destruction by the collector. So after calling all destroy handlers for QObjects, reset all of the weak values again. Task-number: QTBUG-54939 Change-Id: I00ebabb76274e296fb1bd90d8d3e21dbbb920b57 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* tst_librarymetrics_performance: Use QBENCHMARK macro instead of rolling our ownRobin Burchell2016-08-051-133/+14
| | | | | | | | | This means we now respect -callgrind to show instruction counts (for instance). If benchmarks don't already throw out outliers and perform averaging, we should roll those features into testlib, not replace it. Change-Id: I21a3c4b41ec80a49b5b61bfe957f1165ac865010 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* benchmarks: Remove odd qqmlimage benchmarkRobin Burchell2016-08-054-113/+0
| | | | | | | | | I have no idea what this was theoretically supposed to be testing, but it looks completely bogus (not representative of a real world scenario), is subject to massive variance thanks to memory allocation, and generally doesn't seem useful Change-Id: Ib7adc8a4753e49d2a3bd9515273bca79a88a5749 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>