If Qml module is not found it doesn't make sense to run any
functionality that is related to Qml inside androiddeployqt. Add the
deployment setting option that indicates this explicitly and set it
to true when Qml module is not found by CMake or by qmake.
Task-number: QTBUG-106939
Pick-to: 6.4 6.2
Change-Id: I1e6cffbdd230007feffe7448617097c10238a6c9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Added command line option for passing core5compat module in windeployqt
Task-number: QTBUG-104845
Pick-to: 6.2 6.4
Change-Id: I6a0e13532edac4580e03d83be79f7db4ac54e3bf
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
All *deployqt tools are user-facing and should have a versioned link in
the installation prefix.
Change-Id: I26dde529657da0a68401e4fd721926d9978eb879
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
In androiddeployqt we try to add all plugins that belong to the Qt
modules that Android application links. This works in case if all the
plugin dependencies are linked to the Android application explicitly
or implicitly using a build system linking mechanism. But plugins may
have dependencies that should be resolved implicitly by
androiddeployqt. The following situation is handled by this change:
App1 links QtLib1.so
QtLib1.so promotes its plugin plugin1.so to be included to an apk
plugin1.so links QtLib2.so
In the described example App1 expects that plugin1.so with all the
dependencies is deployed to an apk without the need of linking
QtLib2.so explicitly.
There is a negative side effect of this change. plugin1.so is added to
apk unconditionally so there could be a situation when the plugin is
unused. So QtLib2.so with its dependencies will be included to an apk
without necessity and will increase the size of the apk significantly.
Cleanup forward declarations in androiddeployqt's main.cpp by moving
them to the top of the file.
TODO: Need to add the API which allows to exclude such plugins from apk
or to specify the list of essential plugins that are used in the
Android application. See QTBUG-107634 for details.
[ChangeLog][Android] All plugins that belong to the Qt modules that are
linked to the Android application are now deployed with their
dependencies. androiddeployqt tries to find and resolve plugin
dependencies implicitly instead of skipping plugins with dependencies
that are not resolved explicitly in the user project.
Fixes: QTBUG-107589
Fixes: QTBUG-106035
Change-Id: Ib6d9abd74ae5e21e856d7ccd02789a7a65602f40
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
SyncScanner::writeIfDifferent compares the size in the buffer with
the size of the existing file on disk to see whether the file should
be rewritten. However, on Windows the sizes hardly ever matched, because
the implicit \n to \r\n conversion only happened when writing the file
in text mode using ofstream. Take this into account.
Change-Id: Ic689390396fcc3a640640378743bd058f48a1779
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
To allow the user to customize the C++ code that QDoc sees, so as to be
able to work-around some limitations on QDoc itself, QDoc defines two
symbols: Q_QDOC and Q_CLANG_QDOC, both of which are "true" during an
entire execution of QDoc.
At a certain point in time, QDoc allowed the user the choice between a
custom C++ parser and a Clang based one.
The Q_QDOC symbol would always be defined while the Q_CLANG_QDOC symbol
would be defined only when the Clang based parser was chosen.
In more recent times, QDoc always uses a Clang based parser, such that
both Q_CLANG_QDOC and Q_QDOC are always defined, making them equivalent.
To avoid using different symbols, and the possible confusion and
fragmentation that derives from it, all usages of Q_CLANG_QDOC are now
replaced by the equivalent usages of Q_QDOC.
Change-Id: I5810abb9ad1016a4c5bbea99acd03381b8514b3f
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
The warning is as follows:
WARNING:The option setting
'android.bundle.enableUncompressedNativeLibs=false' is deprecated.
The current default is 'true'.
It will be removed in version 8.0 of the Android Gradle plugin.
You can add the following to your build.gradle instead:
android {
packagingOptions {
jniLibs {
useLegacyPackaging = true
}
}
}
We already define that property in build.gradle, but we also need to
account for cases where an old build.gradle file that doesn't have that
property is used. So androiddeployqt checks if useLegacyPackaging is set
(and not commented out) whether it's true or false, if it's set to true,
then that's what Qt wants to set, and if it's set to false, then we
assume the user setting it to false is explicit and we don't want to
change that.
Pick-to: 6.4 6.2 5.15
Fixes: QTBUG-106713
Change-Id: I566232207c458daa4484623beee670c6c6679313
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Use the "ERROR:" preamble for all syncqt warnings if warningsAreErrors
flag is set.
Amends 658c166f96
Task-number: QTBUG-107088
Change-Id: Idc4a0e9196dce9788fd5a25bdac6783779c1bc85
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Make QtUiTools a known module with command line options and
plugin dependencies.
Note: There is no automated dependency checking for those
plugins as this can lead to undesired libraries being pulled.
Pick-to: 6.4
Fixes: QTBUG-104831
Change-Id: I31a0c3620460d6558edcf8245f43502f2bca7748
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
This is a combination of Q_UNREACHABLE() with a return statement.
ATM, the return statement is unconditionally included. If we notice
that some compilers warn about return after __builtin_unreachable(),
then we can map Q_UNREACHABLE_RETURN(...) to Q_UNREACHABLE() without
having to touch all the code that uses explicit Q_UNREACHABLE() +
return.
The fact that Boost has BOOST_UNREACHABLE_RETURN() indicates that
there are compilers that complain about a lack of return after
Q_UNREACHABLE (we know that MSVC, ICC, and GHS are among them), as
well as compilers that complained about a return being present
(Coverity). Take this opportunity to properly adapt to Coverity, by
leaving out the return statement on this compiler.
Apply the macro around the code base, using a clang-tidy transformer
rule:
const std::string unr = "unr", val = "val", ret = "ret";
auto makeUnreachableReturn = cat("Q_UNREACHABLE_RETURN(",
ifBound(val, cat(node(val)), cat("")),
")");
auto ignoringSwitchCases = [](auto stmt) {
return anyOf(stmt, switchCase(subStmt(stmt)));
};
makeRule(
stmt(ignoringSwitchCases(stmt(isExpandedFromMacro("Q_UNREACHABLE")).bind(unr)),
nextStmt(returnStmt(optionally(hasReturnValue(expr().bind(val)))).bind(ret))),
{changeTo(node(unr), cat(makeUnreachableReturn,
";")), // TODO: why is the ; lost w/o this?
changeTo(node(ret), cat(""))},
cat("use ", makeUnreachableReturn))
);
where nextStmt() is copied from some upstream clang-tidy check's
private implementation and subStmt() is a private matcher that gives
access to SwitchCase's SubStmt.
A.k.a. qt-use-unreachable-return.
There were some false positives, suppressed them with NOLINTNEXTLINE.
They're not really false positiives, it's just that Clang sees the
world in one way and if conditonal compilation (#if) differs for other
compilers, Clang doesn't know better. This is an artifact of matching
two consecutive statements.
I haven't figured out how to remove the empty line left by the
deletion of the return statement, if it, indeed, was on a separate
line, so post-processed the patch to remove all the lines matching
^\+ *$ from the diff:
git commit -am meep
git reset --hard HEAD^
git diff HEAD..HEAD@{1} | sed '/^\+ *$/d' | recountdiff - | patch -p1
[ChangeLog][QtCore][QtAssert] Added Q_UNREACHABLE_RETURN() macro.
Change-Id: I9782939f16091c964f25b7826e1c0dbd13a71305
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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, with manual
unstaging of the actual definition and documentation in dist/,
src/corelib/doc/ and src/corelib/global/.
Task-number: QTBUG-99313
Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Makes it easier to navigate to the offending file.
Change-Id: Ie2de5d6a0735952e72444b0ac8710fc44311eace
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The module name is already clear from the build rule, e.g:
[17/451] Running syncqt.cpp for module: QtCore
WARNING: qtconfigmacros.h includes qconfig-bootstrapped.h when it should include QtCore/qconfig-bootstrapped.h
Change-Id: I9f306768e4f415dbdc20e58a93898cb7bdd83298
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reintroduced by qtmultimedia/ccdc369cb82180bc12c3a6b00d33afad2848ba02.
Pick-to: 6.4
Fixes: QTBUG-105984
Change-Id: Iaca5ac6ad360c78542f20922803bac3375cbe58a
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Causes newlines between lines in the output:
QtBluetooth: WARNING: adapter1_bluez5_p.h does not have the "We mean
it." warning
QtBluetooth: WARNING: battery1_p.h does not have the "We mean it."
warning
QtBluetooth: WARNING: device1_bluez5_p.h does not have the "We mean it."
warning
Change-Id: I810d70e579eb4e2c8e45fffd1719b415dd74ee43
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Add the -warningsAreErrors command line argument to syncqt.cpp that
causes a fail at build step if any of header files doesn't fit the
syncqt standards. The argument reflects the WARNIGS_ARE_ERRORS CMake
variable state.
Output the syncqt.cpp warnings at configure time.
Fix the faulty positive IncludeChecks failure flag.
Task-number: QTBUG-107088
Change-Id: Id30af4c7b78fd44c1c99c7e9306965d03a0f992d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Skip sanity checks if a -help option is detected.
Otherwise, syncqt bails out with e.g.
You need to specify either -headers or -all option.
Change-Id: I49eee48cd1825244cb6d04152734cb0dfa03fc5f
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
I got build-time errors for memcpy() not being declared, that
helpfully told me to #include <cstring> to get it.
Change-Id: I6ae9e881e5accf496e9c3694ca43701972d64722
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Addressing a comment from the review of QTBUG-98434.
Drop the exta QString() call, it is unnecessary.
Task-number: QTBUG-103100
Change-Id: I5a13deb5d3c52166919302bc4bb45bd0b6b5c770
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Addressing a comment from the review of QTBUG-98434.
Instead of assigning an initial value to the QString, create an empty
QString first and then append to the QString.
Task-number: QTBUG-103100
Change-Id: I8f2569ac2a2203e6459bbc7df789c9ef34f598d0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Addressing some comments from the review of QTBUG-98434.
Fix the mismatches between string types and string literals.
Task-number: QTBUG-103100
Change-Id: Id619d7b99b9133c983f31ec5a5c2d9cc9d927416
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The fix for QTBUG-39177 was to append Qt's bin dir to PATH. But if we
have a Qt bin dir in PATH that is different from the one windeployqt
belongs to, then we end up calling qtpaths from the former Qt.
Change-Id: I373a3270d1ec950479049b4cdaf0ff13dd8813c7
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Use QDir::listSeparator() for additional entries in PATH instead of the
hard-coded semicolon. This is a preparation for running windeployqt on
non-Windows platforms.
Change-Id: I84f1da130508da7a0f3190d811acf35477564bf7
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
syncqt.pl adds an extra dependency on perl when building Qt. Modern C++
provides the convenient cross-platform way to access a filesystem and
to use regular expressions, so we may replace the perl script with C++
application. The syncqt executable is built at configure time and
installed as QtCore tool. It's running at configure time to deliver the
required header files for IDE to build a consistent code model and at
the build time to keep tracking changes in header files and generate
the missing aliases without reconfiguring. 'syncqt' only parses header
files from a CMake build tree, so the resulting Qt installation only
contains interfacing headers that belong to the platform that Qt is
built for. 'sync.profile' files are not used as the 'source of truth'
for sync qt procedure anymore, all the necessary information is taken
from either CMake files at configure time or from the module header
files while parsing them.
syncqt.pl is still in place since it's required as fallback solution
for a smooth transition to the new syncqt implementation for all qt
repositories.
This patchset only enables the C++ based syncqt for 'qtbase'
repository.
From the performance perspective C++ version works faster then perl
script, also the configure time is reduced significally on subsequent
reconfigurations - up x2 times faster when re-configuring repository,
but it also takes time to compile the tool itself the first time.
Numbers for qtbase:
syncqt.pl syncqt.cpp
initial: 0m16,035s 0m20,413s
reconfig: 0m6,819s 0m3,725s
The syncing procedure can be run separately for each module using
<ModuleName>_sync_headers targets. The 'sync_headers' target can be
used to sync all the modules at once.
Task-number: QTBUG-87480
Task-number: QTBUG-103196
Change-Id: I8c938bcaf88a8713b39bbfd66d9e7ef12b2c3523
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Scanning of the Qml imports should be run if either Qml root paths or
.qrc files are specified for androiddeployqt.
Task-number: QTBUG-106939
Pick-to: 6.2 6.4
Change-Id: I3229ec6d3f2ac17ef751b4a6ed74e8e98db7465e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This improves moc's support for nested inline namespaces, so that code
containing them will not break compilation.
For simplicity, we allow nested inline namespaces even in C++17 mode
(the actual C++ compiler will reject the code anyway, and probably with
a better error message than moc could output).
moc still has no real awareness how inline namespaces work, but that is
a preexisting issue.
Pick-to: 6.4 6.2
Fixes: QTBUG-106920
Change-Id: I7b415a99133575f101bc81d01d4670a5f752917f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Addressing a comment from the review of QTBUG-98434. Instead of
creating a QL1SV from the concatenation, create the QL1SV first and
concatenate after, using QStringBuilder.
Task-number: QTBUG-103100
Change-Id: Ic082da410db15dd9e2c341711c24150d7a0dc0c2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit addresses a comment from the review of QTBUG-98434.
Drop the extra QString(), .arg can be called on _L1 as well.
Task-number: QTBUG-103100
Change-Id: I4891d42536f6ea413464bea78de4b82aa6363a11
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Noticed during the review of QTBUG-98434. The variable includeGuard is
a QString, that is converted into a Latin1 string and then converted
back to QString. Remove these unnecessary lines.
Task-number: QTBUG-103100
Change-Id: I335d49ef990cb6de24031be380b5c2c7e12e961e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Addressing some remarks made during the review of QTBUG-98434.
Fix the mismatches between strings and string literals.
Task-number: QTBUG-103100
Change-Id: I3a7d2574f55fcffa81b8c87fb510aba0a8853330
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
We already have:
a, a timeout as part of QtTest. By default it lets each test function
run for 5 minutes. This timeout can be configured using
QTEST_FUNCTION_TIMEOUT.
b, maxTimeBetweenOutput in the CI. The CI will kill the process if too
much time passes between individual output lines of a test.
c, maxTimeInSeconds in the CI. This does exactly the same as the
androidtestrunner timeout.
The CI timeouts can be centrally tuned per platform and Qt module. This
is preferable over a special timeout just for android.
As other people may be using androidtestrunner for unrelated projects,
don't delete the timeout, but simply disable it from CMake by setting
it to -1.
Task-number: QTBUG-106479
Task-number: QTBUG-101596
Task-number: QTBUG-100242
Change-Id: If4ce00948e204182bb12ac4859d3b0dd193de7ad
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Historically, resource imports were generated as "import file_rc",
however, pyside6-project generates files by prepending "rc_". Add an
option to flip this.
Pick-to: 6.4
Change-Id: Iee0f161cb2101c8080bd131a6401bbaf4682186d
Reviewed-by: Adrian Herrmann <adrian.herrmann@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
While working on QTBUG-98434 some improvements for the pre-existing
code were found during the code review.
The first parameter is the base of the QString created by the
function but it is not needed as an actual QString, it is just
appended to. Change the type from QString to QL1SV.
Task-number: QTBUG-103100
Change-Id: I8042a921628e84d951dcfd2fd12154bf74dd5162
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
As a potential improvement discovered while working on QTBUG-98434,
replace the current comparison in toBool with QString::compare.
Task-number: QTBUG-103100
Change-Id: If5482adeea1537d24a97a4dda2d27ecc3b12b5bf
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
While working on QTBUG-98434 some potential improvements were
found in the pre-existing code.
Some of the QLatin1String literals are used to initialize
QStrings or are converted to QStrings and so it makes sense to
replace them with QString literals.
As a related change, change the type of namespaceDelimitier from
QString to QL1SV, since it is used only for a function call and
that function has an overload to take QL1SV.
Task-number: QTBUG-103100
Change-Id: I56db6ddd84ad2a7133a765bb49ecd8f962ac5c13
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
While working on QTBUG-98434 some potential improvements were found
for pre-existing issues, for example some variables were wrongly
initialized. Fix the mismatches between QString/QLatin1StringView.
Task-number: QTBUG-103100
Change-Id: Ib120452fe8012cda3f9becea8f9837efc38cf199
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The indentation is only required for C++.
Pick-to: 6.4 6.3 6.2
Change-Id: Ie861b12ba262fd56995c11d883129bafd11eface
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This reverts commit 756c65d367.
"justified_worry" is an incorrect workaround which attempted to silence
tracegen when invalid types were being used. This caused Qt to compile,
but with broken/invalid tracepoints.
The proper solution involves fixing the tracepoints in question.
Change-Id: I96de254944f0367808527d215e87a5d66bb442f4
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
qdbusxml2cpp has a -m/--moc option. Change and modify the behavior
such that
-p foo -m includes moc_foo.cpp in the generated .cpp
-p :foo.cpp includes moc_foo.cpp in the generated .cpp
-p foo.h:foo.cpp includes moc_foo.cpp in the generated .cpp
Change the Qt6DbusMacros.cmake file accordingly.
[ChangeLog][qdbusxml2cpp] The -m/--moc option now generates
idiomatic moc file names (moc_base.cpp for headers, base.moc
for implementation files)(was: always base.moc). Build systems
using workarounds for the non-idiomatic naming of moc files
used by qdbusxml2cpp in the past can now drop these workarounds
for Qt versions >= 6.5.
Fixes: QTBUG-103313
Change-Id: I754b1b276f130cb8645166470e1b457a676590f7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
QRegularExpression::isValid returns true on default constructed objects,
so the filter was always matching even though it was not meant to be
applied at all.
Fix this by checking that there is a non-empty pattern string set and
applying the filter only then.
Fixes: QTBUG-87764
Pick-to: 6.4
Change-Id: If37f8abaecacba3dc6f0b14da681a6e025367c10
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
A couple of variables contained "Destianation" instead of "Destination"
Change-Id: I98a15652347d1b0dad640bc49925ec296830147b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Fixes deploying libgcc, currently it fails to change the rpaths with the
following error:
ERROR: Could not parse otool output line:
"\t/usr/local/opt/gcc/lib/gcc/11/libgcc_s.1.1.dylib
(compatibility version 1.0.0, current version 1.1.0, reexport)"
Pick-to: 6.3 6.4
Change-Id: I5c866a375f88e3b222cbdbebc167b04174f753b2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Since we had code to default to zstd as the default algorithm instead of
"Best", we ended up not compressing anything.
[ChangeLog][rcc] Fixed a bug that caused rcc not to compress files with
any compression algorithm if the --no-zstd option was present.
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-106012
Change-Id: Ic6547f8247454b47baa8fffd170fddae429f82d2
Reviewed-by: Kai Koehne <kai.koehne@qt.io>