It does not depend on QtGui.
Change-Id: If7b01d1a6d2ce3945562f4480177ce883abfdbf4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
It requires QFontDatabase from QtGui. Add more classes from QtGui.
Fixes: PYSIDE-994
Change-Id: Ib84c86e2305fad60560a3f12997eb1e46deb67cb
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
QRegExp includes can be found in several files where there's not even a
use of the class. This patch aims to avoid needless includes as well as
follow the "include only what you use" moto.
This patch removes a QRegExp include from the QStringList header which
means that there is likely going to be code breaking since QStringList
is used in many places and would get QRegExp in.
[ChangeLog][Potentially Source-Incompatible Changes] qstringlist.h no
longer includes qregexp.h.
Change-Id: I32847532f16e419d4cb735ddc11a26551127e923
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Unfold the function with returns to reduce nesting and add language
handling.
Task-number: PYSIDE-797
Change-Id: Ie6c47745b118d75c0bb2c9eea7d52c8f0377f1a6
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Usually, when you load a plugin, you don't want to load just any plugin
that fulfills a given interface, but rather a specific one. When loading
dynamic plugins you can differentiate the plugins by file name. This
doesn't work in the static case, and file names are also separate from
the plugin metadata shipped inside the plugin files.
To solve this problem, different hacks have been developed in various
places. QML extension plugins add a special property "uri" via the -M
option of moc, QML debug plugins expect you to add a json file with
an array of "Keys", Qt Creator plugins have a "Name" in their json
files, etc.
By allowing the identifier for the plugin to be specified inline with
the metadata declaration we can make many of the above workarounds
obsolete and provide a clean way for users to find their plugins.
Task-number: QTBUG-74775
Change-Id: Ie2af16c49d4c5aa5a77fab0fae1e0a4449bd7a39
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Add a helper for replacing "::" by "." for Python.
Task-number: PYSIDE-797
Change-Id: I017d430b0b8b2ffbbd3300d583603924fee4d479
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Use the language helper for dereferencing pointers and end of line.
Task-number: PYSIDE-797
Change-Id: Icbca9015f2a3e8800ad4a56edf8fef9ee43f4528
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Extend WriteInitialization::findDeclaration() to return the class name
(on this occasion preparing for generating Qt 5 connection syntax) and
add a helper function for formatting the connection.
Task-number: PYSIDE-797
Change-Id: I7507f604c8275c93d347b7a6a5d5b5a2a5f3ffd5
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Prepend "self." (this) to the name stored in the class Driver's hashes
as specifying it is mandatory in Python.
Task-number: PYSIDE-797
Change-Id: I1da110b84b2d1131ee6af915f9cc4ba21d7de710
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Refactor the fixString() helper, moving the code into a streamable
class using a helper which can be used for different encodings.
Task-number: PYSIDE-797
Change-Id: I0f82945b6b334da8524882dda2f104327eba79d4
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Add a helper routine to look up the dom classes by attribute name and
change Driver::widgetByName() and Driver::actionByName() to use that
as does Driver::actionGroupByName() (all these functions are called
with names from the XML files).
Remove the name normalization in
WriteInitialization::findDeclaration() and refactor
WriteInitialization::acceptActionRef() to call findOrInsert() to
correctly use the unique name.
Task-number: PYSIDE-797
Change-Id: I34058361964719c442182faf798f055f11b40412
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Subjective, but for me its easier to follow code flow if
indentation is not interrupted.
Change-Id: If811ba1b975189c94a671627be8eb3a1fd67aeb9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
After e89fbd8c, QString depends on QStringView.
Fixes: QTBUG-74340
Change-Id: I9cba49db73b74deca05b9a9ddfeec580f30b5e35
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
moc now successfully parses enum values, that have been deprecated with
[[deprecated]]. This is valid c++17 and should be handled correctly.
By adding that functionality it is possible to parse Windows headers
which use this deprecation mechanism.
To make sure, that moc works correctly even on compilers that do not
support deprecated enum values yet, the auto test explicitly uses
[[deprecated]] enum values during moc run.
Fixes: QTBUG-74126
Change-Id: I7b9d9a49af6093a97f8fdb800ffbc5af3d54d262
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Mark obsolete functions in QString as deprecated so they can be removed
with Qt6:
- QString::sprintf()
- QString::vsprintf()
Change-Id: I9b7748db95291c34b95ff3ad3e3aabc8215aeaae
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
We can parse the namespaces in order to find the enums in them and
populate the related metaobjects of the current file's classes. The
symbol clashes are avoided by only generating metaobjects for namespaces
defined in the same file.
Fixes: QTBUG-71966
Fixes: QTBUG-72069
Change-Id: Ibdf21c3f9dae48d95b0952b3e220b4c29e30ecb8
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Incomplete translation
----------------------
If an application has more than one locale, then all the strings
declared in one language should also be translated in all other languages.
If the string should not be translated, you can add the attribute
translatable="false" on the <string> element, or you can define all
your non-translatable strings in a resource file called donottranslate.xml.
Or, you can ignore the issue with a tools:ignore="MissingTranslation" attribute.
Change-Id: I6f93f34fc36a06de9a0b687a93cf58df941dbbcb
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Conflicts:
tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
Added tests/auto/testlib/selftests/expected_crashes_5.txt to work
round the output of the crashes test (which exercises UB, see
QTBUG-73903) being truncated on one test platform.
Change-Id: I9cd3f2639b4e50c3c4513e14629a40bdca8f8273
For MS Visual Studio we need to use _popen() and _pclose() instead of
the POSIX functions; and the pipe needs to be opened in binary mode.
Change-Id: Ide0fb26a1e5f121b384b0baaf8100f26c614ccc6
Fixes: QTBUG-73810
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
[ChangeLog][qmake] A new feature "cmdline" was added that implies
"CONFIG += console" and "CONFIG -= app_bundle".
Task-number: QTBUG-27079
Change-Id: I6e52b07c9341c904bb1424fc717057432f9360e1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
The evaluation mode of Qt hasn't been used since quite some time. Let's
just remove the remaining logic from the code base.
Change-Id: I61a2c432cbae78bf973f882848b3732e27431351
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This makes it much easier to have the version information set for an
Android APK without having to manually modify the AndroidManifest.xml
each time.
[ChangeLog][Android][qmake] Can now set the version name and code for
Android using ANDROID_VERSION_NAME and ANDROID_VERSION_CODE respectively
in the pro file.
Change-Id: Ie6813bc3a7444f7baa5e772b93bc2695d9b81e57
Done-with: Markus Maier <markus.maier@rosenberger.de>
Reviewed-by: Markus Maier <markus.maier@rosenberger.de>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
In NDKr19 they removed "-strip-all-gnu" argument, now
llvm-strip prints tons of:
.../llvm-strip: error: unknown argument '-strip-all-gnu'.
Change-Id: I11bb2d6abcc5f236730c57b5b93cc932c7ba58c6
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Change b86d0b6215 rearranged the
sequence of function calls when generating code adding QTabWidget
and QToolBox pages, not taking into account that the iconCall()
has a side effect (writing out icon definition) Revert that part
and add a comment.
Fixes: QTBUG-72980
Task-number: PYSIDE-797
Change-Id: Ie8fbaa36f21cd4408fb1f491195da5c260708e6c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
With the current distribution, this is 90% of active devices, and
it was released in 2014. Qt 5.12 is LTS and will continue to support
older Android versions for a long time to come.
This is to reduce the testing needed on outdated platforms and
allow ourselves to use some newer APIs unconditionally in Qt.
Android 21 was chosen because it is the minimum version that supports
64 bit builds.
[ChangeLog][Android] Increased the minimum supported Android version
to Android 5.0 (API level 21).
Fixes: QTBUG-70508
Change-Id: Ia7b4345e42ca05a25a292f11ccbb8cbd692cf8f0
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
There are certain use cases for keeping debug information on the
device, for example collecting stack traces when the app crashes.
[ChangeLog][Android] Added the --no-strip command line option to
androiddeployqt.
Change-Id: I96574c2c57d85fb23d5fc65380e471fa892b6543
Fixes: QTBUG-57771
Reviewed-by: Volker Krause <volker.krause@kdab.com>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Add a extendsOneOf() helper that takes a QStringList to be searched
and simplify the code accordingly.
In WriteInitialization::acceptWidget(), move the variable
CustomWidgetsInfo *cwi up and reuse everywhere to shorten code.
Task-number: PYSIDE-797
Change-Id: I331e135b6aa58dbbd413ca151eb67b3eb92f09c6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Also blacklist tst_QRawFont::unsupportedWritingSystem() and
tst_QGlyphRun::mixedScripts() on windows for now.
Conflicts:
qmake/generators/makefile.cpp
src/corelib/itemmodels/qstringlistmodel.cpp
src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h
tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp
tests/auto/gui/text/qglyphrun/BLACKLIST
tests/auto/gui/text/qrawfont/BLACKLIST
Task-number: QTBUG-72836
Change-Id: I10fea1493f0ae1a5708e1e48d0a4d7d6b76258b9
C++11 added the new enum class key as well as enum struct. While the
former is likely the most known and used, the later can be used in the
same contexts and with the same effects.
Currently moc doesn't parse enum struct while it does for enum class.
This patch fixes this.
[ChangeLog][moc] moc now parses enum struct the same way as enum class
therefore that keyword can be used with the Q_ENUM macro as well as
Q_FLAG and Q_DECLARE_FLAGS.
Change-Id: Iaac3814ad63a15ee4d91b281d451e786b510449c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Change ebd3a13b80 introduced a new
QPaletter::PlaceholderText color role which causes the uic-generated
code not to compile when using Qt Designer embedded in Qt Creator with
older (5.9 LTS) kits. Generate a version check macro to fix this.
Change-Id: I6d9f7edb0c6047c2f64ef3357b29f91655c52aac
Fixes: QTBUG-72555
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Use the standard variable name in addition to the QT-specific one
to make builds reproducible out-of-the-box.
See https://reproducible-builds.org/ for why this is good
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
Task-number: QTBUG-62511
Change-Id: I401a2a9d258e751b83ae7b83f4100d9088b9ad71
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Change the API to take const Dom * classes and use a helper
function to do the insertion.
Task-number: PYSIDE-797
Change-Id: I079f5c92bae85d6246c14077db06e381b572cda5
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Add a lookup for the affected enum values and use the names instead.
Task-number: PYSIDE-797
Change-Id: I6be166409000aff83d9465c9a3b2f37b44c5c085
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This solution is composed of two features:
1) C++ code generated by RCC uses two symbols exported from QtCore that
are only present if the feature was compiled in. If the feature was not
compiled in, this will cause a linker error either at build time or at
load time (if they were functions, the error could be at runtime).
2) Binary files generated by RCC have a new header field containing
flags. We're currently using two flags, one for Zlib and one for
Zstandard.
This means we now have binary RCC format version 3.
Change-Id: I42a48bd64ccc41aebf84fffd156545fb6a4f72d9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
- Do not use QString::number() to stream numbers.
- Do not use QLatin1String/Char to stream strings or characters.
- Add a convenience methods to determine the container page add method
for simple containers.
- Similarly, extract a method to determine the layout method and
simplify the code accordingly.
- Fix Clang warnings about else if after return/continue.
- Use QString::isEmpty() instead of size() to check emptiness.
- Fix QHash-contains()/value() Antipattern
Task-number: PYSIDE-797
Change-Id: I9c61d20f46c8d142b947126a27faaf54b41f9e0c
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
The script was happily ignoring all errors, relaying on a user reading
output.
Change-Id: I85edd228a40b5459c4649ab0c0bbbe3042a3abf5
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This compression algorithm is permitted in the XML sources, which
instructs RCC to apply the best compression algorithm it has available.
If we have Zstandard available, that's its level 19 (levels 20 and up
are experimental). If not, we apply zlib compression level 9.
And apply this technique for the XDG MIME database that is built-in to
QtCore.
Payload size Compr. time
Previously 313916 17.9ms
Zlib -9 310899 53.6ms
Zstd -14 253364 63.3ms (plus 4.0 ms on L1 heuristic check)
Zstd -19 230647 642.5ms
Change-Id: I343f2beed55440a7ac0bfffd1562de44dbaf09cd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
[ChangeLog][RCC] RCC now supports compressing content using the
Zstandard (https://zstd.net) algorithm. Compared to zlib, it compresses
better for the same CPU time, so this algorithm is the default. To go
back to the previous algorithm, pass command-line option
--compress-algo=zlib. Compression levels range from 1 (fastest, least
compression) to 19 (slowest, best compression). Level 0 tells the
library to choose an implementation-defined default.
\
The default compression level is "heuristic" (level -1): under this
mode, RCC will attempt a very fast compression (level 1) and check if
the file was sufficiently compressed. If it was, then RCC will compress
again using an implementation-defined level.
The following are the 4 biggest files we store as resources in qtbase:
Orig Size Name
2197605 src/corelib/mimetypes/mime/packages/freedesktop.org.xml
2462423 tests/auto/corelib/tools/qchar/data/NormalizationTest.txt
6878748 tests/auto/other/qcomplextext/data/BidiCharacterTest.txt
7959972 tests/auto/other/qcomplextext/data/BidiTest.txt
The current RCC (zlib, level -1 "default" and level 9), produces for
those files:
L(-1) Compr. L9 Compr. Decomp.
Name Ratio CPU time Ratio CPU time CPU time
BidiCharacterTest.txt 16.9:1 106.1ms 17.2:1 789.3ms 5.1ms
BidiTest.txt 6.3:1 228.0ms 6.1:1 1646.3ms 10.9ms
freedesktop.org.xml 7.0:1 17.5ms 7.1:1 53.6ms 2.6ms
NormalizationTest.txt 5.8:1 41.2ms 5.9:1 256.4ms 3.4ms
Zstandard produces the following for levels 1 ("check"), 14 ("store")
and 19 ("best"):
L1 Compr. L14 Compr. L19 Compr. Decomp
Name Ratio time Ratio time Ratio CPU time time
BidiCharacterTest.txt 15.8:1 8.0ms 26.1:1 168.9ms 49.2:1 2504.7ms 3.8ms
BidiTest.txt 8.2:1 17.0ms 8.7:1 323.9ms 14.9:1 1700.9ms 12.1ms
freedesktop.org.xml 6.7:1 4.0ms 8.7:1 63.3ms 9.5:1 642.5ms 1.7ms
NormalizationTest.txt 5.7:1 5.0ms 7.5:1 54.0ms 8.4:1 447.3ms 3.0ms
This shows use of zstd at the default RCC level settings always produce
smaller outputs compared to the current zlib-based defaults, with
roughly 50% CPU increase. It also produces better results at less CPU
time than the best compression zlib has to offer.
More importantly, the decompression time reduces in all cases (the
numbers listed are for max compression, with slightly better results for
the defaults).
For the sake of comparison, the same files compressed with libxz at
levels 3 and 6:
Level 3 Level 6 Decompr.
Name Ratio CPU Ratio CPU time
BidiCharacterTest.txt 28.5:1 109.1ms 42.9:1 1390.5ms 16.7ms
BidiTest.txt 10.7:1 281.0ms 18.4:1 2333.1ms 43.6ms
freedesktop.org.xml 9.1:1 62.0ms 10.2:1 499.1ms 12.0ms
NormalizationTest.txt 10.2:1 75.5ms 13.2:1 417.6ms 14.7ms
LZMA at level 3 consumes roughly the same CPU time as Zstd at level 14
and produces incrementally smaller results, but the decompression time
increases considerably. It's not a good trade-off for the Qt resource
system.
Change-Id: I343f2beed55440a7ac0bfffd1562d754bd71d964
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
See next commit for details on why this is a good idea.
[ChangeLog][Important Behavior Changes] The Qt resource system now
supports compressing content using the Zstandard (https://zstd.net)
algorithm. Compared to zlib, it compresses better for the same CPU time,
so this algorithm is the default. QResource::isCompressed() returns true
for either compression algorithm. Use QResource::compressionAlgorithm()
to find out which algorithm to decompress. QFile will automatically
decompress using the correct algorithm.
Change-Id: I343f2beed55440a7ac0bfffd1562e9a8f94933a7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Instead of using compression level -2 to indicate no compression,
introduce CompressionAlgorithm::None and an equivalent XML attribute.
This commit includes some extra error checking for RCC.
Change-Id: I343f2beed55440a7ac0bfffd1562d64b024463ba
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
places indicated by clazy
As a drive-by, fixed minor styling issues in the affected lines.
Change-Id: I88d3fc0c8573cde0e61f19a18dd9ea697ee40c34
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Luca Beldi <v.ronin@yahoo.it>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
corelib/serialization/qcbormap.h:176:14: warning: Missing reference in range-for with non trivial type (QPair<QCborValue, QCborValue>)
corelib/serialization/qjsoncbor.cpp:820:10: warning: Missing reference in range-for with non trivial type (QJsonValue)
gui/kernel/qguiapplication.cpp:1171:10: warning: Missing reference in range-for with non trivial type (QString)
printsupport/dialogs/qprintdialog_unix.cpp:741:10: warning: Missing reference in range-for with non trivial type (QString)
printsupport/kernel/qprinter.cpp:1851:10: warning: Missing reference in range-for with non trivial type (QVariant)
tools/qlalr/cppgenerator.cpp:463:8: warning: Missing reference in range-for with non trivial type (Name)
Change-Id: I327b0f116e329e55952ed5740a5f5af4b2918392
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This will be the only options for Qt 6, so make sure the code compiles now.
Change-Id: I23f791d1efcbd0bd33805bb4563d40460954db43
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
In NDKr18 Google removed GCC, most probably the massacre will not end
there and they will remove all GNU tools, so we need to start using LLVM
ones.
This patch still keeps the compatibility with GNU tools if the Qt was
built with android-g++ mkspec.
Change-Id: Ibe1979577e08ce63604d55fc5bbd5f64b3737675
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Previously, the generation of this code was #ifdefed in uic itself.
However, the #ifdef should be in the generated code (anticipating
the cmake port where host and target builds might differ).
Task-number: PYSIDE-797
Change-Id: I46255f852f5f6a3d95d3a20456b6f00f2067a3fe
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Replace the generation of #ifdef's for the macros by QT_CONFIG
checks. Implement it using streamable classes to make it easier
to switch the output language later.
Task-number: PYSIDE-797
Change-Id: I28b5ed3ec80cd525a3df0cd54d9be4f09149cde4
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
When passing \ to Gradle it will strip these out, so by using / it
ensures that it is able to find the Android SDK directory fine.
Change-Id: I053f087438ade6c30d015abe00e9958beb90a947
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Makes clang-tidy not trip over generated code while running the
modernize-use-auto checker. In theory clang-tidy just shouldn't look at
generated code of course; but in this case just modernizing the
generated code is easy, so let's do it.
Example:
.../moc_kastentoolviewwidget.cpp:78:9: warning: use auto when initializing with
a cast to avoid duplicating the type name [modernize-use-auto]
KastenToolViewWidget *_t = static_cast<KastenToolViewWidget *>(_o);
^~~~~~~~~~~~~~~~~~~~
auto
Change-Id: I10c287320e1d5b5b8e66da3e0a22d517d0275dd1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Also clean up QTextCodec usage in qmake build and some includes
of qtextcodec.h.
Change-Id: I0475b82690024054add4e85a8724c8ea3adcf62a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Preparing the use of the option for Python.
Task-number: PYSIDE-797
Change-Id: Ia1267b227ceac7f9dcbcfde6ed7c1480ef790f2a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
After qtbase/550d2a0a15c9403894448ab83863e71bbac2d349,
pixmap functions are used for icons as well which can cause compile
errors for old UI files that still use them.
Task-number: QTBUG-8563
Change-Id: I61bd4b9c1bf774e071a35c5806657054a77ff4d0
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Make the code consistent with the DomProperty::write() method.
Task-number: QTBUG-70613
Change-Id: I622b4a019a4473823584de97304f8324f2cf0c6b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Moc shouldn't artificially introduce calls to possibly overloaded
operator&. It can cause odd side effects in a user code.
Change-Id: Iaa1b491fe6a1a5ebd4dfa1172359dc792cc7604f
Fixes: QTBUG-68191
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
On platforms where char is signed, like x86, the following is an error
(narrowing conversion):
unsigned char x[] = { '\xc3' };
Change-Id: I495bc19409f348069f5bfffd15518f9ef4e43faf
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's more optimised and it vectorizes better, due to one level of
indirection fewer.
Change-Id: I495bc19409f348069f5bfffd1551e85092ed8dc2
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
...not just the debug flag. The information is saved outside of the CBOR
map for two reasons:
1) removing the hack that depended on how QCborStreamWriter and
TinyCBOR internally work, allowing for the extra parameter to be
written directly. We wouldn't be able to use that hack anyway and would
have needed a further, uglier hack to encode a byte whose value we
don't know.
2) outside the map, this information can be parsed more quickly and
then we can discard any plugins we shouldn't actually load.
Since we're doing this for a flag, I decided to move the Qt version
there too for reason #2.
Change-Id: I61ecce6b1324410bbab4fffd153d4e5fc696d19e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
In preparation for Qt 6 deprecating the binary JSON format. Also reduces
the size of the metadata a little: for the xcb platform plugin, it went
down from 264 bytes to 138; for the jpeg image plugin, it went from 320
to 135.
I've had to change the signature so older versions of Qt won't try to
parse the CBOR data as Binary JSON. Unfortunately, before QJsonDocument
could get a chance to reject it, qJsonFromRawLibraryMetaData() needed to
allocate memory and that causes crashes with Qt < 5.11.2.
Change-Id: Ieb48f7c0dd0e4e0fb35efffd153bee34e16ce347
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Fixes compilation failure on Windows, due to TraceLoggingValue not
correctly casting pointer arguments to a known type.
Change-Id: I6027debe4ea3440588dd8677209d6d47048b6b0f
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
In this mode, library and other dependencies are copied into the build
directory, and the XML templates in the build directory are updated
accordingly, but the project is not built or installed.
Needed by qbs.
No existing code has been touched.
Change-Id: Ib8015f7c2315b39dfb21750fecc8618bce03cb8c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Adds an enumName to QMetaEnum to carry the name of the enum since for
flags that doesn't match the name of the Qt type, but is needed if the
flag is scoped.
Change-Id: I1c0f77eb9e40e6fd1eb6a59bea77caf0f33fcf43
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This change keeps the compatibility with old gradle.
It is needed for projects that must use the old gradle version.
src/tools/androiddeployqt/main.cpp was moved from qttools into
qtbase in 5.11. So re-apply c03f5673 in qttools here.
Task-number: QTBUG-69755
Change-Id: I2399d445f8208766e4185d717bb51f1317fdcc00
Reviewed-by: Volker Krause <volker.krause@kdab.com>
(cherry picked from commit e2f4193112)
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
src/tools/androiddeployqt/main.cpp was moved from qttools into
qtbase in 5.11. So re-apply 07bc7c02 in qttools here.
Change-Id: I13a77a0c8567d07c4aa6369ed76bdb894b88f86f
Reviewed-by: Volker Krause <volker.krause@kdab.com>
That is, paths that are searched for dependencies too, next to the Qt
install prefix.
So far this only covers library dependencies, dependency meta data or
QML imports are subject to subsequent patches.
src/tools/androiddeployqt/main.cpp was moved from qttools into
qtbase in 5.11. So re-apply 14013829 in qttools here.
Change-Id: I5649e518cfa3deeac429b4142e6292cb514ef104
Reviewed-by: Volker Krause <volker.krause@kdab.com>
This change keeps the compatibility with old gradle.
It is needed for projects that must use the old gradle version.
src/tools/androiddeployqt/main.cpp was moved from qttools into
qtbase in 5.11. So re-apply c03f5673 in qttools here.
Change-Id: Iaa669c6bf12277cb0cde422228a5c653b6bcf433
Reviewed-by: Volker Krause <volker.krause@kdab.com>
- Simplify/streamline if statmenents
- Change else if to if after return/break/continue
- Use isEmpty() for containers instead of checking size()
- Replace index-based loops by range-based for
Change-Id: I008228a99082a4d0e27be9f6c6af392602140b2f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Keep the original class name around for a little longer so we can
generate the correct scoped enum in the moc output.
Task-number: QTBUG-47652
Change-Id: Ib5934316fa786cc475335b03c86b8ec2dc239055
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The --list option outputs only the file system paths, but does not tell
us where those files end up in the resource file system. This is
unfortunate because the resource paths are possibly the most interesting
thing to be expected from a listing of resource files. Add an option
that outputs a full mapping.
This is also useful for tools that need to resolve files for resource
paths from outside the application using the resources.
[ChangeLog][Tools][rcc] Added a --list-mapping option which shows a
mapping of resource paths to file system paths.
Change-Id: I0cb57fe091ef78b4a9eca8be2fc53278ae50cc11
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Apply a change from Qt Designer.
Silence clang-tidy warnings in the generated files
- use nullptr [modernize-use-nullptr]:
Use nullptr where applicable and simplify the switch()
statement in write() on this occasion to use member variables
instead of accessors.
- use '= default' to define a trivial destructor [modernize-use-equals-default]
Check if any delete statements are required. If not, use "= default".
- use auto when initializing with new to avoid duplicating the type name [modernize-use-auto]
Use auto.
Change-Id: I7b48872fd42a6118e7cca8510aacb9ffa7e01839
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This reverts the following commits:
d12d2949d126c3bec09b49b08f96e8
We can't easily predict all code paths for QDesigner
with such a microoptimization. We also don't want
to generate three different string constructions
depending on some sophisticated heuristics.
[ChangeLog][uic] The -no-stringliteral option is now deprecated and
UIC will not generate QStringLiteral anymore.
Task-number: QTBUG-65251
Task-number: QTBUG-51602
Change-Id: I34a5a1934a8df19c5c84ac2ba8e5168ce5665037
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The compiler was generating some vectorized code for qresource.cpp but
it wasn't very efficient. So improve upon it and make use in other
places where we read UTF-16BE strings.
[ChangeLog][QtCore] Added an overload of q{To,From}{Big,Little}Endian
that operates on a memory region.
Change-Id: I6a540578e810472bb455fffd1531fa2f1d724dfc
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Do not rely on the side-effect that QTextStream returns _null_ strings
(rather than empty strings) to signal EOF; just check for it,
making the code easier to read.
* Scope a variable properly
* Use the char-based functions, rather than string-based functions
(e.g. QString::split(QChar), not QString::split(QString)) when we're
actually passing just one character
* Make error cases more verbose
Change-Id: I415773a60ea1b9013193a9a77e52655a6459047d
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
In general we want to support pointers and pointer-like types
(intptr and its variations); the main use case is tracing an object's
address. Adjust the lttgt generator to use hex formatting
for this kind of aguments; ETW recognizes the pointer argument type
automatically.
Change-Id: I8249a49b6d0b2d468b84c0fbb7624625421cde9a
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
androiddeploytqt is the only official way of deploying applications to the
device, so it is therefore part of the "platform". It therefore needs to live
in qtbase.
Change-Id: I52d7c4427275aacec792b71284a0c10edaf7ab69
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
std::unary_function and std::binary_function are gone. Remove their
uses.
Change-Id: I5d0ee9389a794d80983efffd152c96f0f2149b40
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Replace the global variables qout, qerr by a functions to delay
the initialization.
Task-number: QTBUG-68166
Change-Id: Ib023da1bccc7eabc6e633ccb8945e5f209c5765e
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
the files may not exist _yet_. this change allows dynamically generating
the resource contents.
the ignoreErrors parameter is renamed to listMode and made less
aggressive, to better reflect the actual usage.
Change-Id: I2f6a75a23f1ef903f0d957f9a09f4df0ce2a2b35
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Add qmake feature and configure option, which optimze the size of static
exectuable. Use for static build.
Enabled via configure --gc-binaries, or CONFIG += gc-binaries in 3rd party
projects.
Change-Id: I3c25b02caaef6a4afc6019afc9c67122dd11696d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
clearly, rcc was meant to support wildcard patterns in <file> entries.
however, since its inception, this code was broken: the exists() check
was done first, so the decomposition into path and wildcard would never
happen.
as actually supporting wildcards woulds just complicate matters, simply
remove that dead code.
on the way, re-arrange the code in a way that is advantageous for
subsequent changes, and insert a case that catches non-regular file
nodes (this would have previously run into the wildcard code).
Change-Id: Iac1a168b844ef5b176f6cc45d6a779fde0bec6f7
Reviewed-by: hjk <hjk@qt.io>
This follows on from a232251992 which
covered a similar instance of this. As with that change, we should not
abort the compilation, just ignore it.
Task-number: QTBUG-63772
Change-Id: Ide958080a90f43ed19edd8a320e7d45de1c96821
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
This commit introduces minimal support for instrumentation within Qt.
Currently, only LTTNG/Linux and ETW/Windows are supported.
Change-Id: I59b48cf83acf5532a998bb493e6379e9177e14c8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is in preparation to adding CBOR support. We don't need yet another
dir for CBOR and placing it in src/corelib/json is just wrong.
Change-Id: I9741f017961b410c910dfffd14ffb9d870340fa6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Use Ids from newly introduced id attribute depending
on the global form setting.
Change-Id: I0a5094d5543c0714c88511fa159b60afc9be3c81
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Generate it only when the form contains some actions.
Change-Id: Ic1d64003ccff6102174771c04999cf7c90ac2ae8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Generate it only when needed.
Change-Id: I7a89b18ec0f2ee7d55fcad1b3f9701269d7616ec
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The workaround was needed in older versions of MinGW-w64 headers that
did disable some common functions for -std=c++1z. Anyhow, this is not
reproducable anymore with any recent MinGW-w64.
Change-Id: I8e34a2e055f8e2356696dd4fe131a757c1527574
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
The referenced static meta object for the superclass might be in a
different DLL. In this case, the whole QMetaObject can't be initialized
all via preinitialized data in the data section of the binary, but must
run code at runtime to fill in the value of the dllimported pointer.
In these cases, both GCC and MSVC initialize as much as possible statically,
while only filling in the dllimported values (QMetaObject::d::superdata)
at runtime. Clang, on the other side, initializes the whole struct
at runtime if some part of it needs runtime initialization, leaving
the struct completely uninitialized before constructors are run.
In C++, there are no guarantees for in what order constructors in
different translation units are executed. This in particular means
that there are no guarantees as to whether qRegisterWidgetsVariant()
in qwidgetsvariants.cpp runs before or after the runtime initialization
of QWidget::staticMetaObject.
With GCC and MSVC, this doesn't seem to have mattered since only the
superdata pointer of the staticMetaObject was uninitialized - everything
else was initialized, and the superdata pointer doesn't seem to be
accessed during qRegisterWidgetsVariant.
With clang, the whole staticMetaObject is uninitialized, unless the
staticMetaObject has been initialized before (and the initialization
order is undefined).
By setting a manual priority (which is a GCC extension that also
clang supports) for the staticMetaObjects, we can be sure that
these are initialized before the actual explicit constructor
invocations (without any explicit initialization priority) that
can access the staticMetaObjects.
Change-Id: I64a82f12d690528567509791bae088b6304e189b
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
The C standard library functions cannot handle UTF-8 filenames. Instead,
we need to use the wide-character versions which accept UTF-16 input.
Task-number: QTBUG-65492
Change-Id: If4b3b4eeeec4f3bbb428b8f6b0311a65d01463b0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is mostly relevant for Apple platforms, where we can use the new
unguarded availability warnings to guarantee that proper version checks
are present when using APIs that are not necessarily available on the
deployment target.
Change-Id: Ie408704b2924e1220491a9ea30f0141dfa4867d9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry-picked from 70422449ef)
flex emits code using isatty(), but fails to include the required
unistd.h. we can work around it by including the header ourselves.
Task-number: QTBUG-64771
Change-Id: I05313eeb79f7a0e25365dee5f05a0142f87209ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
because some packages create resource input files at build time
and thus get the build date embedded in binaries,
so that they differ for each build.
See https://reproducible-builds.org/ for why this matters
and https://reproducible-builds.org/specs/source-date-epoch/
for the definition of this variable.
Task-number: QTBUG-62511
Change-Id: I8908ac6182fab066e6ea398df2567f6d050c77e7
Reviewed-by: hjk <hjk@qt.io>
In Qt 5.7, it was possible to call moc "-bfoo.h" or "-b foo.h" and it had the
same effect. With the port to QCommandLineOption, we broke the -b option as it
was not annotated as a short option.
(Regression in a7e3c17e75)
Task-number: QTBUG-63706
Change-Id: I161d0f1a4e65d129063b5e8431802257677da19d
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>