aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* tst_qquickwindow: construct pointer events with proper devicesShawn Rutledge2020-02-111-2/+2
| | | | | | | | | In the QQuickPointerMouseEvent constructor, the device pointer became mandatory mainly because it's mandatory in QQuickSinglePointEvent, because we want to ensure that we distinguish mouse from tablet events. Change-Id: I3d314c6877493b8b5b6407f5eb5631f7083900a5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QQmlCustomParser: Resolve import namespacesUlf Hermann2020-02-112-2/+37
| | | | | | | | | Also, don't use plain QObject for testing registrations with extensions and foreign types. This interacts with other tests. Change-Id: I43df8a4e5b22def5a87f508130f1c7b4833ecfb6 Fixes: QTBUG-81970 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QQmlEngine: Test that types are correctly removedFabian Kosmale2020-02-102-0/+15
| | | | | | | Amends 4f0c9986069c690e8ed7a7d2b42dfbce5c492368 Change-Id: I10a0d7988e1f5a003ccc80faa5b5c9bda62359cd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Models: Make sure we can use QList<QObject *> as required modelUlf Hermann2020-02-062-0/+72
| | | | | | | | | We can use it as model passed via a context property as shown in the objectlistmodel example. We should also be able to pass it directly then. Change-Id: I55db74df969d8024553d9470f1afe4710e61b1bf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-02-069-6/+760
|\ | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/qml/types/qqmlbind.cpp src/quick/items/qquicklistview.cpp tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: Id6805c13256ad13d5651011e5dd09bba0ec02987
| * Blacklist tst_qquickmousearea::nestedStopAtBounds on opensuse 15.0Ulf Hermann2020-02-031-0/+4
| | | | | | | | | | | | | | | | | | This partially reverts commit 51e02fdc02c3cc2dbf9d2ba0b3fb709a6cd4e32e. Task-number: QTBUG-78153 Change-Id: I421fdc3acefd11cabfc192eb06c3cd92c0e76149 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * Enable conversion from QJSValues containing arrays to container typesFabian Kosmale2020-01-314-6/+39
| | | | | | | | | | | | | | | | | | | | | | | | We started to convert containers to QJSValues, so that we could use them as JavaScript arrays. Unfortunately, this would then lead to a type missmatch when those same values where to be stored in a property of the container type. This commit fixes this by converting them back to the original type. Fixes: QTBUG-80916 Change-Id: I30a3b03e17c34b171d4a6881dfd7801c13e94d80 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * Fix some ListView bugs related to snapping when it had a headerJan Arve Sæther2020-01-302-0/+668
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most bugs were related to the PullBackHeader header positining mode, for instance the old code did not take into consideration that for the PullBackHeader it was sometimes not sufficient to scroll the view. The header also had to be scrolled independently from the view: We achieve this by hooking on to the same timeline that is used for scrolling the view. (This way, both animations are synchronized, and they start and end at the same time). Change-Id: I75708c0fd8d4741032c04ad9ee144d7a49cf3359 Fixes: QTBUG-76362 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * QQuickFlickable: fix division by zeroMitch Curtis2020-01-292-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The issue could be seen when enabling exceptions and running the following QML code: Flickable { id: flickable anchors.fill: parent contentWidth: 1000 contentHeight: 1000 Text { text: flickable.visibleArea.xPosition } } Change-Id: I615f9f9dc84903fb3a902f416a55e3ce3fece64c Fixes: QTBUG-81098 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | QmlDebug: add new debugtranslationserviceTim Jenssen2020-02-054-0/+134
| | | | | | | | | | | | | | | | | | | | | | | | Users were asking for having the possibility to see where the translated text will not fit in the reserved/available space. This is more a preparation patch to get the right connectors to change the visualization of findings or maybe log this to a file. Task-number: QDS-1463 Change-Id: Ic0a7a930141d6eeb79964e51c0a165c69888cf5d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Inline components: fix name resolutionFabian Kosmale2020-02-054-0/+39
| | | | | | | | | | | | | | | | Inline components are an explicit component boundary, and therefore need some extra treatment. Change-Id: I03cc0d58f3565999f64675e8482ed3c3a325e8c0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | QV4: Handle value tyes in sameValue algorithmFabian Kosmale2020-02-041-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | The sameValue(Zero) algorithm were implemented according to the JavaScript specification; however QML has the concept of value types. For those we need to check equality with the intrinsic isEqualTo method. This aligns sameValue(Zero) with strict equality in its treatment of value types. This fixes Array.includes for value types Fixes: QTBUG-81825 Change-Id: Idd3e09cbed94bca6ea44f5683610b87d184e432c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Tests: rename connect -> connectToTim Jenssen2020-02-039-28/+28
| | | | | | | | | | | | | | avoids strange compiler errors if a QObject::connect is used Change-Id: Ib9f5fc4114a06f7f1d1a0b9a142a15ce19270cec Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* | Further RHI adaptation of shaders in lancelot test scenesEirik Aavitsland2020-02-032-73/+1
| | | | | | | | | | | | | | | | | | | | | | In the recent commit that added RHI shaders, a couple of the test scenes were overlooked. The attributes.qml test file is simply removed as it adds no significant test coverage. Change-Id: Ic3af7b4447da322323f67faa1cf93c160c5043e8 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Add autotest for Image.sourceClipRect propertyShawn Rutledge2020-01-312-0/+74
| | | | | | | | | | | | | | | | It clips the heart.png image in various ways and tests a few pixel colors to verify the boundaries of the clipped portion. Change-Id: I1c65e522c99720e94a6e13020bd9bf9736e19b4e Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Required properties: Allow retroactive require specificationFabian Kosmale2020-01-3110-2/+58
| | | | | | | | | | | | | | | | It is now possible to mark a property of a parent class as required in the child by writing required <propertyName> Change-Id: I9e9d58c7b5c00577b056e905b39744b2fa359ea0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | add annotations to QMLFawzi Mohamed2020-01-313-0/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A QML Annotation is a Qml Object declaration prepended with @. The name of the annotation is restricted to a dot separated list of non keyword identifiers. Annotations can be put before an Object definition, or any object member declaration: bindings, property declarations, function declarations. This patch, aside parsing the annotations does absolutely nothing, the list of annotations is discarded and never touches the AST. [ChangeLog][QML] Add Qml Annotations Task-number: QTBUG-81714 Change-Id: I4d79559a0d1fb23acaf482d0ef8f7d106dbf099d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Tests: make ConnectResult a Q_ENUM to get nice error messageTim Jenssen2020-01-311-1/+2
| | | | | | | | | | Change-Id: I0e22eb66109e61a5341388d37f5b596f4125ac99 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Add PointerHandler.cursorShape propertyShawn Rutledge2020-01-316-7/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also, QQuickItemPrivate::setHasCursorInChild() was unable to check the QQuickItemPrivate::hasCursor variable, because the function argument hasCursor was shadowing that, even though the comment "nope! sorry, I have a cursor myself" hints that the intention was to check that. So this change exposed a problem there, and we have to fix that too, in order to keep the tst_qquickwindow::cursor() test passing. [ChangeLog][Event Handlers] Pointer Handlers now have a cursorShape property to set the cursor when the handler is active and the mouse is hovering, and restore to the previous cursor when the mouse leaves. Fixes: QTBUG-68073 Change-Id: Ib5c66bd59c4691c4210ee5465e1c95e7bdcf5ae1 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Image ColorSpace bindings for Quick/QMLAllan Sandfeld Jensen2020-01-312-0/+29
| | | | | | | | | | | | | | | | | | | | Adds a ColorSpace type mapped to QColorSpace, and adds a property to Image nodes to read and change it, converting the image if necessary on read. Fixes: QTBUG-80616 Change-Id: Ie80c8bc045f66de01de3a5d2c4a9974f07d2871d Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Add Behavior.targetProperty propertyPierre-Yves Siret2020-01-312-0/+38
| | | | | | | | | | | | | | | | | | | | [ChangeLog][Behavior] Behavior now have a targetProperty property to allow custom logic based on the target property's object or name. Fixes: QTBUG-70964 Change-Id: I866c10d36c7de181fff48da94c8e16cd73ce49b1 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Add Image.sourceClipRect propertyShawn Rutledge2020-01-304-0/+90
| | | | | | | | | | | | | | | | | | | | | | | | Since we set sourceSize, we expect to use that coordinate system in sourceClipRect too. Therefore we use QImageReader::setScaledClipRect(), not setClipRect(). [ChangeLog][QtQuick][Image] Image now has a sourceClipRect property to render a clipped image from a region of the sourceSize. Change-Id: If08277df772c2ab1063dd88572e49de41b97bca4 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* | Reduce Qt Declarative's use of QDateTime's locale-dependent APIsFabian Kosmale2020-01-302-12/+52
| | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtQml] Qt.formatDateTime, Qt.formatDate and Qt.formatTime now support formatting according to a locale and an optional locale format type. If locale dependent formatting is desired, this method should be used instead of the locale-related DateFormat enum members. Fixes: QTBUG-81631 Change-Id: I971231644ebbeaccbf54dd8f036adf4d31547301 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | qmlformat: Support even more language featuresMaximilian Goldstein2020-01-305-6/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds support (among other things) for: - Pragmas - Type annotations - get / set properties - Some previously unsupported escape sequences (\b,\v...) - Calling methods on numeric literals Also now checks whether the dumped code is still parsable. Change-Id: Ia142a7c0b3e608115e79c1d98a62b682dce4eec9 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"Qt Forward Merge Bot2020-01-292-4/+2
|\ \
| * | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-292-4/+2
| |\| | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/qmltooling/qmldbg_debugger/qqmlenginedebugservice.cpp Change-Id: I133bfd4bd9dd6f704252c956c90f05e8a8a40d6a
| | * Blacklist tst_QQuickWidget::enterLeave on macOSTor Arne Vestbø2020-01-231-0/+2
| | | | | | | | | | | | | | | Change-Id: Ie5437ad18fdfdba95c87adb68345b43dc1003155 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * ArrayPrototype::method_filter: Check for exception after callbackUlf Hermann2020-01-231-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | If there was an exception we cannot assume the returned value holds anything sensible. Also, we should immediately return. Fixes: QTBUG-81581 Change-Id: I822c204c476e05d6de78124b66ab2f939ca38ffd Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | tst_qqmlproperty: Avoid memory leaksUlf Hermann2020-01-291-30/+32
| | | | | | | | | | | | | | | | | | Change-Id: I38c414edbf75409b3278d89f55f1dbe97fc1fda0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | | Required properties: Allow required default propertiesFabian Kosmale2020-01-298-8/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | This was already possible from C++, this change adds the required changes to the grammar to allow declaring required default properties in QML. Change-Id: I76cb4d70e573bf161676da8295ab257fe95ed4ae Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Fix vertical position of PathTextEskil Abrahamsen Blomfeldt2020-01-291-0/+91
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | The PathText would always translate to y=0, regardless of what y was set to. We should obviously get the y coordinate of the shape *before* translating it into position to find the distance from the baseline. This change also updates the example, which had not been updated to the changed origin of the PathText, and it adds a Lancelot test for keeping track of the PathText shape rendering. Change-Id: I940ac956af5229842739f8d8751a1f13bb86b8e7 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Handle required properties declared in C++Fabian Kosmale2020-01-287-0/+95
| | | | | | | | | | | | Fixes: QTBUG-81561 Change-Id: I97a0f5013b6e3662ffaad53c5cc871404e11a310 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Fix tst_qqmlvaluetypes::colorProperty when run standaloneSimon Hausmann2020-01-281-0/+2
| | | | | | | | | | | | | | | | The test relied on implicit registration of QQmlProperty in the meta-type system. Change-Id: I21e08a44f8e3d3b1376977cb9c959e0630789ef9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | tst_qqmlengine: Don't rename the QObject QML typeUlf Hermann2020-01-271-1/+6
| | | | | | | | | | | | | | | | | | Registering a plain QObject as singleton instance does interesting things to following tests. This didn't break in the CI as the CI then retries the failed tests in isolation, which works. Change-Id: Ieaa898067cb470f3e90f6e9059fb4b4b3a42de00 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Tests: add override to inherited methodTim Jenssen2020-01-241-2/+1
| | | | | | | | | | Change-Id: I0d14fb06c1bddeef0d78b6c336a9427008cc2de1 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | remove unnecessary spaceTim Jenssen2020-01-241-1/+1
| | | | | | | | | | Change-Id: Iea3e4153a7f44d44e64225eff651088dc3e0f685 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* | Make QtQuick::Item::mapFrom/ToItem also accept point and rectAlbert Astals Cid2020-01-243-0/+36
| | | | | | | | | | | | | | | | [ChangeLog][QtQuick][Item] Item.mapToItem() and mapFromItem() now work with QPointF and QRectF types as well as with raw numbers. Change-Id: Ifeb5c36e1bc5a283df4e11c8cf2af960de3f287b Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Make QtQuick::Item::mapFrom/ToGlobal also accept pointAlbert Astals Cid2020-01-242-0/+18
| | | | | | | | | | | | | | | | [ChangeLog][QtQuick][Item] Item.mapToGlobal() and mapFromGlobal() now work with QPointF as well as with raw numeric coordinates. Change-Id: I6a335c95a014bc77a927c781586619e62dce2f02 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Add support to match against QObject properties in DelegateChooserJoni Poikelin2020-01-242-0/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Views could use an array of QObject instances as a model, as an alterative to a QAIM subclass; but DelegateChooser only supported querying the value based on the model role name. Now a QObject property name can also be used as roleValue. [ChangeLog][QtQuick][Item Views] DelegateChooser now supports using a property name as roleValue when an array of QObject instances is used as the model for a view. Fixes: QTBUG-81580 Change-Id: I3e5b57ce0456520667e342741efbe46417f0843c Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Long live QML inline componentsFabian Kosmale2020-01-2328-5/+343
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtQml] It is now possible to declare new QML components in a QML file via the component keyword. They can be used just as if they were declared in another file, with the only difference that the type name needs to be prefixed with the name of the containing type outside of the file were the inline component has been declared. Notably, inline components are not closures: In the following example, the output would be 42 // MyItem.qml Item { property int i: 33 component IC: Item { Component.onCompleted: console.log(i) } } // user.qml Item { property int i: 42 MyItem.IC {} } Fixes: QTBUG-79382 Change-Id: I6a5ffc43f093a76323f435cfee9bab217781b8f5 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Add Qt.uiLanguage and QJSEngine::uiLanguage propertiesSimon Hausmann2020-01-236-0/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtQml] Added Qt.uiLanguage and QJSEngine::uiLanguage properties These properties mirror the same value in QML and C++ and can be used freely. They also provide API symmetry to Qt for MCUs. QQmlApplicationEngine binds to this property and applies translations accordingly by constructing a QLocale with the value and using QTranslator::load(locale). Change-Id: Id87d6ee64679b07ff3cb47844594e8eeebd8c8b6 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Christian Kamm <mail@ckamm.de>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-236-6/+24
|\| | | | | | | Change-Id: I88e94fe3398a59f10c5a8b142204db5f3ccb2657
| * Blacklist two failing ecmascripttests on macOSMorten Johan Sørvig2020-01-221-0/+4
| | | | | | | | | | | | Task-number: QTBUG-81581 Change-Id: I1c117383776bc498f0c8a6a94322259df79f4e8f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * Blacklist failing quickcanvasitem tests for macOSMorten Johan Sørvig2020-01-221-0/+14
| | | | | | | | | | | | | | | | Failures can be reproduced locally on macOS 10.14, except for the “ci”-marked entries. Change-Id: I927b70f4a143b7741ac0d18588d32bfb637dd14c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * Flatten version-specific blacklisting on macOS to all macOS versionsTor Arne Vestbø2020-01-224-6/+6
| | | | | | | | | | | | | | | | | | | | | | We don't know which versions these blacklistings actually apply on unless we actually get macOS 10.14 and 10.15 into the CI and running tests, so let's start with that, and then granularize the blacklists after that. Task-number: QTBUG-75786 Change-Id: I166f845ae3701b1ff528a0c5bfe5fd23c018483e Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | Upgrade qsb files to version 4Laszlo Agocs2020-01-2117-0/+0
| | | | | | | | | | Change-Id: Ic1a1f5ff49c34d72495bc74083f37db118c935c1 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-203-0/+54
|\| | | | | | | | | | | | | Conflicts: src/quick/items/qquickitemview.cpp Change-Id: Ib9faebdbef5eebb80f4e6aeb5b15b5df7494b157
| * Blacklist tst_TouchMouse::touchButtonOnFlickable() on mingwUlf Hermann2020-01-151-0/+4
| | | | | | | | | | | | | | Task-number: QTBUG-74517 Change-Id: I9733fe53f65d107c830b2fe47a475b2159a70540 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * QQuickItemView: fix crash when changing modelWang Chuan2020-01-152-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When visible items become invisible, ListView will try to cache them and redisplay these items if necessary. However, we can't cache items when changing to a new model, since the old one will be deleted later Fix by adding a flag to let ListView know we are clearing items and prevent cache unnecessary items Fixes: QTBUG-80203 Change-Id: I50dcd3f0586c93496b143bdad0e59751360501a8 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* | Don't use deprecated QMatrix class anymoreJarek Kobus2020-01-175-8/+6
| | | | | | | | | | | | Task-number: QTBUG-46653 Change-Id: I3570c84014788b7b66d9cb54b77f9964ae15af6d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>