aboutsummaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Move qmllint's metatype support to tools/sharedUlf Hermann2020-04-011-1/+1
| | | | | | | | | We want to read qmltypes files and analyze scopes also from other tools. Furthermore, restructure the shared directory, so that each tool only includes what it needs. Change-Id: I96a2dcc8b1c5fac613592fb1867bf51fa5ef3a6e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Warn if too many parameters are passed to a C++ functionMaximilian Goldstein2020-04-011-0/+4
| | | | | Change-Id: I8ddf55d48d9276be5880e89e7b854f3355891f8e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Add support for binding directly to QProperty instancesSimon Hausmann2020-03-304-0/+35
| | | | | | | | | | Avoid going through externally managed bindings and instead allocate a more lightweight property binding. It's basically a QQmlJavaScriptExpression and one pointer plus the overhead of QPropertyBindingPrivate. Change-Id: I1530330926d351b61f2b3bbad39301c628a8bef1 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Remove usage of filterRegExpLars Knoll2020-03-261-1/+1
| | | | | | | | It's going away together with other QRegExp based apis. Change-Id: I7363f5c3c944d5a56fefbfda628e9178847ae2da Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-246-151/+379
|\ | | | | | | Change-Id: I9f0d5adf1ba7d3246b1107a20d145e7aac2c7a77
| * Add autotest for QQuickRenderControlLaszlo Agocs2020-03-234-1/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's celebrate the feature's 6 year anniversary with introducing an autotest for it. Also happens to be good sample code for generating image sequences from animated Quick scenes driven by a custom animation driver. Tied to (direct) OpenGL at the moment. The RHIified version will appear eventually as the work for introducing RHI support in QQuickRenderControl progresses. Task-number: QTBUG-78595 Change-Id: I7294ce986dca9968407ae738afe7ed2640ecd103 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
| * QQuickViewTestUtil: Don't leak on matchAgainst()Ulf Hermann2020-03-231-2/+16
| | | | | | | | | | | | | | | | QTest::toString() returns a bare pointer to a heap-allocated character array. We need to delete it. Change-Id: I5a5cf1054e582af21e784595c00646d5b4fc0b7f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * tst_qquicklistview: Fix a few memory leaksUlf Hermann2020-03-231-123/+75
| | | | | | | | | | Change-Id: I8bcd06ce79e1d6795a8249df6f72d4b583dbfa28 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
| * tst_qquicklistview: Don't use QTest::toString()Ulf Hermann2020-03-201-25/+25
| | | | | | | | | | | | | | | | | | | | | | This construction leaks the resulting character array. You need to actually delete[] it. However, we can be pretty sure that there are no questionable characters in those strings. Therefore we can just use qPrintable instead. Change-Id: Ib863f0ed7db800680a44df534e3b46a4ba807798 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | StackLayout: add attached index, isCurrentItem, and layout propertiesMitch Curtis2020-03-231-3/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These properties are useful for items within StackLayout to get access to their index within it, especially when those items are declared in their own QML files. Similar API already exists for e.g. ListView and SwipeView. [ChangeLog][StackLayout] Added attached index, isCurrentItem, and layout properties. Change-Id: I648d4434ab21573b56edd9a0f8399463946fd571 Fixes: QTBUG-76999 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | Encapsulate QQmlContextDataUlf Hermann2020-03-239-65/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This class is not a private detail of QQmlContext. And it is incredibly hard to see who owns what in there. Let's add some civilization ... We enforce refcounting for QQmlContextData across the code base, with two exceptions: 1. QQmlContextPrivate may or may not own its QQmlContextData. 2. We may request a QQmlContextData owned by its parent QQmlContextData. For these two cases we keep flags in QQmlContextData and when the respective field (m_parent or m_publicContext) is reset, we release() once. Furthermore, QQmlContextData and QQmlGuardedContextData are moved to their own files, in order to de-spaghettify qqmlcontext_p.h and qqmlcontext.cpp. When the QQmlEngine is deleted, any QQmlComponents drop their object creators now, in order to release any context data held by those. Before, the context data would be deleted, but the object creators would retain the dangling pointer. [ChangeLog][QML][Important Behavior Changes] QQmlContext::baseUrl() does what the documentation says now: It prefers explicitly set baseUrls over compilation unit URLs. Only if no baseUrl is set, the CU's URL is returned. It used to prefer the CU's URL. Change-Id: Ieeb5dcb07b45d891526191321386d5443b8f5738 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | tst_qqmlpreview: Increase timeoutUlf Hermann2020-03-231-1/+1
| | | | | | | | | | | | | | | | macOS does some interesting scheduling and takes up to 20s to generate those 10 frames. We're generous and allow for 30s. Change-Id: I1e2e8b5282f8e46cdf01e3501c83924d853c67a4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-2017-39/+49
|\| | | | | | | Change-Id: I6f320ea43b5837444226228c118e57c4bda8702a
| * qmllint: Break inheritance cyclesUlf Hermann2020-03-194-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | Previously we would run into infinite loops on those. Mind that qmllint will reject a file called Window.qml that imports QtQuick.Window and then instantiates a Window {}. Such a thing is bad style. Task-number: QTBUG-82817 Change-Id: I6db82ca1794c3020dcb7d7e837fe44f72bca5029 Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * Fix copy-pasted typo minimimal -> minimalAllan Sandfeld Jensen2020-03-1813-39/+39
| | | | | | | | | | Change-Id: I4afef3fdbb9e3c3ec20ba5d00307992131b9ba3e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | QQmlPropertyCache: Avoid costly string comparisonFabian Kosmale2020-03-181-13/+5
| | | | | | | | | | | | | | | | The qqmlecmacsript required changes, because the call to id makes the type now known to the QML engine. Change-Id: I73aed804ae8769c71676b44d8450e1dabf5baa6d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.15' into dev"Qt Forward Merge Bot2020-03-1810-0/+85
|\ \
| * | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-1810-0/+85
| |\| | | | | | | | | | | | | | | | | | | Conflicts: tools/qmllint/findunqualified.cpp Change-Id: I2593b5cc0db1d14e0c944aec4b88a80f46f5b0c1
| | * qmllint: Check for unknown types in JavaScript accessUlf Hermann2020-03-173-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | There are many incomplete qmltypes files around. We should not just crash on those. Task-number: QTBUG-82817 Change-Id: Ie072b80473927570c80fb2f9ae329de711c35904 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| | * qmllint: Don't crash on IDs that aren't scopesUlf Hermann2020-03-172-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | In particular, those can be qualifiers for imports, in which case we have to combine them with the next segment in order to find the type. Task-number: QTBUG-82817 Change-Id: I217a79572cd1e160dcbbcb9541c53941c81ab76c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| | * qmllint: Use fully qualified QML type names as superClassUlf Hermann2020-03-163-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | Otherwise we miss subtleties such as Label vs. T.Label. Task-number: QTBUG-82817 Change-Id: Idc2131426b2fd96f279dab83292a348b9295d5c0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| | * qmllint: Add QFont to the list of unknown builtinsUlf Hermann2020-03-162-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | And also check them when analyzing JavaScript access. Task-number: QTBUG-82817 Change-Id: I677e7883fb24ab80ff20d1998e2d7df440ef4112 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| | * Inline components: Abort if two IC's with same name existFabian Kosmale2020-03-162-0/+20
| | | | | | | | | | | | | | | Change-Id: Ic52fa388711a76d729ae28678932f4a150da9583 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * Prefer Inline Components over any other imported nameFabian Kosmale2020-03-162-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After processing all other imports, there might be other imports both in front and behind of the inline component imports in the import list. To avoid having to search for them, we sort the list so that they are in front. Fixes: QTBUG-82302 Change-Id: I9f6deb03608b1ebd0cbe0eddd1a1e5d39837a783 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Store a QV4::ReturnedValue in QJSValueUlf Hermann2020-03-184-24/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Being careful, we can now save primitive values inline. We use the heap pointer of QV4::Value as either QString* or QV4::Value* for complex types. We cannot store persistent managed QV4::Value without the double indirection as those need to be allocated in a special place. The generic QVariant case is not supported anymore. The only place where it was actually needed were the stream operators for QJSValue. Those were fundamentally broken: * A managed QJSValue saved and loaded from a stream was converted to a QVariant-type QJSValue * QVariant-type QJSValues were not callable, could not be objects or arrays, or any of the special types. * Cyclic references were forcibly broken when saving to a data stream. In general the support for saving and loading of managed types to/from a data stream was so abysmally bad that we don't lose much by dropping it. [ChangeLog][QML][Important Behavior Changes] When saving a QJSValue to a QDataStream only primitive values or strings will be retained. Support for objects and arrays was incomplete and unreliable already before. It cannot work correctly as we don't necessarily have a JavaScript heap when loading a QJSValue from a stream. Therefore, we don't have a proper place to keep any managed values. Using QVariant to keep them instead is a bad idea because QVariant cannot represent everything a QJSValue can contain. Fixes: QTBUG-75174 Change-Id: I75697670639bca8d4b1668763d7020c4cf871bda Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | | Remove QRegExpValidator usagesLars Knoll2020-03-189-24/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also means the RegExpValidator QML type will be gone. Use QRegularExpressionValidator instead. [ChangeLog][QtQuick][RegExpValidator] The RegExpValidator QML type has been removed. Use RegularExpressionValidator instead. Change-Id: If25fc5a258a669dfd28e705271757caa252ce05c Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | | Also support partly specified versions in JS .importsUlf Hermann2020-03-182-17/+8
|/ / | | | | | | | | | | Task-number: QTBUG-71278 Change-Id: Ie3167d44780a192b5010052eea5192eee8c21c32 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Allow multiple URL interceptors per engineUlf Hermann2020-03-174-4/+4
| | | | | | | | | | | | | | | | | | | | | | We may want to have, for example, a QQmlFileSelector and a component-specific interceptor that chooses a theme or similar. Also, make the API public. We want to propose this as alternative to dynamically registering QML files via qmlRegisterType(QUrl, ...). Change-Id: I4a535d3ea556da6710fde816579ec188b3f57099 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | Allow partial and absent version specifiers in import statementsUlf Hermann2020-03-173-15/+68
| | | | | | | | | | | | | | | | | | | | An import statement without version specifier imports the latest version available, one with only a major version imports the latest minor version from that major version. Task-number: QTBUG-71278 Change-Id: I43907ae4e1052be533039d545de5391c41d38307 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* | CMake: Update Apple platform defines after rename in qtbaseTor Arne Vestbø2020-03-17167-334/+334
| | | | | | | | | | Change-Id: Ia0a075e3199eab735f9b289873beeb8730ebc47e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Introduce new mechanism to manage palette functionality in QMLVitaly Fanaskov2020-03-1613-5/+671
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Main goals of these changes: 1) Add an ability to work with disabled and inactive palettes from QML 2) Eliminate massive code duplication in qtquickcontrols2 module 3) Provide easily extensible architecture for this piece of functionality Architectural part. Palette It was decided to not change existing QPalette, but add thin wrappers around it to provide all required functionality. These wrappers are highly coupled with QPalette class because of using some enum values from it. There are two new classes QQuickPalette and QQuickColorGroup. QQuickPalette class inherits QQuickColorGroup class and represents Active/All color group. QQuickPalette also provides an access to three color groups: Active, Inactive, and Disabled. In order to access colors the special class QQuickPaletteColorProvider is used. This is a wrapper around QPalette that provides some convenience functions. Interface The private property "palette" should be exposed. Implementation All private parts of classes that implement QQuickAbstractPaletteProvider have to inherit QQuickPaletteProviderPrivateBase class. This template class implement all functionality: create palette, resolve dependencies, connect objects etc. This is important to mention that related data is lazily allocatable on demand only. Hence, there is no memory overhead for regular items. Change-Id: I911424b730451b1ad47f68fd8007953b66eddb28 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | CMake: Fix painting benchmark dependency on OpenGLWidgetsAlexandru Croitor2020-03-164-3/+9
| | | | | | | | | | | | Change-Id: Ic7ed89c51e9a3cabda60ec99702b3aacd2cf5e97 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | CMake: Fix duplicate target name for qquickwindow benchmarkAlexandru Croitor2020-03-162-1/+29
| | | | | | | | | | | | Change-Id: I517d52e1ac35ae5d27d3e9ed676ebebdfe980db5 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | tst_qquickwindow::testWindowVisibilityOrder: remove unstable checkVitaly Fanaskov2020-03-131-9/+3
| | | | | | | | | | | | | | | | | | | | The problem here is that it's not possible to guarantee that a certain window has focus in this scenario. Furthermore, this test is not about focus at all. Task-number: QTBUG-62604 Change-Id: I941446d67b41571f59bcf10cbabfba1895bf2fca Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | CMake: Regenerate and adapt to merge from devwip/cmakeAlexandru Croitor2020-03-1222-62/+313
| | | | | | | | | | | | Change-Id: If8daa6152a563d4309d7342414780ef75b9f5589 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* | Merge remote-tracking branch 'origin/dev' into wip/cmakeAlexandru Croitor2020-03-12153-427/+5248
|\ \ | | | | | | | | | | | | | | | | | | | | | Conflicts: dependencies.yaml src/qml/qml/qqmlengine.cpp Change-Id: I6a73fd1064286f4a2232de85c2ce7f80452d4641
| * | tst_qsequentialanimationgroupjob: Protect against erratic schedulingUlf Hermann2020-03-101-6/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the scheduling stalled the animation for more than 50ms at the wrong time, the test would fail. The same effect can be observed by manually delaying the execution using a break point. Change-Id: I4c8d999469b2586e9a5619be1573ec7eb0604013 Fixes: QTBUG-82782 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | Stabilize tst_QPauseAnimationJob::multipleSequentialGroups()Ulf Hermann2020-03-102-18/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently macos also has bad timer resolution these days. It only manifests in one specific place, though. Fixes: QTBUG-81938 Change-Id: Ibe024cf491760cff38944b0e97026c895938ae0a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * | painting benchmark: adapt to openglwidgets splitFabian Kosmale2020-03-091-1/+1
| | | | | | | | | | | | | | | Change-Id: I603635dfaaa455a5a66d7a791a36008f9fb9b770 Reviewed-by: Johan Helsing <johanhelsing@gmail.com>
| * | Remove parts of sequence type testFabian Kosmale2020-03-091-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The tests makes assumptions which simply don't hold anymore, now that QProperty does automatic type registration, and the engine supports magic conversions via QSequentialIterable. Change-Id: I33e8eeca95757686e59da9db5ef5d92041364335 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | Adapt to the the new QMetaType changeOlivier Goffart2020-03-092-27/+27
| | | | | | | | | | | | | | | | | | Fixes: QTBUG-82453 Change-Id: I7e5682945a07c3af183becd3947a69568f139d16 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * | Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-03-0916-22/+147
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qml/compiler/qqmlirbuilder_p.h src/qml/qml/qqmlpropertycachecreator_p.h src/qmltyperegistrar/qmltypesclassdescription.cpp src/qmltyperegistrar/qmltypesclassdescription.h src/qmltyperegistrar/qmltypescreator.cpp src/quick/items/qquicktext_p.h src/quick/util/qquickvaluetypes_p.h Change-Id: Ic209741592e7b85820bf3845722023a190ebc1c5
| | * Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-03-033-3/+27
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/qmlmodels/qqmltableinstancemodel.cpp src/qmlmodels/qqmltableinstancemodel_p.h Change-Id: I89339b1cb41ba27fe30c79530859a1c2bfbecc69
| | | * QQuickItem: prevent endless loop in focus tab chainWang Chuan2020-03-032-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the commit a18ab2a3822e0d, we promote the [startItem] in focus tab chain when it is invisible to prevent endless loop. However the problem still happen if the [startItem] is equal to [firstFromItem] Fixes it by compare the [current] item with the original start item Fixes: QTBUG-81510 Change-Id: Iae0207f39e2b8c4fc6ed0cf36f0a855668accfba Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| | | * Escape url.toString() before passing it to QRegularExpressionDmitry Shachnev2020-02-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise the test fails when path contains special characters like ‘+’. Change-Id: I461d9755436148ce979284be31ef8d204235c8a4 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * | Use Qt::SplitBehavior in preference to QString::SplitBehaviorEdward Welbourne2020-03-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Qt version was added in 5.14 "for use as eventual replacement for QString::SplitBehavior." Move another step cloaser to that goal. Change-Id: I3214ad6ccaca9dfd4a026589cabeb40cbf4a6298 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * | Restore offset/length in QQmlJS::DiagnosticMessageSimon Hausmann2020-03-023-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed in a few places outside of declarative, so this change restores the loc member in DiagnosticMessage and moves QQmlJS::AST::SourceLocation into common's QQmlJS namespace/directory. QQmlError is unaffected and retains only line/column. Amends d4d197d06279f9257647628f7e1ccc9ec763a6bb Change-Id: Ifb9d344228e3c6e9e26fc4fe112686f9336ea2b2 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| | * | Robustify QQuickListView testUlf Hermann2020-02-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We should check for the window's root item before accessing it. Change-Id: I196d9cb4d0e525ffb62b3fd347fd986033cab3dd Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| | * | Revision properties and methods added in 5.15Ulf Hermann2020-02-271-0/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I00e3f9535e819d9d0d547c9d3cf50be469cf9339 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| | * | Propagate the LanguageChange events from the QQuickWindow to the itemsAndy Shaw2020-02-252-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: QTBUG-78141 Task-number: QTBUG-82020 Change-Id: Id47f8efe77cd3f6bfd330c8759059e19de5a86d2 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>