If Qt was not compiled with libdouble-conversion, sscanf() requires
null-termination, which fromRawData() does not require. This could be
fixed by making QByteArray pass a reallocated copy if it is operating on
raw data, but fixing qt_asciiToDouble() means we catch all cases and we
optimize for the common case of not-horribly-long strings.
Fixes: QTBUG-85580
Pick-to: 5.15 5.12
Change-Id: Iea47e0f8fc8b40378df7fffd16246f6163b01442
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The CA fetcher on Windows works on a separate thread, it can take
quite some time to finish its job and if a connection was meanwhile
closed (via 'abort', 'close' or 'disconnectFromHost') but the socket
is still alive/re-used - we don't want to be fooled by the previous
fetch 'finished' signal, only if it's fetching for the same certificate.
Change-Id: Ibd0a70000ad10cff10207d37d7b47c38e615d0f1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Move createMessageWindow(), the GPU detection for qtdiag and the async
expose setting (used by Active Qt) from QWindowsNativeInterface to
QWindowsApplication.
Remove unused registerWindowClass() and use logFontToQFont() directly from
the font database.
Task-number: QTBUG-83252
Change-Id: I9c72351970b47457d08125557c2580016c66e586
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Move QWindowsMime (which was a public class in Qt 4 and moved to the QPA
plugin in Qt 5) to the platform namespace and add register functions to the
native application.
Move in test code from QtWinExtras.
Task-number: QTBUG-83252
Change-Id: Iaac440e2d5cb370110919921b1eeb779600b5b65
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Also, remove the deprecated function and its auto-test.
Change-Id: If04a54c4b91e0f76523960c7b1a5bcb8fe883ac6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When a first call to ::WSASend() consumes less data than requested, we
are trying to make a second call, leaving 'bytesToSend' unmodified.
Instead of setting a new value for 'bytesToSend', it seems reasonable
to break the loop, if the system buffer overflow detected.
Pick-to: 5.15
Change-Id: I8038e95c20221518955efe786f2d0dadb98360fa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Else developers fail to compile due to the newly added
-Wsuggest-override
Change-Id: I1fdcab794a8639a7cf2f6712e9ede6f25f7d3f69
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Static inline on functions serves the same purpose of keeping non-
inlined instances from different binaries from being mixed, and has the
benefit of being available across compilers.
Change-Id: I12467f6d887471d8fd70ff4623c473c2a5a45664
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QTest::toString allocates memory by calling qstrdup; that memory must
be freed by the caller.
Change-Id: I9724db0c617884cf08592968b1411f002ef23204
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
If the iterator points to the map's begin(), then one can't
decrement it. Split the check and the decrement.
Change-Id: I3d816f13d0bcacc8253ba6d223bc83c874e5efb5
Pick-to: 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
QUrl::toString always encodes as UTF-8, regardless of what the local
encoding is. So this produces garbage on Windows (and any non-UTF-8
system, but those don't exist any more outside of Windows, by
definition). So use %ls to keep the UTF-16.
Task-number: QTBUG-85745
Pick-to: 5.15
Change-Id: Iea47e0f8fc8b40378df7fffd162584f98e5bd633
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Limit the LengthData to the integer range before rounding it, taking
into account that qRound() substracts 1 from negative values.
Fixes: oss-fuzz-23220
Pick-to: 5.15 5.12
Change-Id: I1b4383f3c33aac22746831002b2c74fc134faf77
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Two methods that have gone away or been renamed,
an enum that now doesn't support being assigned from int.
QTime should no longer be used as a timer.
Removed a test of deprecated code that's gone away.
Task-number: QTBUG-85700
Change-Id: Idc6d59542625d22b9937084411b54b0d8aa87f00
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QProcess::FailedToStart had a //### comment which looked distractingly
like it wanted some action, but it was really just documenting the
enum member. Removed the comment and updated the doc to reflect the
one fragment of information that the comment added.
Task-number: QTBUG-85700
Change-Id: Ibe11b91a998751ee9cdd3018cc6a3d8f3ab30eea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
This follows upon commit ca0df4b2694fc3ca0c31cda0d5edec7e76f7dfcb's
comment requesting the unification. Tidied docs at the same time.
Task-number: QTBUG-85700
Change-Id: Ia12dbe98b94388030c7a06036c5287cfbcc4fd05
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Since 5.14: intersect(), angle(). Also removed definition of M_2PI
from test, since its last use was in the tests being removed.
Change-Id: Ie3a12247e3760e8bfdd3a659cd06245c86b198c2
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
QUrl::fromEncodedComponent_helper() only existed to support some old
methods deprecated since 5.0, that I recently removed.
It was the only caller of qt_urlRecodeByteArray() aside from that
function's own autotest.
Both were private.
Task-number: QTBUG-85700
Change-Id: I5d09fd44e768847ce51a1ae7043150922cb5314c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Don't attempt the remote test if we don't have a remote server.
Don't add error returns from read to byteCounter.
Don't cast from ASCII to QString in URL components.
Don't waste time encoding a path for which it's a no-op
(especially as I recently deleted the method used to do it).
Name the time-out, both for clarity and to give anyone who needs to
debug the test only one line to edit so as to increase the time-out
enough to make debugging practical.
Change-Id: I378aa96c0501f7033ca4abb82734b03b8c807f08
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Two methods that have gone away or been renamed,
an enum that now doesn't support being assigned from int.
QTime should no longer be used as a timer.
Removed a test of deprecated code that's gone away.
Task-number: QTBUG-85700
Change-Id: Idc6d59542625d22b9937084411b54b0d8aa87f00
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This follows upon commit ca0df4b2694fc3ca0c31cda0d5edec7e76f7dfcb's
comment requesting the unification. Tidied docs at the same time.
Task-number: QTBUG-85700
Change-Id: Ia12dbe98b94388030c7a06036c5287cfbcc4fd05
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
QProcess::FailedToStart had a //### comment which looked distractingly
like it wanted some action, but it was really just documenting the
enum member. Removed the comment and updated the doc to reflect the
one fragment of information that the comment added.
Task-number: QTBUG-85700
Change-Id: Ibe11b91a998751ee9cdd3018cc6a3d8f3ab30eea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Remove the fake QJsonValuePtr and QJsonValueRefPtr required for
operator()-> of QJsonArray and QJsonObject iterators.
Task-number: QTBUG-85700
Change-Id: I622a5a426edb13b32f9d00a02c3c148320fbccba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
warning: comparison of integers of different signs: 'qsizetype' (aka 'long long') and 'unsigned long'
Change-Id: I03acb1f7aed782169a0a42cd8afc84b85991cd1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
warning: format specifies type 'int' but the argument has type 'qsizetype' (aka 'long long')
Change-Id: I6099b53efecea46d191d5dc019c986f99e49c1f1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This fixes the macOS build when you only have the CommandLineTools installed.
Change-Id: I620bc535b508b604a875f53dec8c57af23efeac1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The configuration tests might indicate the compiler supports F16C,
due to building the tests as x86. But in a multi arch situation,
such as when doing universal builds for x86_64 and arm64, we must
also verify that the current complication unit is building for x86.
Instead of adding Q_PROCESSOR_X86 checks to each call site that
checks for F16C, we sanitize the F16C support define as we do for
other CPU feature defines.
Change-Id: I9ef53c9d47690dddb0b1b82f77b0ebf74f3295bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
As stand-alone executables are not tracked by Launch Services,
which is responsible for applying the low-dpi override at runtime.
Change-Id: Ifac71dfa9b9ffa5ab1302dfca8fa1f5ddd491082
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Move options to new interface, making them settable from
code on this occasion.
Task-number: QTBUG-83252
Change-Id: Idd80667c502a8cde5d7c66d7e597ea34c22738e7
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Add conversions from/to HBITMAP, HICON to QImage. Split the pixmap
conversion functions apart to use them.
Task-number: QTBUG-81876
Change-Id: Ic0c41a402a1f6e9bec572fc4d691357bd48e6423
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Given some decimal scaling, the clipping of the QRegion/QRect passed to the QRegion/QRect done inside paintEvent cannot handle the decimal scaling.
Solved by only converting QRect to a certain QRectF and calling QRectF overload instead of QRect.
Fixes: QTBUG-82601
Fixes: QTBUG-64854
Pick-to: 5.15
Change-Id: I0d8f4193aabfc0d917612db68d2a39ebb726fa2f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
In code style, it shouldn't look like this
Change-Id: I615f3a6ca1b4f33e0693a4e272d5703d9285a8a8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
While trying to implement the 'host artifact reuse' Coin instructions
change, a bug surfaced where the qemu configurations didn't find
the host tools and instead tried to use the cross-compiled tools
while building qtbase, which failed due to not finding the
runtime linker (another unsolved issue).
Before the host artifact reuse change, the host tools were found
successfully.
The difference that caused the issue is that the target install prefix
was a direct subfolder of the host prefix.
host - /home/qt/work/qt/install
target - /home/qt/work/qt/install/target
Before the host reuse change the install prefixes were as follows
host - /home/qt/work/qt/install/host
target - /home/qt/work/qt/install/target
While looking for the Qt6CoreTools package, we temporarily set
CMAKE_FIND_ROOT_PATH and CMAKE_PREFIX_PATH to contain first
'/home/qt/work/qt/install' and then '/home/qt/work/qt/install/target'.
CMake then reroots the CMAKE_PREFIX_PATH values onto values in
CMAKE_FIND_ROOT_PATH, making an MxN list of prefixes to search.
Rerooting essentially means concatenating 2 paths, unless the
considered prefix is a subfolder of the root path.
What happened was that the first considered value was
'/home/qt/work/qt/install/home/qt/work/qt/install', a non-existent
location that gets discarded.
The second considered value was '/home/qt/work/qt/install/target.
The second value is the result of seeing that
'/home/qt/work/qt/install/target' is a subfolder of
'/home/qt/work/qt/install' and thus the root path is stripped.
All of this is done in cmFindPackageCommand::FindConfig() ->
cmFindCommon::RerootPaths.
The behavior above caused the target tools be found instead of the
host ones.
Before the host reuse change, both of the initial constructed prefixes
were discared due to them not existing, e.g.
'/home/qt/work/qt/install/target/home/qt/work/qt/install/target'
and '/home/qt/work/qt/install/host/home/qt/work/qt/install/host'
One of the later prefixes combined CMAKE_FIND_ROOT_PATH ==
'/home/qt/work/qt/install/host' + CMAKE_PREFIX_PATH == '/' resulting
in '/home/qt/work/qt/install/host/' and this accidentally found the
host tools package.
We actually stumbled upon this issue a while ago when implementing Qt
5.14 Android CMake support in 52c799ed44
That commit message mentions the fix is to add a "lib/cmake"
suffix to the PATHS option of find_package().
This would cause the subfolder => strip root behavior mentioned
above.
So finally the fix.
First, make sure not to append QT_HOST_PATH in the toolchain file,
there shouldn't be any need to do that, give that we temporarily set
it when looking for Tools packages.
Second, recreate the subdir scenario in the Qt toolchain file by
setting CMAKE_FIND_ROOT_PATH to the current (relocated) install
prefix as usual, but also setting CMAKE_PREFIX_PATH to a new value
poining to the CMake directory.
Aka '/home/alex/qt' and '/home/alex/qt/lib/cmake'.
Third, when a QT_HOST_PATH is given, save 2 paths in the generated Qt
toolchain: QT_HOST_PATH and QT_HOST_PATH_CMAKE_DIR. There are the host
equivalents of the target ones above. Use these values when looking
for host tools in Qt6CoreModuleDependencies.cmake, again facilitaing
the subdir behavior.
Note these are currently absolute paths and are not relocatable.
We'll have to figure out if it's even possible to make the host path
relocatable.
Finally as a cleanup, look for the Qt6HostInfo package in QtSetup
strictly in the given QT_HOST_PATH, so CMake doesn't accidentally find
a system Qt package.
Change-Id: Iefbcfbbcedd35f1c33417ab7e9f44eaf35ff6337
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
In qmake builds we can see the moc invocations, whereas in CMake builds
by default we don't.
Modify the Coin instructions to pass the CMAKE_AUTOGEN_VERBOSE cache
variable so that AUTOMOC prints the moc invocations.
Change-Id: I50be13224839fbbdece3c9e8a4935a72aba91a8e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
We don't want to build the host Qt configuration every single time we
do a cross-build in Coin.
Coin learned some new qt5.git platform configuration options, which
allow specifying a dependency between a host Coin configuration and a
target one.
This means we can specify a host macOS config as a dependency when
building iOS, and the host artifacts for all dependent repos
(qtbase, qtsvg, qtdeclarative, etc) will be installed into
/home/qt/work/install (as specified by the
{{.AgentWorkingDir}}/install location).
Same for Linux + Android and Linux + qemu.
Modify the qtbase Coin instructions to use these installed host
artifacts if such a dependency is present (platformDependency is not
null). The target artifacts will be installed into a subfolder of the
host installation, called 'target', e.g. /home/qt/work/install/target.
If a dependency is not present, continue to build a host Qt before
doing a target build. This allows gradual conversion of configurations
in case if some of them don't work, or if the dependencies.yaml have
not propagated far enough for all new repos to use the new
instructions.
In this case the locations of the artifacts are different
host - /home/qt/work/install/host
target - /home/qt/work/install/target
Task-number: QTBUG-85623
Change-Id: I33539f4376034539fb7db80293dc4d39dcb9539b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>