Commit Graph

2051 Commits

Author SHA1 Message Date
Thiago Macieira
e418a9b9bf syncqt: remove newline before endl
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>
2022-10-02 16:46:56 -07:00
Alexey Edelev
658c166f96 Add 'warnings are errors' functionality to syncqt.cpp
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>
2022-10-01 16:24:01 +02:00
Kai Köhne
24d5290133 syncqt: Fix -help option
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>
2022-09-30 19:01:40 +02:00
Sona Kurazyan
fce36ac866 Rename the header qenvironmentvariables.h -> qtenvironmentvariables.h
Change-Id: I8153c856c2cd93ec6932cd7dd5e9d7273d5712dd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-09-30 14:19:17 +02:00
Edward Welbourne
fdd1d54bc4 Add missing include to syncqt/main.cpp
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>
2022-09-28 21:47:14 +02:00
Mate Barany
6a581bc89e rcc: Drop extra QString()
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>
2022-09-28 16:13:51 +02:00
Mate Barany
18ecd62aaa windeployqt: Use default constructor of QString and then append
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>
2022-09-28 16:13:51 +02:00
Mate Barany
3d9013c5f9 windeployqt: Fix mismatches between string types and literals
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>
2022-09-28 16:13:51 +02:00
Joerg Bornemann
fad4bcad5e windeployqt: Prepend Qt's bin dir to PATH instead of appending
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>
2022-09-28 09:51:47 +02:00
Joerg Bornemann
38ca72ab5e windeployqt: Fix PATH manipulation code for non-Windows platforms
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>
2022-09-28 09:51:43 +02:00
Alexey Edelev
b89d63515b Replace the syncqt.pl script with syncqt tool
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>
2022-09-27 13:12:11 +02:00
Alexey Edelev
24f68a0deb Fix condition that runs the scanning of the Qml imports
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>
2022-09-27 02:50:24 +02:00
Fabian Kosmale
5222df2be7 moc: Add basic support for nested inline namespaces
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>
2022-09-26 21:14:39 +02:00
Mate Barany
84ae970c6d qdbusxml2cpp: Modify return values
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>
2022-09-24 16:33:38 +00:00
Mate Barany
65c40615d1 qdbusxml2cpp: Drop extra QString()
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>
2022-09-24 12:38:32 +02:00
Mate Barany
ac2154c7e9 qdbusxml2cpp: Remove unnecessary lines
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>
2022-09-24 01:30:48 +02:00
Mate Barany
c2df659c8d qdbusxml2cpp: Fix mismatches between strings and string literals
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>
2022-09-23 13:53:27 +02:00
Ulf Hermann
00b9409843 Android: Disable androidtestrunner extra timeout
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>
2022-09-21 14:00:37 +02:00
Friedemann Kleint
3696c99a9a uic: Add an option to modify the generated resource import
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>
2022-09-15 17:57:54 +02:00
Rafael Roquetto
c3b05dfbc3 tracegen: add qint64 support
Change-Id: I4f4c5430ce86e364819ae35f3089bacf1d253484
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-09-15 16:15:28 +10:00
Mate Barany
a1e7c6421c uic: change the first parameter of pixCall to Q1LSV
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>
2022-09-14 23:04:25 +02:00
Mate Barany
68d041d27d uic: use QString::compare in toBool
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>
2022-09-14 18:53:39 +02:00
Mate Barany
8d7d210aa5 uic: Change some QLatin1String literals to QString literals
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>
2022-09-14 14:25:38 +02:00
Mate Barany
84c494d0f2 uic: Fix mismatches between QString/QLatin1StringView
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>
2022-09-12 20:28:10 +00:00
Friedemann Kleint
d1175e20cf uic: Remove trailing blanks generated into Python icon code
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>
2022-09-07 19:17:55 +02:00
Friedemann Kleint
2ac733832d uic: Add QPdfView
Generate the correct header and Python import for the class.

Pick-to: 6.4 6.4.0
Change-Id: I3682b1659e73e0ccd35b617632a56a5c14715cde
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-09-07 15:53:19 +02:00
Rafael Roquetto
42c1e3c334 Revert "Fix build with -trace lttng"
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>
2022-09-07 22:39:25 +10:00
Mate Barany
aa99bf532d qdbusxml2cpp: modify the behavior of -m/--moc option
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>
2022-09-06 11:44:22 +02:00
Rafael Roquetto
5d58aee53a tracegen: add support for QSize
Change-Id: I7228f5ebbcbd577a66a7a368fb4d64c4c7e55a25
Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-09-03 16:03:29 +10:00
Michael Brüning
aed7b5f370 Reland macdeployqt: Don't copy .prl files into the Resources folder
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>
2022-09-02 12:04:23 +02:00
Michael Brüning
60b069471d Correct typo in destination path variable names
A couple of variables contained "Destianation" instead of "Destination"

Change-Id: I98a15652347d1b0dad640bc49925ec296830147b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-09-02 12:04:18 +02:00
Jonas Kvinge
2e8c84cda2 macdeployqt: Fix deploying libraries with reexport
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>
2022-09-01 19:03:00 +02:00
Thiago Macieira
f123212880 RCC: fix zlib compression when --no-zstd was specified
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>
2022-08-31 16:55:00 -03:00
Ivan Solovev
35a50491e7 QtBase tools: port away from deprecated qSetGlobalQHashSeed(0)
Use QHashSeed::setDeterministicGlobalSeed() instead

Task-number: QTBUG-105102
Change-Id: Ib7d4b6e7bca89870913a140d68bbdd6018e8f8ed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-08-30 22:46:34 +02:00
Tor Arne Vestbø
1bc7e9e77b Add QComHelper class for dealing with COM on Windows
Unifies our approach to calling CoInitializeEx and CoUninitialize,
removing a lot of boilerplate in the process, and also fixes a few
bugs where we would incorrectly balance our calls to CoInitializeEx
and CoUninitialize.

The optimistic approach of qfilesystemengine_win.cpp of calling
CoCreateInstance without initializing the COM library explicitly
has been removed, as calling CoInitializeEx should be a noop in
the situation where it's already been loaded.

Change-Id: I9e2ec101678c2ebb9946504b5e8034e58f1bb56a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-08-29 15:39:34 +02:00
Joerg Bornemann
ef1ff65b0a windeployqt: Directly access the 'relocatable' config feature
Before, we added the preprocessor define QT_RELOCATABLE if the
relocatable feature was set and checked for the define in the source
code.  This indirection is unnecessary.

Also, widen the scope of the feature check to avoid some unnecessary
code.

Change-Id: Ib5f38bf310699d528efdd24edbf14b861bf33935
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-08-25 19:37:29 +02:00
Lucie Gérard
32df595275 Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-23 23:58:42 +02:00
Marc Mutz
4906b43b00 QCoreGlobalData: remove
Inline the data members into the only remaining user (qdir.cpp) and
remove the class.

As a drive-by, fix the non-idiomatic use of QT_BUILD_CORE_LIB to mean
!QT_BOOTSTRAPPED and apply the guard consistently to the declaration,
too.

Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-105747
Change-Id: If2c780dd96e2a2e331cabdc42fd920874e7737b0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-21 08:29:37 +02:00
Thiago Macieira
e163c49435 qdbusxml2cpp: remove the old "In"-for-signal compatibility code
This led to an infinite recursion in case the annotation was completely
missing. Instead of trying to fix that, I'm simply implementing the
"### Qt6" request from c62f717226 .

[ChangeLog][qdbusxml2cpp] Removed the old compatibility code that
accepted "In" annotations for signal argument names, introduced in Qt
5.8.

Pick-to: 6.4
Fixes: QTBUG-104722
Change-Id: Ie4bb662dcb274440ab8bfffd1709bfc3daf0846d
Reviewed-by: David Faure <david.faure@kdab.com>
2022-08-16 16:05:25 -07:00
Thiago Macieira
478b1afbe1 qdbusxml2cpp: be consistent in the annotation suggestion
Some lines were suggesting the method name as context, while most of the
others were the parameter or property name.

Pick-to: 6.4
Change-Id: Ie4bb662dcb274440ab8bfffd1709c0a71abc27dc
Reviewed-by: David Faure <david.faure@kdab.com>
2022-08-16 16:05:25 -07:00
Assam Boudjelthia
edc024e826 Android: handle quoted args passed to an app
Currently, arguments passed to the app through applicationArguments
extra bundle treat every space as an argument separator. This then
doesn't handle the case where an argument is a space separated quoted
multi-word. This is more apparent when androidtestrunner is passing
test arguments to the app where an argument can be a test case with
a data tag that contains a space, which then is treated as two separate
tag names.

This change makes sure that androidtestrunner quotes each argument,
and the app doesn't split the arguments list by spaces, but rather
passed the argument string directly to c++ where
QProcess::splitCommand() is used to get the correct set of arguments
that will be passed to main().

Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-104730
Change-Id: I45d8ca979d90f2a383c84623f0eb2eec29bba727
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2022-08-11 13:21:44 +00:00
Alexey Edelev
16d5468779 Add pragma qt_no_master_include to the qvulkanfunctions header file
This is required to make the header file self-contained from the
syncqt procedure point of view.

Change-Id: Ic32e12bc914c62b907bbc75909d9b4e26994d696
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-08-08 22:34:42 +02:00
Sona Kurazyan
b3fd4b8adf Extract header qassert.h from qglobal.h
For now qassert.h is included in the middle of qglobal.h, since some of
the code below needs it, but this will be cleaned up when that code is
moved in its own header.

Task-number: QTBUG-99313
Change-Id: I2cdfed44f5c8772c1dad4797cf8edc6cb4c964b4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-08-05 15:54:06 +02:00
Thiago Macieira
7ceba9c472 moc: use C++ constexpr to generate the meta object string data
This avoids having to rely on moc precalculating everything and getting
its sums right, as the main integer table only has a string index
(unlike my original 5.0 plan which would have stored the offset).

For example, for:

  struct Object : QObject { Q_OBJECT signals: void changed(const QVariant &v); }

moc now generates:

  struct qt_meta_stringdata_Object_t {};
  static constexpr auto qt_meta_stringdata_Object = QtMocHelpers::stringData(
      "Object",
      "foobar",
      "",
      "v"
  );

Notes on the implementation:

* the old code is retained because we need moc 6.5 to generate code
  compatible with QtCore 6.2-6.4. It's marked for removal in Qt 6.9.
* the struct qt_meta_stringdata_%s_t remains because we need a
  TU-specific type for QtPrivate::is_complete (via
  qt_incomplete_metaTypeArray). This can be cleaned up.
* after this change, GDB complains while loading QtCore:
    warning: internal error: string "StringData<long sequence of numbers>" failed to be canonicalized
  but debugging does not appear to be impacted. It's just annoying
  because it shows up when QtTest detects a crash too.

Change-Id: Id0fb9ab0089845ee8843fffd16f9d5493e9bd708
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-04 12:50:12 -07:00
Thiago Macieira
c23b595769 moc: move some of the helpers into a header dedicated to it
Change-Id: Id0fb9ab0089845ee8843fffd16f9d080029f2f7f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-08-04 12:50:12 -07:00
Laszlo Agocs
651092c218 Bump QVulkan(Device)Functions to Vulkan 1.3
Update vk.xml to 1.3.223 and make qvkgen output the Vulkan 1.3 functions
as well.

[ChangeLog][QtGui] QVulkanFunctions and QVulkanDeviceFunctions are
updated to expose the Vulkan 1.3 API as long as the build environment's
vulkan.h is 1.3-capable.

Fixes: QTBUG-105270
Change-Id: Iabe04f0a74cdbd94efcc1869f545da058a553fed
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-08-04 03:35:36 +02:00
Fabian Kosmale
84ab6c1aa1 moc: handle attributes in class declarations
We already had code to handle attributes on funtcions, but we didn't
handle them correctly for classes so far.
Fix this by simply skipping over the attribute.

Fixes: QTBUG-105310
Pick-to: 5.15 6.2 6.3 6.4
Change-Id: Ic4149f940e74820de4f2fa9540d9dc5b4e626a3a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-03 20:14:42 +02:00
Lucie Gérard
fb1b20eab3 Add license headers to cmake files
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: I3b98cdc55ead806ec81ce09af9271f9b95af97fa
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-03 17:14:55 +02:00
Sona Kurazyan
908d048e4f Extract header qenvironmentvariables.h from qglobal.h
qcontainerfwd.h was relying on the forward declaration of QByteArray in
qglobal.h, so add the missing forward declaration there.

Additionally, had to move the implementations of qTzSet() and qMkTime()
to qenvironmentvariables.cpp along with environmentMutex.

Task-number: QTBUG-99313
Change-Id: I233aff305c2fedaf0a48362cc99ff2d6f6c0ee54
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-07-29 23:04:21 +02:00
André Klitzing
7da51c14d9 Fix build with missing qml-root-path
Commit 42d0089d44 added support
for multiple root paths. This works fine but it also added
"options->inputFileName" as fallback if nothing was provided.

The inputFileName cannot be used as root path (directory).
So let's use absolutePath() of that file.

Pick-to: 6.4 6.3 6.2
Change-Id: Id76a2cd79a82966bdac8240644b3c03ac4248066
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-07-28 14:46:52 +02:00