aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml
Commit message (Collapse)AuthorAgeFilesLines
* qmllint: Warn about duplicate inline componentsOlivier De Cannière4 days1-0/+6
| | | | | | | Fixes: QTBUG-126715 Task-number: QTBUG-129307 Change-Id: I739587bf6d44131d9a0bdcec4df60ab3f53e1a12 Reviewed-by: Sami Shalayel <[email protected]>
* tst_qmllint: Clean up sorted functionsOlivier De Cannière4 days1-525/+358
| | | | | | | | | | | | | | | Since we recently sorted some data test functions and the git history already is compromised, we can take the opportunity to clean those up. This unifies the style of all test entries and removes a lot of boilerplate. This should make the tests easier to read and navigate. There were 517 tests executed by qmllint both before and after this change. Pick-to: 6.9 6.8 6.5 Change-Id: Ie394c5b6e967377903da0138ac7ee37ec9dc6765 Reviewed-by: Sami Shalayel <[email protected]>
* tst_qmllint: Sort data test row entries for common test functionsOlivier De Cannière4 days1-943/+900
| | | | | | | | | | | | | | | | | | | | | Merge conflicts are slowing us down quite a bit when working on qmllint. Sorting data-test entries by tag name will reduce their number significantly. The modified functions are: cleanQmlCode_data dirtyQmlCode_data dirtyQmlSnippet_data cleanQmlSnippet_data dirtyJsSnippet_data cleanJsSnippet_data There were 517 tests executed by qmllint both before and after this change. Pick-to: 6.9 6.8 6.5 Change-Id: I0bb9ef9d7e5ff7cb900891c06336b5403b2250e6 Reviewed-by: Semih Yavuz <[email protected]>
* Compiler: Replace non-ascii character from sourceOlivier De Cannière4 days1-1/+1
| | | | | | | | Amends db0913a323c28c93c362a9b128f62d00bb83355f Pick-to: 6.9 6.8 6.5 Change-Id: I7230644465832c9de1b8343b01948a606a15012d Reviewed-by: Sami Shalayel <[email protected]>
* tst_qmllint: Remove unused left-over variablesOlivier De Cannière4 days1-5/+0
| | | | | | | | Amends 8848fba018a25cc868a8cefad244e62b4c24f3fd Pick-to: 6.9 6.8 6.5 Change-Id: I1b8d907ab20abcfb78c52ac28d20cc953bab2a25 Reviewed-by: Sami Shalayel <[email protected]>
* qmltyperegistrar: Do not filter members by revision for qmltypesUlf Hermann5 days3-5/+8
| | | | | | | | | | | | | | | | | | We need information about all members in the qmltypes file, even if the revisions are nonsensical. This is because we need to get the method indices right when trying to call methods. We don't want to actually register the extra versions, but the code handling registration is different from the code producing qmltypes already. Amends commit c0f4442ae0d83e63fc90f1d5058081355f83b701 Pick-to: 6.9 Fixes: QTBUG-136248 Change-Id: Ibd41fcd3a3d7b9d79e1d1715746dd90702ade518 Reviewed-by: Sami Shalayel <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* QQmlComponent::loadFromModule: Fix crash with dynamic metaobjectsFabian Kosmale10 days1-0/+49
| | | | | | | | | | | | | | | If an object has a dynamic meta-object (e.g. because it has been extended with additional enums), we can no longer create a property cache. This could have caused a null-poninter dereference; avoid this by checking for nullptr. We currently don't do any checks at all in that case; finding a better solution is tracked in QTBUG-136560. Pick-to: 6.9 6.8 Change-Id: I678cf9908d5bbec50e133a462f7f4c813dca44dd Reviewed-by: Ulf Hermann <[email protected]>
* Fix QmltcTests compilation when tableview or gridview is disabledJuha Vuolle10 days3-2/+22
| | | | | | | | | | | | | | Put two of the QML files behind appropriate feature flags (they use TableView and GridView). Similarly guard the cpp side includes and access to the genrated QML type. As a drive-by add include guard when qml-table-model is disabled. Task-number: QTBUG-136101 Pick-to: 6.9 6.8 Change-Id: Ic643ccb3f8346fc650afe5d863b575e8cec2f57a Reviewed-by: Sami Shalayel <[email protected]> Reviewed-by: Oliver Eftevaag <[email protected]>
* Compiler: Deduplicate conversion origins based on register's contentOlivier De Cannière10 days3-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the type propagator, when encountering back jumps, we need to run the pass again in order to ensure that the state of the registers at the target of the jump is fully known. For this, we need to compare the latest state in the current pass with states we have encountered earlier. If a match is found, no more passes are needed. The propagation is run multiple times and state is accumulated between passes. For certain conversions, this will try to append types as origins again every iteration. These would previously have been deduplicated by QQmlJSTypeResolver::merge but, since the change at 1e095058e165b1c2f244799ca1928ae4cc046a2c, we consider 2 registers to be equal only if their d pointers are equal. And since instructions such as MoveRegexp create a new register for the literal type RegExpr every time, the pointer doesn't match with the one from the register created by the instruction during the ealier pass. This would lead to set of origin types growing forever and to the state never matching a previous one. This, in turn, caused an infinite loop because an additional pass was always deemed necessary. Therefore, restore the old logic that deduplicates based on contained type, variant, and (recursively) scope. Amends 1e095058e165b1c2f244799ca1928ae4cc046a2c Fixes: QTBUG-135457 Pick-to: 6.9 Change-Id: I23167e95b958304698d12537598c1d72b03a5364 Reviewed-by: Ulf Hermann <[email protected]> Reviewed-by: Olivier De Cannière <[email protected]>
* Remove TestUtils.js from qqmltablemodel testsMate Barany11 days2-22/+0
| | | | | | | | It seems to be unused. Pick-to: 6.9 6.8 6.5 Change-Id: I5c6849b01b407e9c8e569baa037c360dd1b88a63 Reviewed-by: Mitch Curtis <[email protected]>
* QtQml: Do not check revisions when resolving aliasesUlf Hermann12 days4-0/+55
| | | | | | | | | | | | | Revisions are for unqualified lookup. Aliases are always qualified. [ChangeLog][QtQml] You can now create aliases to revisioned properties that would be unavailable when accessed without qualification. Aliases are always qualified after all. Pick-to: 6.9 Task-number: QTBUG-136248 Change-Id: I2aae7bb104850def8f220bfab1a2fa056efe78e0 Reviewed-by: Fabian Kosmale <[email protected]>
* QtQml: Long live Qt.labs.synchronizer!Ulf Hermann12 days12-0/+630
| | | | | | | | | | | [ChangeLog][QtQml] The new Synchronizer element allows you to synchronize values between two or more properties without breaking their bindings. This is useful for connecting user-editable controls to backend values. Fixes: QTBUG-21558 Change-Id: I01c32d7a39f1efc89975d8494ad698444c803fd4 Reviewed-by: Fabian Kosmale <[email protected]>
* VxWorks: Reduce object creation count in newQObjectRaceJacek Poplawski12 days1-1/+1
| | | | | | | | | Following the approach taken on QNX This change prevents the newQObjectRace test from timing out due to excessive object creation. Task-number: QTBUG-133752 Change-Id: I7ba7c142425c90510923aeee98ad781c5a0ced83 Reviewed-by: Fabian Kosmale <[email protected]>
* QQmlListModel: Do not crash or leak when querying inner modelsUlf Hermann12 days2-0/+36
| | | | | | | | | | | The list models can be nested, and inner models don't necessarily have a layout. Also, we need to release any worker agents we reference. Pick-to: 6.9 6.8 6.5 5.15 Fixes: QTBUG-136127 Change-Id: Ibedefce2a1d6783169e754fbf083099d050dceb1 Reviewed-by: Olivier De Cannière <[email protected]> Reviewed-by: Sami Shalayel <[email protected]>
* tst_qmllint: Rename duplicate test tagOlivier De Cannière13 days1-1/+1
| | | | | Change-Id: I401c6b3aff6c2b9812883f9a3398e111a70191bb Reviewed-by: Sami Shalayel <[email protected]>
* qmllint: Warn about reads of non-constant and non-notifiable propertiesOlivier De Cannière13 days3-0/+45
| | | | | | | | The binding might not update if their value changes. Fixes: QTBUG-112508 Change-Id: I27801d662117a89c0fdddc2aaa2f1dde21b238df Reviewed-by: Sami Shalayel <[email protected]>
* Emit rowsChanged when the rows are changed in QQmlTableModelMate Barany13 days1-1/+89
| | | | | | | | | | | | Emit the rowsChanged signal when there is a change in the rows. Update the test cases accordingly. Fixes: QTBUG-136142 Pick-to: 6.9 Change-Id: I864a743f1a197c755daa014ce0dfcc71651ab8ca Reviewed-by: Richard Moe Gustavsen <[email protected]> Reviewed-by: Matthias Rauter <[email protected]>
* qmllint: warn about duplicate property bindingsSami Shalayel13 days1-0/+46
| | | | | | | | | | Warn about duplicate property bindings for object and script bindings. Remove a TODO about doing this task that seemed to be at the wrong place. Fixes: QTBUG-118102 Change-Id: I46696b696f6c7e0c83e36077998d6118b14498ad Reviewed-by: Olivier De Cannière <[email protected]>
* Fix tst_qmllint compilation if library support is disabledJuha Vuolle14 days1-2/+2
| | | | | | | | | | | The definitions of environment_data(), environment() and maxWarnings() were behind 'library' feature flag, but declarations weren't. Removed the definitions from behind the flags. Task-number: QTBUG-136101 Pick-to: 6.9 6.8 Change-Id: Ic1878d0482c311c444fa40903ae18b22c2f5d24d Reviewed-by: Oliver Eftevaag <[email protected]>
* qmllint: Fix required property warning with owner mixupOlivier De Cannière2025-04-251-0/+8
| | | | | | | | | | | | | | | | Because we only search for the name of the property in the scopesToSearch and not which property that name actually references, we confuse a property of the same name in a neighboring scope for the actual required one. Include the property's owning scope when searching through the scopes. Amends daf57e29de918b7b4be7bb0d469db0c51d41bb07 Fixes: QTBUG-136058 Pick-to: 6.9 6.8 Change-Id: I998901fd0840270dd2048e7257d6eaca556b513d Reviewed-by: Sami Shalayel <[email protected]>
* qmllint: Fix name of inline component scopes for required propertiesOlivier De Cannière2025-04-252-3/+3
| | | | | | | | | Amends daf57e29de918b7b4be7bb0d469db0c51d41bb07 Task-number: QTBUG-136058 Pick-to: 6.9 6.8 Change-Id: Ibf412089427e4d9d5a568ee24c224b9fa41fd20a Reviewed-by: Sami Shalayel <[email protected]>
* qmllint: don't warn about required properties in inline componentsSami Shalayel2025-04-251-0/+9
| | | | | | | | | | | | Amends daf57e29de918b7b4be7bb0d469db0c51d41bb07 that recurses into inline components when checking for required properties that were not set. We should only check inline components that are base types of the scope, and ignore all inline components in children of the scope. Fixes: QTBUG-136008 Pick-to: 6.8 6.9 Change-Id: I8c687ce97b3f2eac699e2fd535193197b5239ada Reviewed-by: Olivier De Cannière <[email protected]>
* qmllint: warn about unreachable codeSami Shalayel2025-04-251-0/+39
| | | | | | | | | | | | | | | | | | | | The compiler is very polite and does not tell the user about its useless code. Codegen::statementList(StatementList *ast) silently discards unreachable statements during byte code generation. Warn the user that their code is unreachable. Don't warn about function definitions because these ones are "hoisted" up, which means that their definition is supposed to be pushed up, so that they can be used even if they are behind a "return" or "throw" statement. Don't use the qqmljsbasicblock analysis for that, it reports too many "false positives" where the compiler generates dead code that can't be fixed by the user. Task-number: QTBUG-129307 Change-Id: Ia26e8af1adf4e63b26dcaa7fb10be73b7eb084d7 Reviewed-by: Olivier De Cannière <[email protected]>
* qmllint: Implement WarnFunctionUsedBeforeDeclarationSami Shalayel2025-04-241-0/+12
| | | | | | | | | | | | | | | | | | | | | Warn about functions used before their declaration. Its not technically an error like the "var used before declaration" because functions are "hoisted up" and therefore available even before their declaration, so create a new warning category for it instead of reusing the "var used before declaration" category. Disable the warning by default: Qt Creator used to have it as default, while other tools like eslint don't. For the same reason, don't warn about functions used before declaration during codegen, and add a method to warn about it in CodeGenWarningInterface. The code for "var used before declaration" can be reused by function declarations by adding a sourcelocation for function declarations in the "addLocalVar"-call, so make sure to differentiate between functions and vars by adding an extra member to Context::ResolvedName. Task-number: QTBUG-129307 Change-Id: I83a4f8cd00c120db23a0cec3365a00ed44de2836 Reviewed-by: Olivier De Cannière <[email protected]>
* qml-tool: Treat all arguments passed after "--" as positionalOlivier De Cannière2025-04-231-0/+35
| | | | | | | | | | | The argument "-a" passed after "--" was being interpreted as the -a option of the qml tool itself instead of being passed along to the qml program as a positional argument. Fixes: QTBUG-136120 Pick-to: 6.9 6.8 6.5 Change-Id: I602aea84e4766abeb47adce0f739f12315a70b24 Reviewed-by: Fabian Kosmale <[email protected]>
* Compiler: Skip bindings to properties of type QQmlScriptStringOlivier De Cannière2025-04-175-1/+53
| | | | | | | | | | | | | | There is nothing to do in the compiler. Setting the value of the property is already handled in by the object creator or the qobjectwrapper. Reading the value doesn't really makes sense and defeats its purpose . Fixes: QTBUG-134790 Pick-to: 6.9 6.8 Change-Id: I4576eb528e0dec273830b0244149a92ceb325bc9 Reviewed-by: Sami Shalayel <[email protected]>
* Compiler: Adapt AotStats to skipping functionsOlivier De Cannière2025-04-172-19/+72
| | | | | | | | | | | A revision was also added to the aotstats json format. Print a message asking the user to try again with a clean build if a missmatch in revision is found. Task-number: QTBUG-134790 Pick-to: 6.9 6.8 Change-Id: I0961bf841db17f280492ec787f404d9fe9b563f4 Reviewed-by: Ulf Hermann <[email protected]>
* tst_qmlcachegen: Rework aotstats_generation testOlivier De Cannière2025-04-176-35/+39
| | | | | | | | | | We don't have to call qmlcachegen manually and can simply rely on the build system to generate the required aotstats files for us. Task-number: QTBUG-134790 Pick-to: 6.9 6.8 Change-Id: I5a5d6189662b9eb1daeb7adb51e3dfc2c5a13b4e Reviewed-by: Sami Shalayel <[email protected]>
* tst_qmllint: use CallQmllintOptions in the snippet testsSami Shalayel2025-04-171-53/+88
| | | | | | | | Add a Column for CallQmllintOptions in the snippet tests, and use default options for all test rows there. Change-Id: If2fa91f6a19beca86afdbcda5c5ec9ea83ca4f03 Reviewed-by: Ulf Hermann <[email protected]>
* tst_qmllint: add shorthand to enable categoriesSami Shalayel2025-04-171-0/+14
| | | | | | | | | | | | | Add a CallOption struct that allows to control how qmllint is invoked, and an callQmllint() overload that accepts this CallOption struct. Currently it only allows to enable disabled categories. This is useful to test warnings that are disabled by default, for example the "function-used-before-declaration" opt-in category that will be added in a later commit. Task-number: QTBUG-129307 Change-Id: I82b2201e1389dd1f95364109e159eaa5f5b87115 Reviewed-by: Ulf Hermann <[email protected]>
* tst_qmllint: clean callQmllint argumentsSami Shalayel2025-04-171-87/+135
| | | | | | | | | | | | | | | | | | | callQmllint requires so many parameters that it is getting quite unwieldy: move its arguments into a struct, so that its easier to distinguish between actually relevant arguments and unchanged defaulted arguments. Introduce CallQmllintOptions that contain information on how to call qmllint, and CallQmllintChecks that contain information on what tests callQmllint does (currently it can checks autofixes and the return value of qmllint). Remove the QJsonArray* argument and always return the array. Keep the old behavior of not populating the array when a test failure happened to avoid breaking tests with QEXPECT_FAIL(). Change-Id: I9dffbea0dee5033df748beec72abf00e5a141cd5 Reviewed-by: Ulf Hermann <[email protected]>
* QtQml: Load pre-registered types if no remote qmldir can be foundUlf Hermann2025-04-156-8/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we have a potentially remote qmldir we have to wait for it to surface before we load any pre-registered types. The qmldir might contain dependent imports. Once we've exhausted all possible remote qmldir URLs, we can load any pre-registered types. We have to unconditionally insert the import instance at the right place in the import namespace, though. Otherwise the imported types will get re-ordered. There are some pre-existing quirks to this behavior: We only trigger the code that postpones the loading if the QML engine has URL interceptors. Otherwise we load the pre-registered types right away. Changing this to do the right thing and first check the remote locations for any potential qmldirs would be a subtle change in behavior with large potential to break someone's code. We should not do it without a proper migration path. As a drive-by, fix the generation of warnings for unresolved imports. We only want to warn about actually unresolved imports. Previously, it warned about all imports it had to postpone if any of them was unresolved. Amends commit 46429839fedd79244559069bb4235a8b0e7ebf0a Pick-to: 6.9 6.8 6.5 Fixes: QTBUG-135334 Change-Id: Ib86ea58c19d96d2162f6735ce1caf88c562b65e7 Reviewed-by: Fabian Kosmale <[email protected]>
* QQmlBind: Only restore previous state if current state is still activeUlf Hermann2025-04-152-0/+63
| | | | | | | | | | | | | | | | | | | If some other Binding has overridden the one we're currently clearing, we should not restore the previous state. Amends commit e2fa7ab91310ea74c30e9458dfbe20d257578659 [ChangeLog][QtQml] The Binding element now only restores previous bindings or values if its own binding is still active on destruction or changes to its "when" property. If it has been overridden by another Binding element, it will not disable that one anymore. Pick-to: 6.9 6.8 Fixes: QTBUG-134922 Change-Id: Iac2883e7649dc0d2fb2669efa847becbb886ca64 Reviewed-by: Sami Shalayel <[email protected]> Reviewed-by: YaNing Lu <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* QtQml: Reject uncreatable value types even if marked as QML_UNCREATABLEUlf Hermann2025-04-152-2/+18
| | | | | | | | | | | | We simply cannot do anything sensible with them. Clarify the warning to say that only object types can be marked uncreatable. Also fix Qt.labs.folderlistmodel. It had such a type. Pick-to: 6.9 6.8 Task-number: QTBUG-135032 Change-Id: Id062908c66c4c4ab15e0deb5c92d0ca7ca447899 Reviewed-by: Fabian Kosmale <[email protected]>
* qmltc: Cleanly reject custom parsed propertiesUlf Hermann2025-04-153-0/+24
| | | | | | | | | | | | Process all properties of custom parsed types and generate errors if the custom parsed properties are actually used. Then print an extra error stating that qmltc does not support custom parsers. Pick-to: 6.9 6.8 Fixes: QTBUG-134206 Change-Id: I37e4f3f8d0ee4e0926c0d64c99a4a521b093a1ab Reviewed-by: Sami Shalayel <[email protected]> Reviewed-by: Olivier De Cannière <[email protected]>
* Tests: include QTest, not QtTestGiuseppe D'Angelo2025-04-1532-31/+65
| | | | | | | | | | | | | Never use module-wide inclusions. They blow up build times. For QtTest this is usually just a typo (QTest was meant instead). Add missing includes as needed. In the diffs I've spotted other huge inclusions (QtQuick, QtQml), but those need more attention. Task-number: QTQAINFRA-7110 Pick-to: 6.9 6.8 Change-Id: I74bf3fe212f50a7a3a6af2b1c80bbcaabc2516d7 Reviewed-by: Fabian Kosmale <[email protected]>
* qv4codegen: Track the correct location for assign instructionsOlivier De Cannière2025-04-141-0/+3
| | | | | | | | | | | | | | | | | This fixes a qmllint warning about unqualified access in the wrong place in the following unconventional but valid case: Warning: .../Main.qml:5:9: Unqualified access [unqualified] console.log(a = 1) ^^^^^^^ Warning: .../Main.qml:5:21: Unqualified access [unqualified] console.log(a = 1) ^ Pick-to: 6.9 6.8 6.5 Change-Id: I8eaa43f520c394b094917fe37dc6115ec2f7af74 Reviewed-by: Ulf Hermann <[email protected]>
* Add explicit test for revisioned properties on attached objectsUlf Hermann2025-04-141-1/+17
| | | | | | | | | The revision in question should actually be registered, and we don't to add another inner object. Task-number: QTBUG-134269 Change-Id: I99110ce460f29c87c2dcb219ad44c3dcbf32b9f5 Reviewed-by: Olivier De Cannière <[email protected]>
* QmlCompiler: Error out on unstorable typesUlf Hermann2025-04-144-0/+33
| | | | | | | | | We already do this for return types, but it's fatal on any type. Pick-to: 6.9 Fixes: QTBUG-135342 Change-Id: I7aee2a19ffcd39d2707eceb34b5073057d8b5ebb Reviewed-by: Olivier De Cannière <[email protected]>
* Port away from QPairZhao Yuhang2025-04-122-8/+8
| | | | | | | | QPair is just an alias of std::pair anyway. Task-number: QTBUG-115841 Change-Id: I26fc90adcc775aac9955ad57304af914dc4ed48f Reviewed-by: Ulf Hermann <[email protected]>
* qmltc: Properly escape translation stringsUlf Hermann2025-04-114-0/+19
| | | | | | | | | We have QQmlJSUtils::toLiteral() for that. Extend it to handle byte arrays in addition to strings and use it. Fixes: QTBUG-134726 Change-Id: Ibde1f56b25794fc8c49b796303c4f39933aedb42 Reviewed-by: Olivier De Cannière <[email protected]>
* QtQml: Fix context traversal in QQmlPropertyUlf Hermann2025-04-111-4/+27
| | | | | | | | | | | | | We need to retrieve the object from the current context, not from the innermost one. Amends commit 21f15ede606df028479335c64c333db5fb1bb3f7 Pick-to: 6.9 6.8 6.5 Fixes: QTBUG-134778 Change-Id: I1abc24dfdbb1c2f0d61a2848ad55e441cdda54a9 Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Sami Shalayel <[email protected]>
* tst_qmlformat: fix an uninitialized variable usageGiuseppe D'Angelo2025-04-101-1/+1
| | | | | | | | | | | | | | | GCC rightfully complains that /home/qt/work/qt/qtdeclarative/tests/auto/qml/qmlformat/tst_qmlformat.cpp:263:21: warning: ‘writtenOut’ may be used uninitialized in this function [-Wmaybe-uninitialized] 263 | *didSucceed = writtenOut; | ~~~~~~~~~~~~^~~~~~~~~~~~ because if we don't enter the if, we never initialize writtenOut. Initialize it. Pick-to: 6.9 6.8 Change-Id: I6d3bb8038e524773a11b3333bf65654593f01da9 Reviewed-by: Fabian Kosmale <[email protected]>
* qmllint: enhance var-used-before-declaration warningSami Shalayel2025-04-101-4/+10
| | | | | | | | | | | | | | | It doesn't really make sense to print out the location of the variable declaration, especially in the language server. Instead, emit two warnings: one at the declaration and one at the usage. This makes it easier for users to spot the location of the declaration. Add a test to make sure that both warnings can be disabled with one disabling directive. Task-number: QTBUG-129307 Change-Id: Icb485ee37f016f18395c3016672e397c4f5e6024 Reviewed-by: Fabian Kosmale <[email protected]> Reviewed-by: Ulf Hermann <[email protected]>
* qmllint: implement WarnAlreadyX warningsSami Shalayel2025-04-101-0/+16
| | | | | | | | | | | | | | | | | Add a test for WarnAlreadyFormalParameter that was already implemented by c4d503be574b56426573e706b70149eb57e52d61. Amends c4d503be574b56426573e706b70149eb57e52d61 to also implement WarnAlreadyFunction and WarnAlreadyVar which warns about redeclaring variables with functions (and vice-versa) in the same JS scope, which is rejected by the JS runtime. Also fix the sourcelocation used for functions in JS scopes to be the identifier location instead of the function keyword. Task-number: QTBUG-127107 Change-Id: I2f541b8046524ffc642824b1500323d225daed86 Reviewed-by: Ulf Hermann <[email protected]>
* QDS lint plugin: Do not warn about translation functionsFabian Kosmale2025-04-101-0/+5
| | | | | | | | | | | | | | Otherwise we are creating false positive warnings in some of our examples. Note that the test needs to disable the warning about a translation function mismatch (beceause we intentionally put them into the same file). Task-number: QTBUG-134589 Pick-to: 6.9 Change-Id: Ife760ab73222c95c358d28de6601de4fcb171826 Reviewed-by: Sami Shalayel <[email protected]>
* QmlPreview: Drop existing CUs when replacing a fileUlf Hermann2025-04-101-0/+26
| | | | | | | | | | | | | When the client wants us to use a new version of the file we shouldn't let the already existing compilation units get in the way. Amends commit 6468df7657f6af4de8727363c7f7d97b680b1867 Pick-to: 6.9 6.8 Fixes: QTBUG-129329 Change-Id: Ic4b6a0194d58412e213688959251209a94ef50f3 Reviewed-by: Sami Shalayel <[email protected]> Reviewed-by: Fabian Kosmale <[email protected]>
* qmllint: Warn about redundant optional chainingOlivier De Cannière2025-04-102-0/+15
| | | | | | | | | | | Using an optional lookup '?.' on a base type that cannot be null or undefined or when looking up an enum value is pointless. We generate a normal lookup for this in the compiler, but the bytecode keeps these redundant instructions in. Task-number: QTBUG-135649 Change-Id: I95d8b4ed22afa1bdc46a3f8b3d60a499d43931ac Reviewed-by: Fabian Kosmale <[email protected]>
* Compiler: Use regular lookup for redundant optional lookupsOlivier De Cannière2025-04-103-0/+18
| | | | | | | | | | | | | If we can determine that the base of an optional lookup cannot hold null or undefined, we can simply omit the optional part and generate a regular get lookup. This is also true whenever we lookup an enum. Amends fc4ee77116624c784d8c42f2b8e5dbf2f78b6d89 Fixes: QTBUG-135649 Pick-to: 6.9 6.8 Change-Id: I64984fdecc75cd4dbc2274a08aa73b5274fb09b7 Reviewed-by: Ulf Hermann <[email protected]>
* autotest: Cast to QQuickFolderListModel rather than QAbstractListModelDheerendra Purohit2025-04-102-12/+21
| | | | | | | | | | Replace QAbstractListModel* casting with QQuickFolderListModel* and prove that index(row) is the same as QALM::index(row), with its default (unused) column=0 argument, and QAIM::index(row, column) with any column. Fixes: QTBUG-135370 Change-Id: Ia9a2913736f722aef74f3dbb7ba0985d40044489 Reviewed-by: Oliver Eftevaag <[email protected]>