aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* mouseDrag(): ensure that intermediate moves are done for all dragsMitch Curtis2019-11-261-0/+30
| | | | | | | | | | | | | | | | | | The code checking if the intermediate move distance was less than the drag threshold, but without accounting for negative distances. Since the negative distances were naturally less than the drag threshold, the intermediate distances were set to zero and the intermediate moves were never done. In practice, this means that mouseDrag() never did intermediate moves (i.e. what happens during a drag in real life) for drags that go from right to left or upwards. Task-number: QTBUG-80152 Change-Id: Ic27021f5ce5ba2937e95fb2dfb532bd2136f4205 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit fad8ef3e4133538e3785d7067c35c652bc894711) Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* TableView: use fetchMore() when scrolling to the end of the tableKari Hormi2019-11-203-0/+43
| | | | | | | | | | | QQmlTableInstanceModel implements canFetchMore and fetchMore functions, but these are not called at any point in QQuickTableView. This change checks if additional data can be fetched when atYEndChanged signal is emitted. Fixes: QTBUG-78273 Change-Id: I49b41b09d9a218826b34f32cd9fe4724a6097b52 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix: NativeRendering text for non-integer screen scalingEirik Aavitsland2019-11-181-0/+37
| | | | | | | | | | | | | | Commit 6e883c53 introduced snapping to pixel grid for non-integer device pixel ratios. But the snapping also modified the w element of the coord vector, which resulted in mangled and offset rendering. As a driveby, add the dpr snapping also to the outlinetext shader, as it improves rendering quality. Fixes: QTBUG-70481 Fixes: QTBUG-78160 Change-Id: I4c4b1788005514adc0255878ba24cdf1acc6755f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* mouseDrag(): never drag along an axis that wasn't requestedMitch Curtis2019-11-141-0/+132
| | | | | | | | | | | mouseDrag() should not drag along an axis if the distance passed in for that axis was 0. Doing so can interfere with tests for an item that e.g. handles horizontal flicks which is within e.g. a Flickable that handles vertical flicks. This was seen with SwipeDelegate auto tests, where the delegates handles horizontal swipes within a vertical ListView. Change-Id: I8fee567d59c53bdc4cbfe1d42ae0592e324bd2f6 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QQmlTableInstanceModel: always emit index changed when an item is reusedRichard Moe Gustavsen2019-11-143-0/+50
| | | | | | | | | | | | | | | | | | | | | When reusing a delegate item, it can sometimes happen that the item ends up being reused at the same location in the table as it had before it was pooled. And in that case, we don't emit changes to index, row and column since they technically didn't change. The problem is that the model might have changed in-between, e.g if a row has been removed. And in that case, row and column will, even when unchanged, point to other parts of the model. So all bindings needs to be reevaluated to ensure that the values they use are refreshed. This patch will therefore ensure that we always emit changes to the mentioned properties when an item is reused, regardless if they change or not. Fixes: QTBUG-79209 Change-Id: Icec201a43a30b9f677303fbf652baf6487621deb Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-11-141-2/+32
|\ | | | | | | Change-Id: I06578422b4558feabf7a77426b01e77953ab60e2
| * QQuickAccessibleAttached: keep track of name being explicitly setMitch Curtis2019-11-061-2/+32
| | | | | | | | | | | | | | | | | | This allows types to attach an accessible name to an item, so long as the user hasn't done so themselves. Task-number: QTBUG-66583 Change-Id: I04f26815ffeaf1198fee25dc414253de8b8dfabe Reviewed-by: Liang Qi <liang.qi@qt.io>
* | Qt Quick Layouts: Do not assert when specifying an invalid row/columnJan Arve Sæther2019-11-131-0/+33
| | | | | | | | | | | | | | | | We now print a warning and try to gracefully handle it Change-Id: I66e79fe918808f5fede78a23df50e9e95b7b832d Fixes: QTBUG-67204 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Fuzzing: Don't copy input data to QByteArrayRobert Loehning2019-11-131-1/+1
| | | | | | | | | | Change-Id: I1c83b2da19f9d73e4069ecb1f85af71e2ac2b96b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | autotest, tableview: silence compiler warningRichard Moe Gustavsen2019-11-121-1/+1
| | | | | | | | | | Change-Id: I311f0c21baa73521717ad98b2398d5469b9ac208 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | QQuickTableView::forceLayout(): rebuild table if the size of the model has ↵Richard Moe Gustavsen2019-11-121-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | changed An assert will trigger if forceLayout() is called while the model is being reset. The reason is that the forceLayout() schedules a relayout which assumes that the size of the model hasn't changed. But while layouting, it will try to fetch data from the model according to the old size, which will trigger an assert. This patch will add an extra path to forceLayout() that checks if the size of the model has changed, and if so, schedule a complete rebuild instead of just a relayout. Fixes: QTBUG-79395 Change-Id: If61658912d9e90c1a5aef9bc28083da20fa6ec76 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | lancelot graphics test: Use application bundle on MacEirik Aavitsland2019-11-073-4/+15
| | | | | | | | | | | | | | | | | | | | Font handling has been observed to differ depending on the presence of the Info.plist file in the app bundle. We want to test the typical use case, so make the qmlscenegrabber executable be a bundled app. Change-Id: I2e8b96328b16d5bedfeb5f6dd23f20c06d4c60c1 Reviewed-by: Daniel Smith <Daniel.Smith@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Blacklist tst_qquicktextedit::mouseSelectionMode on OpenSuse 15Ulf Hermann2019-11-071-0/+4
| | | | | | | | | | | | | | | | Task-number: QTBUG-78846 Change-Id: I74d0f35b5ee1d22b10564c28edeb833689bbc6d9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-318-0/+149
|\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/common/qv4compileddata_p.h src/qml/types/qqmlbind.cpp tests/auto/qml/qqmlproperty/tst_qqmlproperty.cpp Change-Id: I6a137907e63445f17a3d6181b832a6bd76135bb2
| * QQmlProperty: handle reads of QQmlPropertyMap correctlyFabian Kosmale2019-10-301-0/+21
| | | | | | | | | | | | Fixes: QTBUG-79614 Change-Id: Iaf84c0178dc88072a367da2b42b09554b85c7d57 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * QML Drag: Prevent crash when using image provider urlFabian Kosmale2019-10-301-0/+25
| | | | | | | | | | | | | | | | | | | | For attached property objects, qmlEngine will not return an engine. However, QQuickDragAttached's parent is the object to which it is attached, and from that one we can get the engine. Fixes: QTBUG-72045 Change-Id: I40748dd11ea3eb4604c37e932b2cfd3baad6fd1f Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * QQuickItem::setParentItem: add child earlierFabian Kosmale2019-10-292-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | Calling (de)refWindow can trigger QQuickItem::windowChanged, which in turn can call a user defined windowChanged handler. If that signal handler were to call setParentItem, we would encounter an inconsistent state: The item already has its parent set, but that parent would lack the item in its children list (as we would only call refWindow at a later point). Fixes: QTBUG-79573 Fixes: QTBUG-73439 Change-Id: I46adaa54a0521b5cd7f37810b3dd1a206e6a09c6 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Add missing emits from various property setters in {Grid,Row}LayoutJan Arve Sæther2019-10-251-0/+54
| | | | | | | | | | | | Change-Id: I3ac473b3d46ff1f898c1607deb6ad3d586753244 Fixes: QTBUG-79359 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * Loader: Actually clear initial properties when changing sourceFabian Kosmale2019-10-243-0/+29
| | | | | | | | | | | | Fixes: QTBUG-79435 Change-Id: Ic99a3b1a9d64426a64117b90a3e11fe99af0d260 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Adapt test case to avoid null characters in directory namesUlf Hermann2019-10-291-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | The file system engine in QtCore is stricter now about these things. In the particular example we have here, the first character of the imported directory was a null character, which would previously lead to the whole import being ignored. We cannot do such nasty things anymore. Therefore, comment the import out, in order to retain the old behavior. Fixes: QTBUG-79562 Change-Id: I04917bf7db32e9d09e5919555740a263af2d1795 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | QML: Consistently check for debugger before loading cache filesUlf Hermann2019-10-243-1/+92
| | | | | | | | | | | | | | | | | | In debug mode we don't want to load cache files. Fixes: QTBUG-79443 Change-Id: Ie3e2c70d54e66f24846070aee952a86934099695 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Fix typoRobert Loehning2019-10-211-1/+1
| | | | | | | | | | Change-Id: I6bdb4ca295853d4c179198adcc0856d86b182656 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | Pass suitable nFormals when constructing JS stack frameUlf Hermann2019-10-213-1/+19
| | | | | | | | | | | | | | | | | | The extra formal parameters for signal handlers are not passed in "registers" and therefore should not be given here. Fixes: QTBUG-78486 Change-Id: I18594e0139a7a23d4e53b41e8b00b1e9f2e07aeb Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix interface handling in bindingsFabian Kosmale2019-10-212-0/+106
| | | | | | | | | | | | | | | | | | | | | | If a type had a property with an interface type, we did not support the case where the assigned binding value is convertible to the interface. This is now fixed by adding a last new check to QQmlPrivate::write Fixes: QTBUG-78721 Change-Id: I0b85fbfdf8561ba43610ac343001ae380287a674 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | QML: Extend QML loader thread's stack sizeErik Verbruggen2019-10-164-0/+4
| | | | | | | | | | | | | | | | | | | | | | By default, on some platforms non-main threads have a very limited stack size. Extend it so that we can parse more deeply nested QML/JS files. The parser expects a stack size of 8MB. Task-number: QTBUG-71078 Change-Id: I5edd6630c870e45c3dbe66e6a2a178f5c6991677 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Make ScopedValue's CHECK_EXCEPTION also check isInterruptedUlf Hermann2019-10-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | While there should be no way to generate an infinite loop from any of the affected methods, you can certainly generate a really long loop, for example with Array(1E9).join(). We should be able to interrupt this. Also, the various call()s could return with isInterrupted set. We should respect that and immediately return. Fixes: QTBUG-78955 Change-Id: I7e18b24db0bf39df03134027b2b5dba452ac7c1c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Check for invalid context in QQmlContextPrivate::dropDestroyedQObjectUlf Hermann2019-10-161-7/+18
| | | | | | | | | | | | | | | | | | | | If the context is invalid we won't be able to look up the object by name anymore. In that case there is nothing to do. Fixes: QTBUG-78326 Change-Id: I011ccb6b02a84725c1d5eae24b494516ae2d5fee Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | qmlplugindump: Fix prototype and name for composite typesUlf Hermann2019-10-154-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before we would always merge everything up to QObject. That would duplicate entries between types that inherit from the same base class. Also, when the composite type doesn't specify a module (because we just created a component from a plain QML file), use the module URI from our version info. As we're dumping the component we can assume it belongs to the module we're dumping. Change-Id: Icf9a58cfe1165f557ebbf7309251e98a0782dc33 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.13' into 5.14Qt Forward Merge Bot2019-10-152-0/+35
|\| | | | | | | Change-Id: I7759f6b60f8fda6525b239c7ee2e034194d4ab85
| * QQuickTextInput::remove: Fix selection logicFabian Kosmale2019-10-112-0/+35
| | | | | | | | | | | | | | | | Fixes: QTBUG-77814 Change-Id: I96b8990656117430eb12fc4b294a8ece612d3a4b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Fix float value binding to an integerTeemu Holappa2019-10-112-0/+25
| | | | | | | | | | | | | | | | | | Also NaN values are casted to an integer which causes illegal integer values. Task-number: QTBUG-72442 Change-Id: I3ff3c8e4dc493600360448ea30d949c0017da8c3 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.13' into 5.14"Liang Qi2019-10-1015-0/+302
|\ \
| * | Merge remote-tracking branch 'origin/5.13' into 5.14Liang Qi2019-10-1015-0/+302
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/scenegraph/openvg/qsgopenvgcontext.cpp tests/auto/quick/qquickpathview/tst_qquickpathview.cpp Change-Id: I117c8d62b21800329d1035021d312d9924f83a1b
| | * Add signal spies to tst_QQuickPathView::flickNClick testShawn Rutledge2019-10-091-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTBUG-78926 is about failing to emit the movingChanged signal. The test verifies that e2df4233a77ce8a37d2c8ef26b7b42fc0d33a24b fixed it. While we're at it, might as well verify a few more signals in this test scenario where we flick the PathView at various speeds and then stop the flick by clicking. Fixes: QTBUG-78926 Change-Id: I1253dfcd88a63abdbdd280dd9097b484a93cc491 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| | * PathView: grab mouse on press if already movingShawn Rutledge2019-10-093-0/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A side effect of 8fd398c9d2f5f54e446e0b402bc63a2edb50da6f is that it became possible for the highlight to stop between items, rather than snapping to a specific item, if the user taps, clicks or drags an additional time while the movement is ongoing. That was because it didn't get a mouse grab, so it missed the release event. QQuickPathViewPrivate::handleMouseReleaseEvent() needs to take care of the snapping behavior after the user stops dragging. This only affects behavior in the case that the PathView is already moving and the mouse is pressed again: we assume the user wants to alter the PathView's velocity, not interact with any delegate inside or with any parent item. Task-number: QTBUG-77173 Task-number: QTBUG-59620 Change-Id: I7b2f69a6ef8d8022d7c917a5bf9e8fb40c8848db Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit e2df4233a77ce8a37d2c8ef26b7b42fc0d33a24b)
| | * Be more fussy about the MakeDay() calculationEdward Welbourne2019-10-0813-0/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ES Date spec goes into minute detail about doing various algorithms in the dumbest possible way (like InLeapYear() calling DaysInYear(), rather than the other way round) but, in MakeDay(), leaves the implementation to solve the problem of finding the start of the first day of a specified month in a given year. So exercise the freedom we have in that to be a little more robust; and actually check we have met the conditions the spec requires, returning NaN (as specified) if not. Added tests for some denormal dates and date-times and for a date mentioned in QTBUG-78996. Task-number: QTBUG-78996 Change-Id: I8d9a841dd1f1d9995273a3de8f6f9130207c7c2b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
| | * Fix bug when highlight was not respected after currentIndex changedJan Arve Sæther2019-10-081-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QQuickListViewPrivate::fixup() seems to only do "fixup" if moveReason != QQuickListViewPrivate::SetIndex By default, moveReason is set to Other. In the snippet given in QTBUG-77418, this is why the highlight was respected when resizing the ListView initially. However, after the currentIndex was changed, moveReason was changed to SetIndex. When we then resized the ListView, it still had the value SetIndex, and would fail to "fixup" properly. Since the ListView preferredHighlightBegin is bound to width, we should set moveReason to Other in the property setters that are related to highlight. This is then consistent with how setCurrentIndex() does it (it similarly sets d->moveReason = QQuickItemViewPrivate::SetIndex;) Change-Id: I7edf77fc977e8c7e3fc656ff5bb22b4dd01afbe4 Task-number: QTBUG-77418 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | | QML ListModel: Emit a warning when adding an object with undefined or null ↵Fabian Kosmale2019-10-101-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | member The current code in ListModel simply did a reset of an existing property, in case a role existed and was set to null/undefined. If the role did not exist, the code would simply skip over the member and do nothing. However, this does not make any sense for newly inserted items, and most likely indicates a misunderstanding of how ListModel works. Creating an undefined/null role does not really make sense, as those could only ever store a undefined/null value. Change-Id: I4c1361647a82146565eaffe064598c94c748b4f5 Task-number: QTBUG-63569 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Fix signed/unsigned comparison warningsEdward Welbourne2019-10-101-12/+13
|/ / | | | | | | | | | | | | This is a follow-up to commit 59410dd2f587945441791e76a5ac07acbe15989f Change-Id: Ie5257791662c6f2fef32cc667849598cf428e825 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | QQuickWindow: Higher z-order items now steal drop targetStephen D'Angelo2019-10-095-18/+271
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, an active drop target would remain the drop target until the drag left it's area, or entered a child item that accepted a DragEnterEvent, even if the drag entered a drop target with a globally higher z-order from a different subtree. When moving to an item with a higher z-order, the DragEnterEvent is now sent to the new drop target before DragLeaveEvent is sent to the old drop target. There can now only be one drop target. If an item is the current drop target and a higher z-order child accepts the DragEnterEvent, the parent is no longer a drop target. Fixes: QTBUG-30305 Change-Id: I7b985d6317be70867e7727222a4cd44ace7559e6 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Send ShortcutOverride event when receiving a non-spontaneous key pressTeemu Holappa2019-10-092-0/+75
| | | | | | | | | | | | | | | | | | | | | | This is a very similar fix what's been done to the widgets to fix QTBUG-48325. In QQuickWindow there is added the sending of a ShortCutOverride even when a non-spontaneous KeyPress event is received. Task-number: QTBUG-78304 Change-Id: Icb267e611248460533f20e84deef71da6b481cd2 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | When a DelegateModel delegate changes, refill the viewShawn Rutledge2019-10-091-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It looked a bit odd that the DelegateModel delegate property was not a notifying property. Adding the delegateChanged signal makes it easier to update the view when this happens. The previous approach of removing all delegates and adding all new ones resulted in the view losing its currentIndex and often scrolling to a different place. It's also nice to reduce the number of d-> indirections by adding the QQuickItemViewPrivate::applyDelegateChange() function, so that we just need one indirection to call it, and then it updates all the internal stuff in one place. Done-with: Frederik Gladhorn Done-with: Joni Poikelin Fixes: QTBUG-63477 Change-Id: I2d17fd11ff4a2fcb20968a7182dd2c403abb715a Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | QQmlListModel: handle nested list models during iterationFabian Kosmale2019-10-081-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ListElement::getProperty returns in turn a list model The ModelObjectOwnPropertyKeyIterator should however return the concrete values, and not some proxy object. This would cause funny return values in the best case, and a crash in case of QTBUG-79083. We therefore convert the nested model to a JavaScript array in ModelObjectOwnPropertyKeyIterator::next, which avoids beforementioned issues. Fixes: QTBUG-79083 Change-Id: If038598ff1c3c59090e994aaba5fba94a6964224 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add a property "valid" to the color value typeUlf Hermann2019-10-083-0/+11
| | | | | | | | | | | | | | | | | | | | This gives users a more convenient way to determine if a particular color is valid. Before you had to actually compare with an invalid color. Fixes: QTBUG-78325 Change-Id: Id86bc46a48aa11da3e6654d2940d758d2b0e784f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Add initial support for deep aliasesFabian Kosmale2019-10-072-0/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch reuses the existing support for value types to support aliases of depth 2. This covers the initial use case in QTBUG-48150. Adding support for "deeper" aliases would require storing the complete "property path", which in turn would require increasing the size of the Alias data. This is currently considered out of scope, at least until a clear use-case appears. Fixes: QTBUG-48150 Change-Id: Id2ac4dd175003a37eba2919e7604d0a3be54d29f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QML Binding: do not convert stringsFabian Kosmale2019-10-072-34/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The root cause for the issue is that QQmlObjectCreator::setPropertyValue calls QQmlStringConverters::variantFromString on strings if the property is of type QVariant. Unfortunately, this cannot be changed easily as the current behavior is explicitly documented and tested in tst_qqmllanguage, thus making it a breaking change. As a workaround, QML Binding does now take a QJSValue instead of a QVariant (making value a var property), which does not trigger the conversion path. Fixes: QTBUG-78943 Change-Id: I0b64dffdb6b84b2bab2bb85a8cb263e530c18570 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | qmlRegisterSingletonInstance: Do not crash if instance gets deletedFabian Kosmale2019-10-071-0/+10
| | | | | | | | | | | | | | | | | | | | Use a QPointer, so that we notice if the object has been deleted. Also ensure that in the documentation the function is in a single line, as qdoc will otherwise silently omit it. Change-Id: Idecd370d00089997cd18b3247ad2290a561b2b69 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | tst_qqmlecmascript: import QtQuick when using color propertiesUlf Hermann2019-10-011-0/+1
| | | | | | | | | | | | | | | | QtQuick defines the color provider necessary to use colors. If QtQuick is not loaded at that point, the test fails. Change-Id: I7d2eb25f7482d18b304d9274bce4a6bd6fa34741 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | tst_qqmlecmascript: Don't leak created objectsUlf Hermann2019-10-012-55/+54
| | | | | | | | | | | | | | The result from component.create() has to be deleted somewhere. Change-Id: I23135cb639fc316641e399decc740d9f5d445a84 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | tst_qqmllanguage: Fix singleton testsUlf Hermann2019-09-301-27/+28
| | | | | | | | | | | | | | | | | | The JavaScript pragma test expected the dynamic signal test to run before. Therefore, it would fail when run in isolation. Move the two tests into one function. Change-Id: I0edb1f091c6a845110c3f741cbb48e846c423005 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>