When collecting plugins required for the android application according
to linked targets we should take into account all prefix directories.
But not only the first one. Otherwise the order we use when adding
paths to extraPrefixDirs will affect collecting of the plugins. This
specifically leads to the issue if the user project builds custom Qt
plugins. The plugin directory from user project build tree will be
found first and all plugins from Qt installation directory are
discarded.
Pick-to: 6.6 6.5
Fixes: QTBUG-116920
Change-Id: Id94ebaf5ccd1a279a74b38b59ff535f45230e1b4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Generate the missing deprecated header in the framework directory for
the cross-module deprecation case.
Amends 7e84a04563
Pick-to: 6.5 6.6
Change-Id: Ibb2d262e41c6de7dfb34c39cabd6b19c43aa9636
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Call close explicitly to avoid any issues related to non-closed file
descriptors.
Pick-to: 6.5 6.6
Change-Id: I02df30032dc04afd5d135d707eff4a6efe6a3ea5
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Wrap the directory creation logic with try/catch to handle possible
file system exceptions.
Pick-to: 6.6 6.5
Change-Id: I11ad4552dccfdc8cc8a4ec4912d0a15d0f9557c6
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Require the C++17 standard, but not what is set by Qt for syncqt,
to avoid unwanted standard check in some corner cases.
Pick-to: 6.5 6.6
Task-number: QTBUG-116789
Change-Id: I34e07e172e31d5ffc69b84dd3ef30f02f6e75a9d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The latest XDG spec (0.8) defines XDG_STATE_HOME that does not exist
in QStandardPaths::StandardLocation.
Some Linux distributions clean XDG_CACHE_HOME on restart which makes
XDG_STATE_HOME useful as a path for saving application state.
This commit adds StateLocation and GenericStateLocation to serve as a
StandardLocation for XDG_STATE_HOME for all platforms.
This commit also updates docs and tests to fit the new changes.
[ChangeLog][QStandardPaths] Added StateLocation &
GenericStateLocation to StandardLocation
Change-Id: I470602466c37f085062cc64d15ea243711728fa5
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Nothing in those files uses QPair; and a local build finished fine without them.
Task-number: QTBUG-115841
Change-Id: I669cfecaa9129bce6b31e464826287f138b159db
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Follow the same patterns as for qpa and rhi. Semi-public APIs will be
put under the "namespace" ssg which is short for Spatial Scene Graph.
Taks-number: QTBUG-116570
Change-Id: I38887f129ec90e67f6a929a0d8ea5ea8b8c49ee8
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
ifstream may block the file descriptor in some operating systems.
Wrap the reading of files in staging directory with extra scope,
to make sure that ifstream closed the descriptor before the removal
attempt. Also make sure that we closed the ifstream explicitly.
Pick-to: 6.5 6.6
Change-Id: I56ef5e9925501912d5cd61e8545f664e0a0d90b8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
If some header files were moved to another module within same repo it
makes sense to allow deprecating them. 'syncqt' now is able to detect
this kind of header files if the 'foreign' module is specified in
qt_deprecates pragma as part of the deprecated header name.
Pick-to: 6.5 6.6
Task-number: QTBUG-116483
Change-Id: I479ea60e71de112b67c281722600cd818aac7762
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Neither C++ nor modern C allow omitting the type (which used to be
equivalent to an "int" return type).
moc should not try to parse functions in C code, as they cannot be
meta-methods. So there is no point in supporting it.
Change-Id: I2b3a492988f29e8139311db64be110581cc1a4de
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Back then elfreader and other unix functionality was added for the
purpose of having one generic deployment tool but it was never used.
Remove the code to be more clear on what to expect.
Pick-to: 6.6
Change-Id: I2b7a759de04afe0c5fb210ad65f1c86e32934f18
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Commit 9db5ca87897340873a4606c651a37e0356e8f1a0 sets the default
qtDataDirectory to the value of qtInstallDirectory, which results in an
invalid path when appended to the SDK. This results in build failures
for Android when building with qbs. cmake builds are not affected as
the data directory is explicitly set in the build scripts.
Pick-to: 6.6 6.5
Change-Id: Ia29c5bae7648f5fccefe019c225e187985bd2592
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
By actually registering them.
Commit 850d850c5a changed from
qMetaTypeId<QDBusArgument>() to QMetaType::fromType<QDBusArgument>() and
in Qt 6, fromType() does not register the type with the database. That
means the lines became runtime no-ops at that time or during the
QMetaType updates since 6.0. All they did was instantiate the C++ inline
variable.
The testing also detected we didn't register QList<QDBusVariant> as an
alias for the "av" signature. I'm not entirely sure you're allowed to
use this because QtDBus does not like re-registration of the built-in
types, and "av" is already assigned to QVariantList. This is no trouble
for the parser, anyway.
Minor change to qdbuscpp2xml to allow reading from stdin, so we don't
have to create temporary files.
Pick-to: 6.5 6.6
Fixes: QTBUG-115964
Change-Id: I80612a7d275c41f1baf0fffd177a14925e7d23ac
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Defining USE_LEXEM_STORE breaks compilation, and the commit that
introduce it (in the pre-public history) does not shed any light on its
usage.
Change-Id: Ic616bf9f2584151dab3f654d64025fcdc0ade25c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
As a drive-by, fix a detach attempt in an existing ranged for-loop by
making the container const, and don't re-construct the same QDir three
times, just once, at beginning of the function.
Change-Id: I5031c4b63dd939ae93dd119b01d1cad5e655f733
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Emit properties with MEMBER field specified with 'readwrite'
access. Previously only READ and WRITE filed where used
for deriving the access value.
Add a property using MEMBER to the test class used by
tst_qdbuscpp2xml.
Fixes: QTBUG-115631
Change-Id: I12351985a9fafd934ccc5e0b805077a9e44b6608
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit adds some initial support for handling the 'L' suffix after
numbers. This one is especially important given that the __cplusplus
define is using it.
Other suffixes will be handled in some later commit, which should also
unify the already divergent parse behavior between DIGIT and PP_DIGIT
parsing (e.g. when it comes to byte prefixes).
Task-number: QTBUG-83160
Task-number: QTBUG-115558
Pick-to: 6.6 6.5 6.2
Change-Id: Ie61eae49c468abfaee80e7e4f7097917a254dc0e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Qt insight's TP is using plugin type "generic" so that insight plugins
can be deployed for every Qt application. As "generic" plugins are part
of QtGui windeployqt deploys these if a dependency to QtGui is found.
As defaulting to a deployment of insight plugins might cause confusion
among users, we make deployment of these plugins explicit if the module
is available.
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I9d2a8595373d5a15b7afbeaf7174226563b1cb6f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
If the path where Qt sources are located has 3rdparty in it we skip
headers processing since all headers are treated as 3rdparty.
Use path relative to the source directory when indentifying the 3rdparty
header files using regex.
Fixes: QTBUG-115324
Pick-to: 6.5 6.6
Change-Id: If97328cb9a9ece01d43c56022f4613da9b29c03f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
syncqt uses qt_deprecates pragma to generate deprecated header files
that might live forever in Qt packages. This adds the version argument
to the pragma, that allows specifying the version when the respective
header file should be removed. The new pragma format is the following:
pragma qt_deprecates(<header>[,<major.minor>])
If deprecation version of the deprecated header file is lower than
the current Qt version, syncqt will display the respective warning in
the log and skip generating the deprectated header file.
Also the user warning message now displays the exact version when the
header file will be removed.
Task-number: QTBUG-115029
Pick-to: 6.6
Change-Id: Ifd7464b8539b8be93b95690fd1ca70ef0b14e436
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Also prepend a "Error:" label to all strrerror handling locations,
to make it clear where the error starts.
Pick-to: 6.2 6.5 6.6
Task-number: QTBUG-101926
Change-Id: I1a781b4c5716636eff4d47a6c8554dcbd51d2697
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Not adding internal modules to the windeployqt module list makes it
give off nonsensical warnings, and can force the deployment of debug
libraries despite a --release tag. Add them in to prevent this, and
shave off the "Private" part of the module name if it exists to maintain
compatibility.
Fixes: QTBUG-114854
Pick-to: 6.6 6.5
Change-Id: I884fdc495f340ad20ba6257587da170d6c1a1415
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
qt_internal_add_tool has the implicit logic that disregards the
previously installed flags and adds new flags that overrides the
exceptions behavior. Add the tool-specific option to make sure
that this won't happen.
Ammends 0f5fbe369b
Pick-to: 6.6 6.5
Change-Id: Id149d8d8002390581813475124ba37dd39d56b9b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Use this format when reporting diagnostics relating to a source file:
<file name>:<line>:<column>: {error|warning|note}: <message>
This makes it easier to find the source elements that caused
a diagnostics report.
Fixes: QTBUG-2597
Change-Id: I8d8d13f7d71d1ce0c5050a0d08dddd33f9997f27
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For better OOP code structure and to get overview
over functions that need this shared state.
Task-number: QTBUG-2597
Change-Id: Ib3a26a1116362c3c798052b6bce8db2062451bdb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add a structure for annotation data containing
name, value and location information. This is done
to be able to emit diagnostics related to annotations
that include source location.
Task-number: QTBUG-2597
Change-Id: Ie990bcd0a16752b5f44f4314f8d730dd1b1a30b4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
syncqt uses iostream API that 'excepts'. So enable exceptions flags
when building it.
Amends 49ce711796
Pick-to: 6.6 6.5
Change-Id: Ib0cd581eaec9ae73edc9de423019098304049463
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Because an unnamed namespace, and variables inside it, have internal
linkage[1]; and the variable is constexpr in this case so static
redundant.
This fixes a clang-tidy warning:
readability-static-definition-in-anonymous-namespace
[1] https://eel.is/c++draft/basic.link#4
Change-Id: I95600214cd51b03872ee22995d93d1b5658d5a18
Task-number: QTBUG-112870
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Deprecated Qt header files generated by syncqt were missing in
installation package of Qt, after migration to cpp based syncqt.
Restore them.
Note: we didn't receive bugs since 6.5 release so far. I would check
the existing files and remove them completely in 6.7. See QTBUG-115029.
Pick-to: 6.5 6.6
Fixes: QTBUG-112956
Change-Id: I2e5375ee0dbd87a76135594cd489bb67f6d3456d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
qt_no_master_include is not used in the deprecated headers since
are generated by syncqt, are never scanned and master include logic
is controlled by syncqt.
Pick-to: 6.5 6.6
Change-Id: If6f737938abe67349c8f88387ccb5efdb95afabd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We want syncqt to be built optimized by default. The current approach
set the default build type for the external projects and optimized
flags for the non-configure-time syncqt build. The problem is that
syncqt still have compiler flags littered by either the Qt configuration
type or the system defaults that are applicable for RelWithDebugInfo
configuration(the default one we chose for syncqt).
This patch makes sure that we cleanup all compiler flags from any
optimizations and apply optimized flags for all configurations. Also
we discard '/RTC1' flag if it's set. Configure time executables now
respect the language related flags that are set in the project and
adjust the flags passed to try_compile.
For linker flags we should use those that are applicable for the
preferred build type. Since syncqt is built in RelWithDebugInfo
by default we should replace linker flags in all configs with
those are used for RelWithDebugInfo configuration.
Fixes: QTBUG-114925
Pick-to: 6.5 6.6
Change-Id: I782f81a36f5ef7ee4d342ce8ac6c217cb2552f3b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The syncqt tool was originally designed to run at build time, as a
part of dependency chain of Qt modules. This works well unless we need
the code model of the Qt project in IDE, since Qt source code actively
uses header aliases, and creating them at build time breaks the code
model until the initial build is done. So we made syncqt the configure
time tool to not break the developer experience.
It's more likely that developers build Qt using command line or don't
need the code model before the first build. So running the tool at
configure time should be optional.
QT_SYNC_HEADERS_AT_CONFIGURE_TIME switches the "mode" of the syncqt
tool from build time tool to the configure time tool. Without the
option enabled build procedure runs all the syncing targets at build
time only. The exception are the developer builds, if the
'-developer-build' option is enabled, QT_SYNC_HEADERS_AT_CONFIGURE_TIME
is set to TRUE by default. This gives better development experience for
the developers that don't use the code model in their IDE or don't
require it before the first build is finished. Also this build time
mode is preferred for the CI or similar build procedures where code
model is not required at all.
By default, the option initialized from the
QT_INTERNAL_CONFIGURE_FROM_IDE CMake variable.
TODO: The option is forced to TRUE for the static Ninja Multi-Config
builds. See QTBUG-113974 for details.
[ChangeLog][Build System] When building Qt from sources, syncqt and Qt
header files are now created at build time, not configure time. This
should speed up the configuration step. You can set the CMake variable
QT_CONFIGURE_TIME_SYNC_HEADERS to ON to use the previous behavior,
though. The old behavior is also preserved if cmake/configure is run
from inside an IDE - Qt Creator, Visual Studio Code, and CLion are
currently detected.
Task-number: QTBUG-111163
Task-number: QTBUG-109792
Pick-to: 6.6
Change-Id: Ib61bda9546e58492be874a8591c37e100313d02c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Basically an adjusted version of findD3dCompiler() that looks for two, not one, DLLs. The logic is the same, with added support for ARM64, though this has not been verified in practice.
Fixes: QTBUG-114789
Change-Id: I1fec51fc98a5146e2770e13cf2f3b160ac4282d6
Reviewed-by: Jonas Karlsson <jonas.karlsson@qt.io>
The concatenated byte array is already the "size" we want.
Drive-by change: use QByteArray::sliced()
Change-Id: Id0afb45ae1daf08bd125230eef0734770c645e1a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Change Generator::generateSignal() to take by const FunctionDef*, so
that it can be called with the return of QList::at().
Change-Id: I5ffb0726a5ded6561e0000a2bea1973ada675152
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
No need to copy the 3 QLists to iterate over them.
Change-Id: Id0fc7d39012bdaa78e51b1153565df77c7fb889a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
By handling the special case before entering the loop, then it can
become a range-for, which fixes a narrowing conversion warning, and it
becomes more readable.
Change-Id: I6ce0181c95eae01a4f2bb7cd12fb5cbeba378586
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Yes, the code now uses two loops, but it's slightly better than
erasing-during-iteration; the alternative is using e.g. a while loop and
advancing an iterator manually with operator++() (in two separate
locations, since there would be a `continue` statement) or with the
return value of QList::erase (in one location).
Change-Id: I119d0e61bc06396f2158ecf9f4ae84a76d9bce7b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Instead of changing the "index" member then restoring it, add a
symbolAt() method to get the Symbol in question, and pass it to
new warning() overload.
Change-Id: Ie84a6cf4d837f4ed694f617100e9556c2fc2eea3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>