Move the QIODevice::OpenMode enum into a base class, so that
we can remove the full QIODevice (and thus QObject) dependency
from qdatastream.h and qtextstream.h.
This is required so that we can include QDataStream in qmetatype.h
without getting circular dependencies.
As a nice side effect, QDataStream and QTextStream can now inherit
QIODeviceBase and provide the OpenMode enum directly in their
class scope.
Change-Id: Ifa68b7b1d8d95687ed032f6c9206f92e63bfacdf
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
... and QMultiMap as std::multimap.
Just use the implementation from the STL; we can't really claim that
our code is much better than STL's, or does things any differently
(de facto they're both red-black trees).
Decouple QMultiMap from QMap, by making it NOT inherit from
QMap any longer. This completes the deprecation started in 5.15:
QMap now does not store duplicated keys any more.
Something to establish is where to put the
QExplictlySharedDataPointer replcement that is in there as an
ad-hoc solution. There's a number of patches in-flight by Marc
that try to introduce the same (or very similar) functionality.
Miscellanea changes to the Q(Multi)Map code itself:
* consistently use size_type instead of int;
* pass iterators by value;
* drop QT_STRICT_ITERATORS;
* iterators implictly convert to const_iterators, and APIs
take const_iterators;
* iterators are just bidirectional and not random access;
* added noexcept where it makes sense;
* "inline" dropped (churn);
* qMapLessThanKey dropped (undocumented, 0 hits in Qt, 1 hit in KDE);
* operator== on Q(Multi)Map requires operator== on the key type
(we're checking for equality, not equivalence!).
Very few breakages occur in qtbase.
[ChangeLog][Potentially Source-Incompatible Changes] QMap does not
support multiple equivalent keys any more. Any related functionality
has been removed from QMap, following the deprecation that happened
in Qt 5.15. Use QMultiMap for this use case.
[ChangeLog][Potentially Source-Incompatible Changes] QMap and
QMultiMap iterators random-access API have been removed. Note that
the iterators have always been just bidirectional; moving
an iterator by N positions can still be achieved using std::next
or std::advance, at the same cost as before (O(N)).
[ChangeLog][Potentially Source-Incompatible Changes] QMultiMap does
not inherit from QMap any more. Amongst other things, this means
that iterators on a QMultiMap now belong to the QMultiMap class
(and not to the QMap class); new Java iterators have been added.
Change-Id: I5a0fe9b020f92c21b37065a1defff783b5d2b7a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
For those who are providing their own launch images for their iOS
projects then QMAKE_IOS_LAUNCH_SCREEN can be set to point to the
location where the launch image to be used over the default.
[ChangeLog][Platform Specific Changes][iOS] Added support for
specifying a launch image to be used for an iOS project. This can be
achieved by using QMAKE_IOS_LAUNCH_SCREEN.
Change-Id: Ibb236655b282132ab5eee747986a93abb9802200
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
src/corelib/text/qunicodetools.cpp:1243:13: warning: this statement may fall through [-Wimplicit-fallthrough=]
src/corelib/text/qunicodetools.cpp:1247:55: warning: this statement may fall through [-Wimplicit-fallthrough=]
Change-Id: I441000db46cb6d85a5dcd0534ea2168b39a3f3bd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This is required to remove the ; from the macro with Qt 6.
Task-number: QTBUG-82978
Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The change creates a slight source incompatibility. The main
things to take care of are
* code using printf statements on list.size(). Using qsizetype in
printf statements will always require a cast to work on both 32
and 64 bit.
* A few places where overloads now get ambiguous. One example is
QRandomGenerator::bounded() that has overloads for int, uint and
double, but not int64.
* Streaming list.size() to a QDataStream will change the format
depending on the architecture.
[ChangeLog][QtCore][QList] QList now uses qsizetype to index into
elements.
Change-Id: Iaff562a4d072b97f458417b670f95971bd47cbc6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
As a side effect, data() can now return a nullptr. This
has the potential to cause crashes in existig code. To work
around this, return an empty string from QString::data()
and QByteArray::data() for now.
For Qt 6 (and once all our internal issues are fixed), data()
will by default return a nullptr for a null QString, but we'll
offer a #define to enable backwards compatible behavior.
Change-Id: I4f66d97ff1dce3eb99a239f1eab9106fa9b1741a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The original expression seems to have been accidentally
changed during the port.
Amends a1947aeffe.
Change-Id: I87821e1e025621a5efaf7a1e4f946fd3109fb256
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Assume UTF-8 on all Unix like systems
* Export some functions to be able to compile QTextCodec once
moved to Qt5Compat.
Task-number: QTBUG-75665
Change-Id: I52ec47a848bc0ba72e9c7689668b1bcc5d736c29
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
While removing winrt code too much code was removed. The
ProjectConfiguration is needed for every Visual Studio project.
This patch amends 45b0f1be68
Fixes: QTBUG-85086
Change-Id: Ic8b42583a159d5b69c0c4e82f46dd98ad8e54ce2
Reviewed-by: Miguel Costa <miguel.costa@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The qt_internal_apply_gc_binaries function should apply both compile
and link flags, not just link flags.
The flags should be applied publically to all consumers of Bootstrap
regardless if the gc_binaries feature is enabled.
The flags should be applied publically to Core only in case if the
feature is enabled (aka for static builds only).
Change-Id: Id42af0d9b527004d74c04eff2c9e3c2be1e76aac
Fixes: QTBUG-84461
Task-number: QTBUG-83929
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Macros and the await helper function from qfunctions_winrt(_p).h are
needed in other Qt modules which use UWP APIs on desktop windows.
Task-number: QTBUG-84434
Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This option changes the order of include paths, which can cause problems
of various kinds. See https://bugs.debian.org/958479 for an example.
The benefit of that option is minimal for what it was intended.
Pick-to: 5.15 5.12
Change-Id: I80eeabd09764df290b60bc59aeb2f90d07723608
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This patch allows tools to be built for the target platform when the
QT_BUILD_TOOLS_WHEN_CROSSCOMPILING parameter is set at configuration
time.
To avoid naming conflicts, the target tools are suffixed with "_native".
The qt_get_tool_target_name() function can be used to get the tool name
for both scenarios (cross and non-cross compilation).
Extend pro2cmake to refer to the right target name for tools.
The relevant write_XXX functions have a new target_ref parameter that
will be "${target_name}" for tools and literally the target name for
everything else.
Fixes: QTBUG-81901
Change-Id: If4efbc1fae07a4a3a044dd09c9c06be6d517825e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
...and re-regenerate qmake/CMakeLists.txt.
This removes one special case and is necessary for a subsequent patch
that changes how pro2cmake converts Qt tools.
Change-Id: Ie87b7841f3c29de3f2c8907e82975b6272f096cc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The registry.cpp file is in the library subdirectory.
This doesn't contribute to the qmake or CMake build, but it removes the
need for a special case in qmake/CMakeLists.txt.
Change-Id: I66a566f0d1e0b82791822ca55a7de037369536a7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We now assume that source code is encoded in UTF-8 by default on
all platforms (and verify this with an auto test). Provide
a CONFIG+=no_utf8_source option for backwards compatibility.
[ChangeLog][qmake] qmake will tell the compiler that source code is
encoded in utf-8 by default. This mainly has an effect on Windows, where
MSVC still assumes source code is encoded in the current ANSI code page.
Use CONFIG+=no_utf8_source to get back the Qt 5 behavior.
Change-Id: I6dcafcaeefdea7d3907ccb723aeb7d23ccc0f04f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Separate them from the qutfcodec, so that the codec
can later on be moved out of Qt Core.
Fix the QUtf methods to take qsizetype instead of int
for length arguments.
This also makes it possible to not build QTextCodec into
the bootstrap lib anymore.
Change-Id: I0b4f83139d61b19c651520a2f3a5012aa7e85cb8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add snippet on how to use ANDROID_ABIS inside the .pro file.
Pick-to: 5.15
Task-number: QTCREATORBUG-24014
Change-Id: Id3bb960c04ea6480b06878121ad33f89c03e5642
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
I'm getting compile errors with gcc 9.3 without this, and it
makes sense to disable the JIT in bootstrapped builds anyway.
Change-Id: Ife867bd2d6fd0bf133edae4903bb6b6d295db547
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The QChar ctors from non-char-types are going to be deprecated.
Change-Id: I17d7916fb1dac9889ead61daca846b1257d17312
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
I generated a rc file using VS2019 and I found that it's
using other macros.
According to [1], both of VOS_NT_WINDOWS32 and VOS__WINDOWS32 refers to
"File was designed for 32-bit Windows", although they have different
values, and 0x0L is the value of VFT2_UNKNOWN. So I think it's safe to
update them. VS2019 is using them as the default template for rc files,
after all.
[1] https://docs.microsoft.com/en-us/windows/win32/menurc/versioninfo-resource
Change-Id: Ibaf91394668844492f1357da05b881b9d81aa15f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Setting the QMAKE_MANIFEST variable doesn't have
any effect for MSVC. This commit fixes that.
If the developer is setting this variable,
he/she will definitely use CONFIG-=embed_manifest_exe
or CONFIG-=embed_manifest_dll at the same time,
so I think there is no need to check this.
Change-Id: Ie32b7e0cded71efcf14bf4c0eecab5ab1944fa2c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
All it's uses have been replaces with QRegularExpression.
Change-Id: I5bcdfdd8a39dad6d1288f18f1b24d2eea9e028d2
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
Use the DotMatchesEverythingOption for all places
where we interpret .pro files, to increase compatibility
with QRegExp.
Change-Id: I347d6b17858069f3c9cedcedd04df58358d83f27
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This is required to be able to port qmake over to use
QRegularExpression instead of QRegExp.
Change-Id: I0ad2c19bf3c0a28e52c1e12b4d3daa0300a75ed2
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Should improve performance and is going to be required in
the future anyway.
Change-Id: I89d7c50441d2491da1ab0a4d564dcc91f52ade85
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
qmake is not warnings clean, so don't add -Werror.
Change-Id: I7a823241ded56967c1b802203f404ee36ed26429
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Since TARGET at this point contains the path to where the target will
be then it can include ".." as part of it which will cause problems when
building for Android on Windows. Therefore, QMAKE_TARGET should be used
as an identifier here as the path is not needed.
Change-Id: Idb8babd0459c65cbcfd64fe47baeac4303a3fd87
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Android variable are missing from the list of QMake variables...
Task-number: QTBUG-80390
Change-Id: Ic10f96687334eea99c0302d7137685b1bf6e56c6
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This is required, so that QHash and QSet can hold more
than 2^32 items on 64 bit platforms.
The actual hashing functions for strings are still 32bit, this will
be changed in a follow-up commit.
Change-Id: I4372125252486075ff3a0b45ecfa818359fe103b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Conflicts:
examples/opengl/doc/src/cube.qdoc
src/corelib/global/qlibraryinfo.cpp
src/corelib/text/qbytearray_p.h
src/corelib/text/qlocale_data_p.h
src/corelib/time/qhijricalendar_data_p.h
src/corelib/time/qjalalicalendar_data_p.h
src/corelib/time/qromancalendar_data_p.h
src/network/ssl/qsslcertificate.h
src/widgets/doc/src/graphicsview.qdoc
src/widgets/widgets/qcombobox.cpp
src/widgets/widgets/qcombobox.h
tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp
tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
tests/manual/diaglib/debugproxystyle.cpp
tests/manual/diaglib/qwidgetdump.cpp
tests/manual/diaglib/qwindowdump.cpp
tests/manual/diaglib/textdump.cpp
util/locale_database/cldr2qlocalexml.py
util/locale_database/qlocalexml.py
util/locale_database/qlocalexml2cpp.py
Resolution of util/locale_database/ are based on:
https://codereview.qt-project.org/c/qt/qtbase/+/294250
and src/corelib/{text,time}/*_data_p.h were then regenerated by
running those scripts.
Updated CMakeLists.txt in each of
tests/auto/corelib/serialization/qcborstreamreader/
tests/auto/corelib/serialization/qcborvalue/
tests/auto/gui/kernel/
and generated new ones in each of
tests/auto/gui/kernel/qaddpostroutine/
tests/auto/gui/kernel/qhighdpiscaling/
tests/libfuzzer/corelib/text/qregularexpression/optimize/
tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/
tests/libfuzzer/gui/text/qtextdocument/sethtml/
tests/libfuzzer/gui/text/qtextdocument/setmarkdown/
tests/libfuzzer/gui/text/qtextlayout/beginlayout/
by running util/cmake/pro2cmake.py on their changed .pro files.
Changed target name in
tests/auto/gui/kernel/qaction/qaction.pro
tests/auto/gui/kernel/qaction/qactiongroup.pro
tests/auto/gui/kernel/qshortcut/qshortcut.pro
to ensure unique target names for CMake
Changed tst_QComboBox::currentIndex to not test the
currentIndexChanged(QString), as that one does not exist in Qt 6
anymore.
Change-Id: I9a85705484855ae1dc874a81f49d27a50b0dcff7