aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
Commit message (Collapse)AuthorAgeFilesLines
...
| * | QML TypeLoader: Sort composite singletons before recursing into themUlf Hermann2018-11-209-0/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When recursingly loading further types for composite singletons before sorting them, the order in which the recursively referenced types are loaded is random because the composite singletons are kept in an (unordered) hash. Any sorting after loading the child components doesn't help as the recursive references may depend on the types already loaded at that point. Sorting the composite singletons before starting the recursion does help because it eliminates the source of randomness in the system. Fixes: QTBUG-66976 Change-Id: I0fa1f50b36eba8c73eb8d56b4d5118485ab05f35 Reviewed-by: Michael Brasser <michael.brasser@live.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | LocalStorage: Return new version of DB from changeVersion()Ulf Hermann2018-11-222-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is probably what you want if you change the version of the database. Without this, you need to reopen the connection, which makes the code ugly. Fixes: QTBUG-71838 Change-Id: I6f1e118ba8e102d1043c4658d036c144bbde7229 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | | Qml Tooling: Avoid some clang-tidy warnings in QQmlProfilerService testUlf Hermann2018-11-221-9/+10
| | | | | | | | | | | | | | | Change-Id: Ia05bcc7dcf1efce3b6c51ca652b28e3360eb41d8 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-204-1/+85
|\| | | | | | | | | | | Change-Id: I57de61b259423a8351ad146a2ff42488ba11d607
| * | JS: Check pattern target to be an lvalueErik Verbruggen2018-11-191-0/+1
| | | | | | | | | | | | | | | Change-Id: If9468b93b08ad355f07d1436ca88e8d36be22070 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | JS: Handle check for dangling jump gracefullyErik Verbruggen2018-11-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The destructor for the Jump object will check if it is linked somewhere. So when doing an early-exit after generating a jump (and before linking it) and after an error occurred, make sure to call link anyway. At this point no code will be generated, so where the jump points to is kinda pointless. Change-Id: I09fa03d4224805a838088acd0c5c83d02b328045 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | QML: Use all available type information to find enum typesUlf Hermann2018-11-193-1/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the metatype system we can identify most enumeration types statically, without lookup by name. Only if we get UnknownType we have to do a name based lookup. As the name based lookup only checks enums that either belong to the global Qt namespace or the surrounding class, the type based lookup gives better results. Task-number: QTBUG-58454 Change-Id: Id6bd748f37838249defb4c5b2a7628eadc1a8341 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-174-4/+33
|\| | | | | | | | | | | Change-Id: Ic5a0c02ab45aac18c218dbeb8cd4b4cd3b609eb6
| * | Properly mark variables as unresolved when accessed from evalLars Knoll2018-11-161-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | If we can't resolve the variable and are executing eval code, we need to look it up by name, and not generate a lookup in the global object. Change-Id: I693b3b714651911f72620160bfc463d6dbb00820 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | Merge remote-tracking branch 'origin/5.12.0' into 5.12Qt Forward Merge Bot2018-11-163-3/+33
| |\| | | | | | | | | | Change-Id: I7623438dde316ae1e97802f91991f2e7ccc205a5
| | * Stop codegen after errorErik Verbruggen2018-11-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We won't use the bytecode anyway, and it prevents consistency checks that come after the error from failing. Specifically: there might be jumps that have no label defined. Fixes: QTBUG-71738 Change-Id: I62a7e943b0156d42caccfa40507853de79e3b1ce Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| | * Fix translation bindings when qtquickcompiler is usedFrederik Gladhorn2018-11-061-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that the context information is lost when using the compiler. The unit->unitData()->sourceFileIndex is wrong (always 0), which should probably be fixed. This change only works around that by using unit->fileName(); instead. Make sure that the test actually verifies translations happen and have a context. Done-with: Jan Arve Sæther Fixes: QTBUG-71553 Change-Id: Ib5926bd4b9a6267644f5c9328a84c23d61ca5466 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Expose let/const variables from imported JS scriptsJüri Valdmann2018-11-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows QML to access let/const variables defined in JS files. Detailed changes: - The recently added ContextType::ScriptImportedByQML is changed to avoid creating Push/PopScriptContext instructions, similar to ContextType::ESModule. - QV4::Module is changed to also work with CompilationUnits which are not ESModules. In this case QV4::Module will behave as if all lexically scoped variables were exported. - CompilationUnit is changed to support instantiating and evaluating QV4::Modules for non-ESModules as well. - QQmlTypeLoader is changed to always create QV4::Modules for evaluating scripts. For the non-ESModule case, the QV4::Module is evaluated inside a QV4::QmlContext, as before. - A pointer to the QV4::Module is added to QV4::QQmlContextWrapper, and used in virtualGet to access the let/const variables in the CallContext. Access is read-only. Fixes: QTBUG-69408 Change-Id: I6f299363fdf5e1c5a4a0f1d9e655b4dc5112dd00 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| | * Fix a crash when allocating huge memory segmentsLars Knoll2018-11-021-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When allocating a huge item that requires it's own memory segment, we were actually not committing enough memory from the OS. Fixes: QTBUG-71501 Change-Id: Ic86a648bba4d7f1eeeded78d8de0f0fc1d3a251d Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-161-2/+8
|\| | | | | | | | | | | Change-Id: I34aa0c2eb178862b40e63b62c6daa056e5e204c6
| * | Qml Tooling: Test that trace events arrive in chronological orderUlf Hermann2018-11-151-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | The QML profiler trace client should resolve any deviations from chronological order. Trace receivers should not need to deal with this. Change-Id: I9bbb387bbb5c0b7da9f2b508d228665af9f27d4c Reviewed-by: Michael Brasser <michael.brasser@live.com>
| * | Qml Tooling: Fix crash in QQmlProfilerService testUlf Hermann2018-11-151-2/+2
| | | | | | | | | | | | | | | | | | | | | The event counting for failure diagnostics had an off-by-one error. Change-Id: I7f652680a4d154a0624dbfd51af0b026f89cc7ad Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-153-1/+32
|\| | | | | | | | | | | Change-Id: Ie82b8a0f9158ef02bf11209b16e574dedf201e2e
| * | QML Tooling: Fix ordering of memory events in V4 profiler adapterUlf Hermann2018-11-143-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We should not send memory events that are chronologically after the next call event, even if the time threshold given by the profiler service would allow us to do so. When the remaining call events are sent, the chronological order would otherwise be violated. Fixes: QTBUG-71515 Change-Id: Iee27304f836a899b2b35133316cecd3d34f128c6 Reviewed-by: Michael Brasser <michael.brasser@live.com>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-092-10/+3
|\| | | | | | | | | | | Change-Id: I2ed93c9d5fa8ec9b075112618a2535535591a0e8
| * | Create proper template objects for tagged templatesLars Knoll2018-11-051-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | If a tagged template gets evaluated multiple times, the underlying template object is shared. Change-Id: Ie2f476fbc93d5991322ce1087c42719a8d8333ae Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | Correctly read files with a \0 in themLars Knoll2018-11-052-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | At least one test case uses this, so let's make sure we read them correctly. Change-Id: I9f4ea7785b5a400cd6f0b210a6a98975bbbaf7ce Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Use custom debug stream operator in console.logMårten Nordheim2018-11-084-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fallback for string-conversion was previously using hard-coded string template mimicing QVariant. Just use QVariant's debug stream operator which may include data from the contained type. Change-Id: I8243ba6b04d842a895ac3234bb54f6a4eed849f1 Fixes: QTBUG-60057 Done-With: Jędrzej Nowacki <jedrzej.nowacki@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-065-20/+76
|\| | | | | | | | | | | Change-Id: I85be5e6ef173fa733d7febd3209164bb31762e0d
| * | Create proper template objectsLars Knoll2018-11-021-16/+0
| |/ | | | | | | | | | | | | | | | | Create the proper template object for a tagged template. This fixes quite a few use cases (esp. String.raw), but is not yet 100% spec compliant. Change-Id: I69eaee22c384c0d1bd2c6c56ad711d29521b0b86 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Fix issues with lookup of scoped enums on SingletonsMichael Brasser2018-10-313-1/+16
| | | | | | | | | | Change-Id: Id6cd0b7c571b38db30bded030f6927c9b5fbdb96 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Add convenience functions for creating and inspecting error objectsAllan Sandfeld Jensen2018-10-301-3/+60
| | | | | | | | | | | | | | | | | | Serves to simplify porting from QtScript by replacing QScriptContext::Error and QScriptContext::throwError(). Change-Id: I4bfe404c358c50aaf3b5469a4304fec97552bf24 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * Merge remote-tracking branch 'origin/5.11' into 5.12.0Liang Qi2018-10-301-4/+30
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/imports/settings/qqmlsettings.cpp src/quick/items/qquickwindow.cpp tools/qmlplugindump/main.cpp Change-Id: I3e5dae4de25b2da961a572b3a4bd151181d211c9
* | \ Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-11-013-4/+79
|\ \ \ | | | | | | | | | | | | Change-Id: I7a2b9bdb69512b2d52050d829b1b65f4fcd9d99d
| * \ \ Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-10-291-4/+30
| |\ \ \ | | |/ / | |/| / | | |/ | | | | | | | | | | | | | | | Conflicts: src/imports/settings/qqmlsettings.cpp src/quick/items/qquickwindow.cpp tools/qmlplugindump/main.cpp Change-Id: I96fedbc773a110374baed79a0b7de92d65df0ed6
| | * Qt Labs Settings: warn if failed to initialize internal QSettings instanceMitch Curtis2018-10-111-4/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, warn the user that the QSettings instance failed to initialize if there was an error. Then, if the error was QSettings::AccessError, print the specific application identifiers that weren't set so they know what they have to do. For example: QML Settings: Failed to initialize QSettings instance. Status code is: 1 QML Settings: The following application identifiers have not been set: QVector("organizationName", "organizationDomain") In my case, the QSettings instance wasn't created on Windows because organizationName wasn't set. Change-Id: I7970209e09b78f785730422c45978775311b96ac Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
| * | Hold internal reference to incubator object while incubatingMichael Brasser2018-10-262-0/+49
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-53111 Change-Id: Ifaef6a855914d79155f8028b0de7ccca3c9a00f5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | QmlDebug: Add QQmlInspectorClientUlf Hermann2018-10-247-190/+2
| | | | | | | | | | | | | | | | | | | | | | | | We use it in 2 tests and we might use it elsewhere, too. Task-number: QTBUG-66504 Change-Id: I57e52e70044ac857482ecfe863f0d30698ab2e60 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | QmlDebug: Add QQmlEngineDebugClientUlf Hermann2018-10-249-841/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | We use it in 3 tests already, and we may want to use it in other applications, too. Task-number: QTBUG-66504 Change-Id: Id73b6ccf49a701fbbc79ee3fe1ac638a70c4c939 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-10-2411-1/+148
|\| | | | | | | | | | | Change-Id: Ic67fa1536977310b15ba55ee2220536aacef2b3c
| * | Fix erroneous enum conflict warningsSimon Hausmann2018-10-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Permit enums from sub-classes to overwrite enums from super-classes, but keep warnings about clashes within a class, provided that the values differ. The last condition relates to the declaration of enums and a subsequent declaration of Q_FLAGS, which appear to have the same keys and values in the meta-object system. Task-number: QTBUG-71184 Change-Id: I2a00dc90e3714fc4c6fe8add5a6268b88bb9e745 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
| * | Fix lookup of methods in the scope objectSimon Hausmann2018-10-222-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 939014cb9cad2f3357f47b28a4580397c17b913c improved performance of property lookups beyond the scope object, with the unfortunate side-effect that the previously polymorphic lookup of methods broke. Fix this by moving the handling to the caller side and falling back to the string lookup for functions. Fixes: QTBUG-71204 Change-Id: I2d9924034a9c14e7d161fa49d51b1f876ab5bc0f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Add test for importing let/const variables from scriptsJüri Valdmann2018-10-228-0/+120
| | | | | | | | | | | | | | | | | | | | | | | | Try to import let/const variables from JS scripts into QML. Task-number: QTBUG-69408 Change-Id: Ie58cbc8cd9f8a47f5a077f95b07b5f9e1524707a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | QmlDebug: Add V4 debug client from tst_qqmldebugjs.cppUlf Hermann2018-10-232-784/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is useful for implementing additional V4 debug clients. Along the way, we also drop the dependency on QML by using the JSON API from QtCore for JSON manipulation. Task-number: QTBUG-66504 Change-Id: Ib51e8e97b030a49fe8185ad5354d1cca63efef4a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-10-204-7/+39
|\| | | | | | | | | | | Change-Id: I939b8ddc8b24e9c9853a72eb22da317023c7a2c4
| * | Add sortCaseSensitive property so the sorting can ignore the caseAndy Shaw2018-10-193-7/+38
| | | | | | | | | | | | | | | | | | | | | Change-Id: Id308272cc59eca8c95f1386db8cd64f266124579 Fixes: QTBUG-48757 Fixes: QTBUG-70212 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
| * | JS: Fix stack buffer overflow in the QML/JS parserLars Knoll2018-10-181-0/+1
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-71083 Change-Id: I7a06a01871c2ae0b3162699189c4e836c36d7759 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-10-162-0/+72
|\| | | | | | | | | | | Change-Id: I46dde4965e7718eab99306e2876622589cef487f
| * | JS: Check if the rhs of an assignment had errors before using itErik Verbruggen2018-10-151-0/+1
| | | | | | | | | | | | | | | Change-Id: I34d70759732433b6f0ecccc5ae175d33ec8e1577 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | JS: Check lhs of an 'in' expression to be an lvalueErik Verbruggen2018-10-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | For example: 'for (foo() in something) {}' is not valid: a call expression is not an lvalue. Task-number: QTBUG-71086 Change-Id: Ia1498cd38526b073afb8e4524ceaea14dca3d65f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | Fix translation contexts for paths with drive letters on WindowsErik Verbruggen2018-10-151-0/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inside method_qtTr, the filename is assumed to be a (correct) URL. When a (normalized) path with a windows drive letter is passed to QJSEngine::evaluate, the URL will have a scheme that is the drive letter. We cannot correct this in method_qtTr, because at that point we might get in files that do not come from the file system, but through actual URLs. The place where we know for sure that the filename is a real file name and not a URL, is in QJSEngine::evaluate. So at that point, make sure that the filename is a valid URL. Task-number: QTBUG-70425 Change-Id: Ia41859c4024ac46e6f8c3d96057a5dffdecd8f56 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * | Abort parsing on errorLars Knoll2018-10-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The visit() methods need to return false on parse errors, so that we don't continue iterating into that subtree of the AST, but rather exit as quickly as possible. Task-number: QTBUG-71090 Change-Id: I1912d955a0ffc86389a4cbbb3b6ac0209c3c556a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2018-10-135-1/+23
|\| | | | | | | | | | | Change-Id: I4376d0b2dd983ff3eeb2e08346d282b81f495f46
| * | JS: Check expressions inside template literals for validityErik Verbruggen2018-10-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | And not use (a possibly invalid result) blindly, because this will cause assertion failures down the line. Task-number: QTBUG-71081 Change-Id: Id10149c55026094a355bd747f66014119c0e24f5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
| * | Fix error reporting when imports or re-exports in modules failSimon Hausmann2018-10-114-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | Collect the location of the import/export statement and include it in the exception thrown. Change-Id: I7966dfd53ed67d2d7087acde2dd8ff67c64cb044 Reviewed-by: Lars Knoll <lars.knoll@qt.io>