This test sets a QtGui scale factor, and then reads
back the DPR form QML Screen.devicePixelRatio and compares
with the expected scale factor.
However, that DPR value also includes the native DPR
as a factor. Account for this when determining the expected
zoom value.
Change-Id: I324e9554f858f2a54f92f555f5d22dd015435737
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Every instance of AUTO_RESOURCE_PREFIX has been replaced by either
qt_standard_project_setup(REQUIRES 6.5) or with
qt_policy(SET QTP0001 NEW), mainly in tests.
In addition, I added a warning message for the case where
AUTO_RESOURCE_PREFIX is used.
Pick-to: 6.5
Task-number: QTBUG-96233
Change-Id: I323a15e9d0bb5fe6ba649365314af9fc2ad67bda
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Fail only after adding the event so that we can see the event in the
post-fail listing of received events. That might shed some light on what
actually happens.
Task-number: QTBUG-111008
Change-Id: I3a40ea71c35aa48ec7a827bd51513f7f678831c6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Also, drop all the VERSION 1.0 lines from the examples and tests. 1.0 is
actually a bad default version since it's before all the Qt versions.
[ChangeLog][QML] You can now omit the VERSION argument to
qt_add_qml_module(). This will automatically generate the highest
possible version.
Pick-to: 6.5
Task-number: QTBUG-99146
Change-Id: Ic10ec69b87c224e0e94e1785f65653815d4c778c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
We need to set up autogen tools not onlyfor the main library but also
for the plugin.
Fixes: QTBUG-109010
Pick-to: 6.4 6.2
Change-Id: I72b64c3803eb1de5f07e8dde05b87d95bc5dc7f2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Initialize scopedContext with valid qmlContext. Otherwise debugger
crashes on attempt to lookup an object that includes a v4Function
property
Pick-to: 6.2 6.4
Fixes: QTBUG-107607
Change-Id: Iea59bdf9d379a5415abe1767f76f851978b1be3f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
They have the confusing property of being a QObject but having a
QMetaObject that says it's a Q_GADGET.
Pick-to: 6.4
Fixes: QTBUG-108646
Change-Id: I6df34c2004918cd89691f4b5eb4b6267dabcd7ff
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Make sure it doesn't leak memory and use ranged for rather than foreach.
Also, make sure the individual test functions don't depend on each other
and leave all global resources in a clean state.
Change-Id: Ibce1910f26f8b3b341463bb3a758602c4c402c1a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to
handle typedefs and accesses through pointers, too:
const std::string o = "object";
auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); };
auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) {
auto exprOfDeclaredType = [&](auto decl) {
return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o);
};
return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))));
};
auto renameMethod = [&] (ArrayRef<StringRef> classes,
StringRef from, StringRef to) {
return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)),
callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))),
changeTo(cat(access(o, cat(to)), "()")),
cat("use '", to, "' instead of '", from, "'"));
};
renameMethod(<classes>, "count", "size");
renameMethod(<classes>, "length", "size");
except that on() was replaced with a matcher that doesn't ignoreParens().
a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'.
Change-Id: I58e1b41b91c34d2e860dbb5847b3752edbfc6fc9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.
Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.
Task-number: QTBUG-99313
Change-Id: I601bf70f020f511019ed28731ba53b14b765dbf0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This is a semantic patch using ClangTidyTransformator as in
qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8:
auto QtContainerClass = anyOf(
expr(hasType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes))))).bind(o),
expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o));
makeRule(cxxMemberCallExpr(on(QtContainerClass),
callee(cxxMethodDecl(hasAnyName({"count", "length"),
parameterCountIs(0))))),
changeTo(cat(access(o, cat("size"), "()"))),
cat("use 'size()' instead of 'count()/length()'"))
a.k.a qt-port-to-std-compatible-api with config Scope: 'Container',
with the extended set of container classes recognized.
Change-Id: Idb1f75dfe2323bd1d9e8b4d58d54f1b4b80c7ed7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
They run into a hard to reproduce deadlock in the CI. In turn re-enable
tst_qqmljdebugjs for macOS/arm as there it doesn't happen.
Pick-to: 6.2 6.3 6.4
Task-number: QTBUG-102984
Task-number: QTBUG-101678
Change-Id: I17d483b7c44b36d17cfc2f0f31fcccd30cd4548a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.
Existing copyright statements remain intact
Task-number: QTBUG-88621
Change-Id: I72c89a98c42bbc9234d8495e9e503bec81d11037
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
After this patch, if a QQmlDataTest-derived class passes
FailOnWarningsPolicy::FailOnWarnings to the base constructor, any
non-empty warning encountered by that test will result in a test
failure.
This avoids the need to duplicate the catch-all regex in tests that
want to fail on warnings.
The goal is to gradually enable failure-on-warnings over time.
Leave comments and explicitly pass DoNotFailOnWarnings for tests that
should never fail on warnings.
Task-number: QTBUG-98718
Pick-to: 6.2 6.3 6.4
Change-Id: I4b647d93a0f28ac891c4bdb19ef74569f2918e8f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The debugger treated QQmlGadgetPtrWrapper like normal QObjects,
which means that their metacalls where done incorrectly.
The meta system saw the QQmlGadgetPtrWrapper's metaobject,
which is actually the wrapped type, and produced a garbage
QObject* by reinterpret_casting the wrapper as the wrapped type.
The debugger was changed to recognize gadgets and to call
the read/write/resetOnGadget() methods instead of calling
QMetaProperty.read/write/reset().
Added a test with the qml example that was making the
application crash when a qml debugger was attached to it.
Fixes: QTBUG-104379
Change-Id: I7c1138fc44ee78137386dcd7da145bbaab574afc
Pick-to: 6.3 6.4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.
Pick-to: 6.4
Task-number: QTBUG-67283
Change-Id: I63563bbeb6f60f89d2c99660400dca7fab78a294
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
If the debuggee somehow manages to ignore our kill signal, the QProcess
dtor will hang. Let's rather crash in this case, so that we see when it
happens.
Task-number: QTBUG-101678
Change-Id: Idc72412925244acfdb1dfdeec07369d5fb271080
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
QLocale reversed the order of languages returned from uiLanguages()
recently. Adapt the test to this change.
Fixes: QTBUG-103026
Change-Id: I471351494bd56e48d1cf4bee3f6f27a786c5b107
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The test was failing because it was using QML code that was embedded
directly in the test, so the dependencies were not detected and
deployed.
This patch moves QML code into separate files, so that qmlimportscanner
could provide all the necessary dependencies.
Fixes: QTBUG-100166
Pick-to: 6.3 6.2
Change-Id: I5581de9a4573204722ad60eaceae8d05a491eb13
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
The flaky test hangs and is eventually registered as a crash in
the CI.
Task-number: QTBUG-101678
Task-number: QTBUG-101972
Task-number: QTBUG-102984
Change-Id: Id12b0c7032d31c97b24b6cf88fcbf2f28be1c293
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Commit 8398f6990b added
#include "debugutil.moc"
but debugutil.cpp doesn't contain anything that would produce such a
file. This leads to a flood of AutoMoc warnings when building the QML
debugger test.
Presumably, it was meant to include moc_debugutil_p.cpp, so let's do
that.
Change-Id: I86dfe935e7a01388f6737124d9383ad53a772897
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
tst_qv4debugger::conditionalBreakPointInQml() failed on Android
because dependencies were not available.
This patch moves qml code from strings to file, thus exposing it
to the build system. This way, the build system can take care
of the dependencies.
Pick-to: 6.2 6.3
Fixes: QTBUG-102416
Task-number: QTBUG-101865
Change-Id: Icd6ef43a45642f68e749137a963ee2ebfe462bce
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Extra event loops are famously brittle, and we don't need them here. We
can just us QTest::qWaitFor().
Task-number: QTBUG-101678
Change-Id: I73837bc323c83431f487db3cac6872736635d557
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Replace deprecated QString::count with QString::size or QString::length,
depending on context, and use qsizetype instead of int.
Pick-to: 6.3
Change-Id: Ie4c08abd2cf2ba771c23e8def72756170cc07af7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The mutex had no function I can discern as the class is not thread safe
in any way, and isn't used from multiple threads anywhere. Extra event
loops are famously brittle. We don't have to use an extra event loop
here. QTest::qWaitFor will do just fine.
Task-number: QTBUG-101678
Change-Id: If25a961312a1eeb725ff779e386b2657e0f23dd1
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The test works fine with the window hidden. Trying to show it gives
problems in the CI. We also want to avoid showing windows in non-GUI
tests as far as possible.
Fixes: QTBUG-101738
Pick-to: 6.2 6.3
Change-Id: I206f74f940e6ba7ac6346c85459b896387ab85a5
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Follows up on qtbase:f5762cd4b3130a650044863c5be132056f05daa5.
Use auto instead of specific QJsonValue*Ref type to avoid need for
orchtestrating with dependency update.
Change-Id: Ib47d5d8ab8373562684b42a90c97634e07869328
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
This allows us to enable testing on declarative for the module
as a whole and have some sort of test verification for the mean
time, and fix the fails over time.
Pick-to: 6.2 6.3
Task-number: QTBUG-100003
Task-number: QTBUG-100014
Task-number: QTBUG-100016
Task-number: QTBUG-100018
Task-number: QTBUG-100020
Task-number: QTBUG-100021
Task-number: QTBUG-100164
Task-number: QTBUG-100166
Task-number: QTBUG-100167
Task-number: QTBUG-100169
Task-number: QTBUG-100171
Task-number: QTBUG-100173
Task-number: QTBUG-100175
Task-number: QTBUG-100176
Task-number: QTBUG-100177
Task-number: QTBUG-100191
Task-number: QTBUG-100253
Task-number: QTBUG-100254
Task-number: QTBUG-100256
Task-number: QTBUG-100257
Task-number: QTBUG-100258
Change-Id: I85bf1501b94f04853a1ca715e35df0a56041308a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Disable tests that are meant to check debugging features using host
binaries. No point running those tests on actual targets.
Pick-to: 6.2 6.3
Change-Id: If020dfa00410668a305013254617fd50a0a01175
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Debug translation service did not provide missing translations
correctly and didn't send any elide warnings
Pick-to: 6.2
Task-number: QTBUG-96527
Change-Id: I3f5c5aeae0866a8e8c6b5302136a097f1ca7abc4
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Function declarations add their name to the outer scope, but not the
inner scope. Function expressions add their name to the inner scope,
unless the name is actually picked from the outer scope rather than
given after the function token.
We don't add the name to any scope in the case of functions declared in
QML elements because the QML element will receive the function as
appropriately named, and typed, property. It is always better to use
that one than to use a JavaScript local.
This causes some additional ecmascript tests to pass.
Pick-to: 6.2
Fixes: QTBUG-96625
Change-Id: I0b8ee98917d102a99fb6b9bd918037c71867a4a5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Previously each test would include and build sources from the shared
folder. Now we make those sources a library, build it once, then have
each test link to it instead.
We also take the opportunity to move some helpers that qtquickcontrols2
had added into the quicktestutils library where it makes sense, and
for the helpers that don't make sense to be there, move them into
quickcontrolstestutils.
We add the libraries to src/ so that they are internal modules built as
part of Qt, rather than tests. That way we can use them in a standalone
test outside of qtdeclarative.
Task-number: QTBUG-95621
Pick-to: 6.2
Change-Id: I0a2ab3976fdbff2e4414df7bdc0808f16453b80a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Add current state name in the protocol
* Get style name in correct format
* Get correct root item after changing new file
Task-number: QTBUG-96052
Pick-to: 6.2
Change-Id: I5a7b9e29ec83e6258505cedbd55edf376386f783
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Use explicit reference type QJsonValueRef when looping over a QJsonArray.
tst_qqmldebugjs.cpp:1070:30: warning: loop variable 'scope' is always a
copy because the range of type 'const QJsonArray' does not return a
reference [-Wrange-loop-analysis]
for (const auto &scope : scopes) {
^
note: use non-reference type 'QJsonValueRef
Change-Id: Ib9ff6329d8ca9431eb7bd5a190093f09c7bf003d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The .pro files corresponding to the .prev_CMakeLists.txt files
have already been removed.
Change-Id: I254eafe4c7de1a516e33bd9cb3d9879e73fa83b4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
We cannot just take the number of active breakpoints as ID for the next
one. It's possible to remove breakpoints after all.
Fixes: QTBUG-93404
Pick-to: 5.15 6.1
Change-Id: Icde7a8e47c740e930f2313ffd9034b00033a54aa
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Ammend 784c624413 and remove installation
of translation file that was removed.
Change-Id: I59b4a2babb77c1f66195c9480cd78b1261ca8bf2
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>