We extend configurejson2cmake to read the "commandline"
information from configure.json. This data is then translated to CMake function
calls and written it into commandline.cmake files.
We extend QtProcessConfigureArgs.cmake to pick up those commandline.cmake
files to feed our command line handling code, which is a
re-implementation of the command line handling in qt_configure.prf.
The command line handler sets INPUT_xxx variables, similar to
configure/qmake's config.input.xxx variables. The INPUT_xxx values are
translated
- to -DFEATURE_xxx=ON/OFF arguments if the input represents a feature,
- to corresponding CMake variables if such a variable is known,
- or to -DINPUT_xxx=yyy CMake arguments.
Configure arguments that have an entry in
cmake/configure-cmake-mapping.md are actually implemented. Other
arguments are likely to need more work.
Task-number: QTBUG-85373
Change-Id: Ia96baa673fc1fb88e73ba05a1afb473aa074b37d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
For Qt 6.0, all versioned style option types have been merged into the base
class, and version number has been reset to 1.
Task-number: QTBUG-84221
Change-Id: If729720813c0cf284271a9084311ed6eb820ecca
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
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>
This is a distinct types in C++, and should be supported out of the
box in QDataStream. This is also required so we do find a data stream
operator for the types when searching for it using template magic.
Change-Id: Iea57780621e2aab7ed253f1cc896bebada43b9f0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This will require some more work in QFlags and the metaobject
system for Q_ENUM.
Change-Id: I3687c7d2529dc18e7bc1abfc326e56ff7a365bc5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Those are problematic as they are also interpreted as
forward declarations of methods that are defined inline in
qdatastream.h and might never get instantiated. This can
lead to problems if template code checks for the existence
of the method.
Change-Id: I4550a6bc70ebd7edc57fe0420b89b453195971d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Check that we can successfully instantiate the data
stream operator for a container before we actually try.
This is required so we can automate registration of debug
stream operators with QMetaType.
Change-Id: Ib100a5242470d7fc8067058cc4d81af2fa9354b0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Check that we can successfully instantiate the debug
stream operator for a container before we actually try.
This is required so we can automate registration of debug
stream operators with QMetaType.
Change-Id: I3943e7a443751d250c33b2ca1b9cf29207cfe6c4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We should probably deprecate both constructors in addition.
Change-Id: Id62448b2abe14248c134feae899fa053ef373e58
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Add metaType()/setMetaType() methods to be used instead
of the type() methods taking a QVariant::Type.
Change-Id: Ieaba35b73f8061cd83288dd6b50d58322db3c7ed
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
It was marked internal anyway. Use the constructor taking a
QMetaType instead.
Change-Id: I15b9cd0911aac063a0f0fe0352fa2c84b7f7c691
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
It's unclear that the actual file searched for is different from the
error output. Make it clearer.
Task-number: QTBUG-85399
Change-Id: Ia5eb6d03c42b399604ce452b88408e0e5071d17c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Add a default argument for the data pointer, so one can
construct a null variant of a certain metatype. This
is meant to help replace the QVariant(Type) constructor
that will get deprecated.
Change-Id: If75a1491ffcaa82d28eb5a7efb547da0ef1f2a87
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
configure script has started to fail on presence of unknown parameters.
Change-Id: I7a18730e0579a36aadd8e92881886e2cc397594a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
To fix CMake Qt For Android projects to configure, we need to move
some functions from a private CMake API file only, to a public one.
Add Qt6AndroidMacros.cmake which will be loaded by Qt6Core package.
We'll have to decide how we proceed with Qt5AndroidSupport.cmake,
because that file automatically runs code when included in Qt5, and we
usually don't want to do it.
We'll also have to decide how to handle the define_property() calls
that are still left in the private QtPlatformAndroid.cmake file.
With this fix, Qt example CMake projects that use
add_qt_gui_executable should now be buildable. An APK can be created
with 'ninja apk'.
Unfortunately Qt Creator 4.13 does not currently seem to support
opening and building CMake Qt For Android projects properly.
While the build succeeds after fiddling with the Kit settings, the APK
deploy step fails to run (at least on my machine).
So the simplest way to run the built APK is to open the android-build
dir with Android Studio and launch the example application from there.
Task-number: QTBUG-85399
Change-Id: I77f246331de7a6e9e6d4ba7d973730190138f136
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Fix detection of qt android platform plugin by globbing inside
the install qt6 prefix location. This is just a sanity check.
Fix platform plugin detection for CMake standalone tests configured
using qt-cmake-standalone-test, which used to look into the fake
standalone prefix location instead of the real Qt location.
Fix detection of stdlib path using CMAKE_SYSROOT.
Add a global apk target that allows easier building of all apk targets
defined in the project. Creation of this target can be opted out by
setting QT_NO_GLOBAL_APK_TARGET to TRUE.
Amends b1f8ca8032.
Task-number: QTBUG-85399
Change-Id: Ic9c1646b4f00e0084fe3f4397df471b8f925afd8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
The helpers can now be included manually in a project to call any
required function. There was a use case for that in qttools, which was
not possible because including QtPostProcess early would produce side
effects.
Task-number: QTBUG-86035
Change-Id: I05d5576bbac45d4b9e298b23aa2a33088d64968e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Both normal and relaxed constexpr are required by our new minimum of
C++17.
Change-Id: Ic028b88a2e7a6cb7d5925f3133b9d54859a81744
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
QtBuild.cmake is huge. Split it.
Move module, plugin, tools, executables and test related functions out
of QtBuild.cmake into separate files.
Do the same for many other things too.
An additional requirement is that all the new Helpers files only
define functions and macros.
No global variable definitions are allowed, nor execution of commands
with side effects.
Some notes:
qt_install_qml_files is removed because it's dead code.
Some functions still need to be figured out, because they are
interspersed and depend on various global state assignments.
Task-number: QTBUG-86035
Change-Id: I21d79ff02eef923c202eb1000422888727cb0e2c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
It's unused except in the definition of QStringLiteral, where
we can just use char16_t. The static_assert can also go as it's
already checked in qglobal.cpp.
Change-Id: I06e8a87b4dea1582cd84957efca1b8ad0d2e0266
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Also take this opportunity to reshuffle the content-encodings in the
intended ordering since the ordering is used to signify priority.
Task-number: QTBUG-83269
Change-Id: I022eecf1ba03b54dbd9c98a9d63d05fb05fd2124
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Deprecated in 5.14 in favor of loadRelaxed() and storeRelaxed().
Caught one surviving use of load() in the ios platform plugin.
Change-Id: I9518064a948e5d26ccb956490cbb0561bed5d8b5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This follows up on commit 3898c022a6
which removed the code but not the methods themselves.
Change-Id: Ia2311921365fdc5fee1104dd3162d6f26e5bb091
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Since 5.9 flush()
Since 5.6 notifyInternal()
Since 5.0 trUtf8()
Change-Id: I1cc0fc5ebc3d7f2f4809c4494ab2a7486a481b10
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Was deprecated in 5.14 although the relevant annotations won't show up
until 5.15.1.
Change-Id: I5b88bd109b9785d8170c616c619d478969536bbf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The endless saga of fighting with qt_find_package and global target
promotion. In certain scenarios we want to opt out of target promotion
to global scope.
One such case is in qttools with WrapLibClang and Threads::Threads.
Threads::Threads will be found in the top-level scope via
Qt6Dependencies.
WrapLibClang is declared in src/ directory scope, and
then we try to promote it ands its dependencies to the global scope,
via qt_find_package() ->
qt_find_package_promote_targets_to_global_scope().
This fails because we can't promote Threads::Threads due to it being
added in a different subdirectory scope.
Introduce 2 new functions.
qt_internal_should_not_promote_package_target_to_global and
qt_internal_disable_find_package_global_promotion.
The first one is used to disable promotion of targets to global scope
in qt_find_package.
To mark a target not to be promoted, the second function is used.
It will be used by qttools for the WrapLibClang case.
Task-number: QTBUG-85877
Change-Id: If6caf10a94999402026517a623ae29e3ab1eeb7f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
A few new files were added with old-school defines.
Change-Id: Ieb2c71e094e55102f3f39fb9551823f36863f5f4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Not following redirects is not a feature, but just a hastle for everyone.
The main issue with switching this default is that applications that
actually do manual redirect handling will break in various ways.
FollowRedirectsAttribute was removed as it no longer serves any
purpose beyond duplicating the default value.
[ChangeLog][Network] QNetworkAccessManager now follows redirects by
default with the NoLessSafeRedirectPolicy.
[ChangeLog][Potentially Source-Incompatible Changes]
QNetworkRequest::FollowRedirectsAttribute was removed and has been
superseded by QNetworkRequest::RedirectsPolicyAttribute
Fixes: QTBUG-85901
Change-Id: Ic5b776180a4b84ac4fc895158bb5a66a3c91a042
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
If we ask for HTTP/2 or 1.1 and the server doesn't list either then we
should still try to connect using HTTP/1(.1) just in case, to keep
compatibility.
Task-number: QTBUG-85902
Change-Id: I6ff2e38ac9d767e482a19ee4c81d101be37d3fab
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This seems to only be happening when we have a single channel because
otherwise it will try IPv4 in one channel and IPv6 in the second.
Change-Id: I0d513e25fefffeabfc733e895827aa12da335ef9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The user-agent should be propagated to the proxy as well or else we
get our default one.
Change-Id: Id2283a8f2ade1a32f7fcf3d691be8d380d334b50
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
In some cases (i.e. with SOCKS) we don't have a HTTP/2 request ready
yet so it would just error out.
Change-Id: I6449de5fb52f5208d5641062c5906c3baff18b77
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
In some rare cases, when a mouse button was released while the mouse was
static, a drag and drop operation would not be completed until the mouse
was moved. Probably due to a Windows bug, the mouse button state
supplied through the arguments of the IDropSource callbacks, called from
the internal DoDragDrop() loop, would not reflect the actual mouse
button state in this case. This change makes the callback implementation
use the actual mouse button state provided by GetAsyncKeyState().
Fixes: QTBUG-85300
Pick-to: 5.15
Change-Id: I3405bdf7076ddc46415cd274a502434bdc0d2f3f
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Also use the value to actually write it into qconfig.cpp so that qmake
reports the right information.
Change-Id: Icc4bf36b0dc6ad75d93ac16f39e5b361c0ce52b4
Fixes: QTBUG-81289
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Our initial approach to looking for host Qt tools when cross-compiling
to a platform with a different architecture bitness compared to the
host one was to unset CMAKE_SIZEOF_VOID_P before calling
find_package(Qt6FooTools) and then restoring the value.
That works to bypass the architecture bitness test in the
ConfigVersion files, but it also influences the paths that
find_package() searches in, specifically the lib<arch> paths like
/usr/lib64 will not be searched in.
Fortunately since CMake 3.14, write_basic_package_version_file() can
take an additional ARCH_INDEPENDENT parameter. This disables the
architecture bitness test when looking for the package, while allowing
to still search in the /usr/lib64 like paths.
Use it when creating the QtFooToolConfigVersion.cmake files.
One could argue we should actually check if the tool executables could
run on the host system where find_package is called for
cross-compilation.
We could do that in another change if the problem ever arises.
Amends 03aa74e40d
Amends 914b367c7f
Change-Id: I1181ff637ac80064a6a8538170b28a41743fc90c
Fixes: QTBUG-81672
Reviewed-by: Christophe Giboudeaux <christophe@krop.fr>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Since QRingBuffer is used as a temporary store for data to be written
to a buffered device, we can implement a "zero-copy" strategy between
the user-space code and QIODevice's internal write buffer. As a first
step, we should have an entry point, where we can implement a possible
solution.
Change-Id: I1c658c13accc98c65a802be943688359cc9f9917
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
After reimplementing Qt JSON support on top of CBOR, there were
unintended behavior changes when converting QVariant{, List, Map} to
QJson{Value, Array, List} due to reusing the code for converting
QVariant* types to CBOR types, and from CBOR types to corresponding JSON
types. In particular, conversions from QVariant containing QByteArray to
JSON has been affected: according to RFC 7049, when converting from
CBOR to JSON, raw byte array data must be encoded in base64url when
converting to a JSON string. As a result QVariant* types containing
QByteArray data ended up base64url-encoded when converted to JSON,
instead of converting using QString::fromUtf8() as before.
There were also differences when converting QRegularExpression.
Reverted the behavior changes by adding a flag to internal methods for
converting CBOR to JSON, to distinguish whether the conversion is done
from QVariant* or CBOR types. These methods now will fall back to the old
behavior, if the conversion is done using QJson*::fromVariant*().
Additionally fixed QJsonValue::fromVariant conversion for NaN and
infinities: they should always convert to QJsonValue::Null. This works
correctly when converting from variant to QJsonArray/QJsonObject, but has
been wrong for QJsonValue.
Added more tests to verify the expected behavior.
[ChangeLog][Important Behavior Changes] Restored pre-5.15.0 behavior
when converting from QVariant* to QJson* types. Unforeseen consequences
of changes in 5.15.0 caused QByteArray data to be base64url-encoded; the
handling of QRegularExpression was also unintentionally changed. These
conversions are now reverted to the prior behavior. Additionally fixed
QJsonValue::fromVariant conversions for NaN and infinities: they should
always convert to QJsonValue::Null.
Fixes: QTBUG-84739
Change-Id: Iaee667d00e5363906eedbb67948b7b39c9d0bc78
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This previous way caused target builds under Linux to pick the host
packages like udev and mtdev and build for them which they will
fail during the build.
Task-number: QTBUG-86028
Change-Id: Ic029f0a3e71b50c694473a110922f0ef11e5b0bf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This file provides common feature-functionality is supposed to be
included by QtFeature.cmake and QtProcessConfigureArgs.cmake.
Change-Id: Ifb483c2a9c4014d240c2a4d6ff07b5c0ceee9c3a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
If the user specified CMAKE_OSX_DEPLOYMENT_TARGET=10.15 for the Qt
build then building projects with qmake failed, because the mkspec
hard-codes QMAKE_MACOSX_DEPLOYMENT_TARGET to 10.14.
We now write QMAKE_MACOSX_DEPLOYMENT_TARGET to qconfig.pri to override
the mkspecs' default.
Fixes: QTBUG-85923
Change-Id: I6a39cfe047ac0f99e1da0ca0728d63c741bd4fed
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>