Commit Graph

2275 Commits

Author SHA1 Message Date
Alexey Edelev
630d3328dd Iterate over all extraPrefixDirs when collecting "directories"
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>
2023-09-15 12:48:57 +02:00
Alexey Edelev
09c46d63af syncqt: Generate the deprecated header in the framework directory too
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>
2023-09-12 16:33:56 +02:00
Alexey Edelev
cab5ede6a3 syncqt: Mark updateOrCopy as exception free
Pick-to: 6.5 6.6
Change-Id: I4ac468ef503775bca7d3848d26b42990bb4fdd1a
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-09-12 16:33:34 +02:00
Alexey Edelev
9f3e7aaf17 syncqt: Catch fs exceptions that happen when clearing staging directory
Pick-to: 6.5 6.6
Change-Id: I1617f0940e1b1d892d321fc6f5df11262ee1f288
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-09-12 16:33:31 +02:00
Alexey Edelev
a86fb92d4b syncqt: Add the missing is_open check to writeIfDifferent
Pick-to: 6.5 6.6
Change-Id: I2a969483d20f250083c1a262bd3bfc696a7f0df4
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
2023-09-12 16:33:27 +02:00
Alexey Edelev
e9ca247479 syncqt: Add the missing file stream close calls
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>
2023-09-12 16:33:24 +02:00
Alexey Edelev
7164cce881 syncqt: Handle possible exceptions thrown by std::filesystem::create_directories
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>
2023-09-12 16:33:20 +02:00
Anu Aliyas
8c468fc2ab [windeployqt] Copy v8 context snapshot
- Copy v8 context snapshot while creating package with windeployqt

Fixes: QTBUG-116777
Change-Id: I707e1d147ebf0ba5ee63dd25218e23ac850efe45
Pick-to: 6.6
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
2023-09-12 02:47:57 +02:00
Alexey Edelev
7a70c6fcfd Require the C++17 standard for configure-time syncqt
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>
2023-09-11 15:05:47 +02:00
Anton Kudryavtsev
9c819c9073 tools: use const methods more
to avoid implicit detach

Change-Id: I6268d4397631a2a2ff54263dfd0b28a7990c5993
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-09-08 19:17:36 +03:00
Jonathan Ketchker
55f0738f16 Add StateLocation & GenericStateLocation to StandardLocation
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>
2023-09-07 01:17:13 +03:00
Ahmad Samir
ac9e968755 Remove redundant QPair includes
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>
2023-09-06 17:24:40 +00:00
Christian Strømme
9c3c87f6d0 Add enablers to expose semi-public APIs for QtQuick3D
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>
2023-09-05 13:42:50 +02:00
Alexey Edelev
3115610cfa syncqt: Close ifstream before attempt to remove file
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>
2023-09-02 10:25:55 +02:00
Ahmad Samir
7e7f296e97 QCBorDevice: add missing #include
For uchar. Otherwise static analyzers, e.g. clazy, complain about
unknown types.

Change-Id: Ie6a91f6e33eb9149b2d0188069edc2aa8f64a55b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-09-01 01:30:35 +03:00
Alexey Edelev
7e84a04563 Allow generating deprecated header files cross-module
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>
2023-08-29 16:35:09 +02:00
Fabian Kosmale
7f9d213765 moc: Drop support for function declaration without type specifier
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>
2023-08-26 12:13:08 +02:00
Oliver Wolff
68b16974a7 Remove elfreader and other unix leftovers from windeployqt
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>
2023-08-22 11:15:13 +02:00
Aaron McCarthy
c27798da2f androiddeployqt: Fix generation of qtDataDirectory
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>
2023-08-15 16:18:41 +00:00
Thiago Macieira
56bd5d60c9 Fix registration of QtDBus types' metatypes
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>
2023-08-14 20:19:36 -07:00
Fabian Kosmale
c4bb02ce62 moc: Remove remnants of USE_LEXEM_STORE
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>
2023-08-10 10:17:45 +02:00
Marc Mutz
d7dc4d3ebb macdeployqt: port away from Q_FOREACH and mark the tool free of it
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>
2023-08-05 22:42:20 +02:00
Ievgenii Meshcheriakov
8d89b4ef21 qdbuscpp2xml: Support MEMBER field of Q_PROPERTY
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>
2023-08-03 16:09:17 +02:00
Fabian Kosmale
f0039bd517 moc: handle "L" integer suffix
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>
2023-07-28 12:23:53 +02:00
Oliver Wolff
ae7bc8803f windeployqt: Do not deploy insighttracker plugin by default
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>
2023-07-27 11:50:13 +02:00
Alexey Edelev
ea4a3d78a7 Make sure that the 3rdparty directory belongs to the module
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>
2023-07-19 21:06:12 +02:00
Alexey Edelev
f73249b94d Put arguments in correct order in syncqt parseVersion
Amends 4d4e74e1bcad47476b947b6e3781b046f9505f83

Pick-to: 6.6
Change-Id: Ie3a0147b414303c528b78c20f6502b83c5102344
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-07-19 14:16:55 +02:00
Alexey Edelev
4bc0a08bea Add the 'version' argument to 'qt_deprecates' pragma
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>
2023-07-12 21:58:26 +02:00
Alexandru Croitor
3ba3f322b6 moc: Print sterror(errno) when moc can't write the output file
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>
2023-07-12 17:48:48 +02:00
Alexandru Croitor
dd1b7b5539 moc: Store errno after fopen call
To avoid QFile::encodeName() potentially overriding the value.

Pick-to: 6.2 6.5 6.6
Task-number: QTBUG-101926
Change-Id: Ie751df877d6624238ded344474b5eccc324ec541
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-07-12 17:48:48 +02:00
Timothée Keller
87bfd33082 Windeployqt: also add internal modules to module list
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>
2023-07-12 11:24:30 +02:00
Alexey Edelev
d4e3d008fe Make sure that exception flags are not overridden in syncqt tool
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>
2023-07-10 14:53:34 +02:00
Ievgenii Meshcheriakov
b48a588e13 qdbusxml2cpp: Improve error reporting
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>
2023-07-06 21:51:25 +02:00
Ievgenii Meshcheriakov
2f82ba66e2 qdbusxml2cpp: Move shared state to a class
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>
2023-07-06 21:51:21 +02:00
Ievgenii Meshcheriakov
2e8a48c1cd QDBusIntrospection: Add Annotation struct
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>
2023-07-06 21:51:15 +02:00
Alexey Edelev
0f5fbe369b Re-enable exceptions when building syncqt
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>
2023-07-06 12:49:36 +02:00
Ahmad Samir
5a523981f4 Moc: don't make variables inside an unnamed namespace static
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>
2023-07-06 06:28:22 +03:00
Alexey Edelev
97268742e4 Install the missing deprecated header files
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>
2023-07-04 16:53:16 +02:00
Alexey Edelev
afc8260359 Remove redundant qt_no_master_include from deprecated headers
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>
2023-07-03 23:01:58 +02:00
Alexey Edelev
49ce711796 Fix syncqt compiler and linker flags handling
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>
2023-06-29 18:49:45 +02:00
Alexey Edelev
a3ec70a929 Pass CMAKE_OSX_SYSROOT to syncqt CMAKE_FLAGS
Fixes: QTBUG-114803
Pick-to: 6.5 6.6
Change-Id: I2eed5d6a7255eb61eff09d0c9a102e0652e63c0c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-06-28 22:09:20 +02:00
Alexey Edelev
a8cf976ce6 Introduce QT_SYNC_HEADERS_AT_CONFIGURE_TIME flag
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>
2023-06-27 17:27:28 +00:00
Laszlo Agocs
7fee97cb2e Update windeployqt with dxc
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>
2023-06-27 13:58:55 +02:00
Ahmad Samir
8bc1049ad7 Moc: simplify code
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>
2023-06-22 02:20:30 +03:00
Ahmad Samir
475d5266e4 Moc: prevent potential unnecessary detach
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>
2023-06-22 02:20:30 +03:00
Ahmad Samir
17df4bf528 Moc: use a std::initializer_list<QList *> instead of copying
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>
2023-06-22 02:20:29 +03:00
Ahmad Samir
cfc098253a Moc: simplify the logic of a for-loop
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>
2023-06-22 02:20:29 +03:00
Ahmad Samir
0344332c76 MOC: use methods from QtMiscUtils
Change-Id: I20600357841aff36f68bcc9a81bfb3e96bf6e264
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-22 02:20:29 +03:00
Ahmad Samir
8726b6a35a Moc: use QList::removeIf
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>
2023-06-22 02:20:29 +03:00
Ahmad Samir
a993510c9e Moc: simplify showing a warning
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>
2023-06-22 02:20:29 +03:00