It seems to be a hidden gem that one can stop redirecting the standard
output to a file without creating a new QProcess instance.
I have discovered this while browsing the private implementation of
QProcess trying to answer this question:
https://stackoverflow.com/a/72989131/2682142
I believe that this should be documented unless it is not meant to be
guaranteed behavior.
Change-Id: I180764d4cc56f6395d6d65942077e3ede63c71ea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Otherwise the errorString from qtls_openssl is lost that
would help a lot why a tls connection failed.
"Error during SSL handshake: error:1414D17A:SSL routines:tls12_check_peer_sigalg:wrong curve"
Pick-to: 6.4 6.3 6.2
Change-Id: Iab74b73488219686e5926308db02bc4063818c9f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
So long as you only ask us to copy it. Copying is mandatory, though.
I'll firm up the warning in a later commit, which may not get cherry-
picked as far back.
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-105140
Change-Id: I3859764fed084846bcb0fffd170432abf65dc197
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This reverts commit 7b2ae3faab.
Reason for revert: this breaks multi-monitor XCB with HighDPI.
Fixes: QTBUG-105079
Pick-to: 6.4
Change-Id: I386c9480c33d1f67b3478332c8e03fe3eeeeee39
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Fushan Wen <qydwhotmail@gmail.com>
This patch improves the QT_INLINE_SINCE(maj, min) macro to take
deprecation version into account.
If the specified (maj, min) version is less than or equal to the
version defined by QT_DISABLE_DEPRECATED_BEFORE, the macro will expand
to "inline", and the out-of-line fallback will be removed from the
library.
This is achieved by introducing the helper
QT_IF_DEPRECATED_SINCE(major, minor, whenTrue, whenFalse) macro.
Fixes: QTBUG-104131
Pick-to: 6.4
Change-Id: I285029dad7b71126072b024a3be6d7b11341996d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Before a recent fix it would happen occasionally that
lastNormalizedPositions.at(0) would segfault because the list was
empty. The cause of the flakiness was fixed, but make the test more
resilient anyway by checking first the list is correctly populated.
Furthermore on some platforms this check fails:
qAbs(leftWidget.lastNormalizedPositions.at(1).x() - 0.8) < 0.05
So instead of QVERIFY use QCOMPARE_LT to print the values when it fails.
Task-number: QTBUG-104268
Change-Id: Id5430eb53c133cf5d23647cfd9749f01f266efce
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Sometimes XCB_EXPOSE event is being propagated twice, once before and
once after qWaitForWindowExposed(). But the window has focus only after
the second expose event. Changing it to qWaitForWindowActive() fixes the
issue.
Fixes: QTBUG-104268
Pick-to: 6.2 6.3 6.4
Change-Id: Ibc78dd4958ed1a4a8d0967b29d2a53457ab9ae8b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
the previous invocation wasn't working because QSpiAccessibleBridge
first needs to construct the connection before it can connect to the
enabledChanged signal that gets emitted as part of connectA11yBus,
effectively missing the signal emission because the connection wasn't
established by the time the emit happens. delay the signal emission
through the eventloop so the caller has time to connect to all signals.
https://bugs.kde.org/show_bug.cgi?id=452132
Change-Id: I1cf9fdd824b2c118cc6278b207aaaedeff259bb1
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
Add missing enum values in QPlatformTheme::standardPixmap to sync with
QStyle::standardPixmap changes from:
785d2b9d07aa5a595a98
Add enum values NStandardPixmap at the bottom of both enums as well
as an assertion in QStyle constructor that these values are identical.
Add omitvalue for NStandardPixmap in QStyle (QPlatformTheme enum is
not documented).
Pick-to: 6.4
Change-Id: I9ee528d032c445bed5aeace716893b2af8367de2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
ftdebug.c files are new, adapted the import script to copy the source
file for Windows as well.
Replaced the CMakeLists.txt content that was imported from the .pro file
with the respective variables and logic from the freetype CMakeLists.txt
file, which should make it easier to maintain this next time.
Pick-to: 6.4 6.3 6.2 5.15 5.12
Fixes: QTBUG-105032
Change-Id: I1e846167b268df4b1b0a50dcec602def1a0bdcb4
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
We have deprecated the usage of Qt::MouseEventSource getter in
QMouseEvent::source() since 6.0. However, we have a lot of related
APIs, where the usage of this enum was not marked deprecated. Also we
have a lot of code in qtbase, qtdeclarative and some other modules
that rely on those values.
In most cases using QMouseEvent::source() is the only way to pass
the proper value to the other APIs.
This patch un-deprecates the method, so that we can safely identify
all of its usages in our code, and port away from it.
At the same time, we do not want the client code to use this method,
so documentation still mentions it as deprecated since 6.0.
Task-number: QTBUG-104857
Pick-to: 6.4 6.3 6.2
Change-Id: I767002aa6dc754fb5a58cf8fbf35774dae9986ed
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
And fix all the new warnings.
Task-number: QTBUG-104857
Pick-to: 6.4 6.3 6.2
Change-Id: I2a5791f495575d71d2344429aca3363f9922e31b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
We deprecated QAction::setMenu(QMenu *) in Qt 6.0 because QAction needed
to become part of QtGui, and QMenu is a QtWidgets class. To keep
existing code working, we added a private API operating on QObject *,
and a template overload of setMenu, which allows callers to pass in and
get the object as a QMenu without any change to their code. The
implementation relies on a virtual function in QApplicationPrivate.
This solution might be as good as it gets. Making QAction operate only
on QObject* in the public API breaks exiting widget code, and it is
unlikely that we will come up with a QMenu abstraction that unifies
widgets and Quick UIs without breaking code either.
So, undeprecate the existing solution. If we come up with something
better, we can still deprecate it again in time for removing it in Qt 7.
Pick-to: 6.4 6.3 6.2
Change-Id: I1982b61feb1b1af99f4647e892c5fd74340d9c77
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
They are used in a lot of code, deprecating them now just creates noise
and porting effort without adding any value.
For Qt 7 we can remove them if we deprecate them in time for the last Qt
6 release, at which point porting effort is expected anway. Leave a ###
comment behind to that effect.
Pick-to: 6.4
Change-Id: I0a4e78cf1723b02373d23d7cd52783b3f7095428
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The QTextFormat::FontFamily enum is deprecated since Qt 6.0, however it
is still used in the code.
To retain backward compatibility with the old data stream formats, we
introduce a new internal QTextFormat::OldFontFamily enum value, which
has exactly the same value as QTextFormat::FontFamily, and use it
instead.
Task-number: QTBUG-104857
Pick-to: 6.4 6.3 6.2
Change-Id: Ibf5258b621c2b0aa507005dfe2c1e80c26ddb0d4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
And fix the usage that raised a deprecation warning.
As a drive-by: fix the deprecation declaration of QShortcut::id() to
use QT_DEPRECATED_VERSION_6_0 instead of pure Q_DECL_DEPRECATED.
Task-number: QTBUG-104857
Pick-to: 6.4 6.3 6.2
Change-Id: I5710127864909ce9352c7428e6aabbc89981b8f2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
... when QT_DISABLE_DEPRECATED_BEFORE is past the deprecation version.
This commit actually stops using the deprecated signals when we build
Qt with QT_DISABLE_DEPRECATED_BEFORE >= 0x060000. Otherwise we will
get a compilation error because the signals will be removed.
Task-number: QTBUG-104857
Pick-to: 6.4 6.3 6.2
Change-Id: Ie513ecc9451bf2d88f80857cf19f3d2b4958d022
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
When the method is wrapped into
if QT_DEPRECATED_SINCE(MAJ, MIN)
we also need to add QT_DEPRECATED_VERSION_[X_]_MAJ_MIN macro right in
front of the method declaraion, to actually trigger a deprecation
warning.
This patch does that for QCursor's deprecated methods, and fixes all
related compilation warnings in QtBase.
Task-number: QTBUG-104857
Pick-to: 6.4 6.3 6.2
Change-Id: Ic8d059e8c852d4b2dee55e7ea94f4fc7a402cdf4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
If the metatype does not support copy and default construction, then it
it unsuitunsuitable for use in QMetaType. We cannot prevent users from
passing in such metatypes (as we have e.g. a ctor taking QMetaType), so
verify this in customConstruct, and make the variant invalid in that
case.
Pick-to: 6.2 6.3 6.4
Change-Id: Ib1f0149c8fb9a1cce0049fd0311980754cc85d1b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Fix existing warnings by casting to the appropriate type.
Change-Id: Ic44d2a71e1a2e508199dbb46bea7a19e183ec42c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
On 32-bit platforms, the user can ask for more than INT_MAX bytes to
be returned from read(n), by way of its qint64 argument. We can, of
course, not return so much data because allocation would fail, so fail
early, by detecting this situation and do what resize() would have done
if it was not for the narrowing of its argument: throw bad_alloc.
Reviewers may ask themselves whether byteAmount(), which already caps
the request, would not have physically limited the request size to
INT_MAX, since we cannot possibly hold more data than that on 32-bit
platforms. But this is not correct, since QByteDataBuffer is
essentially a list of QByteArrays, and those can be shared copies of
each other (which isn't uncommon, if you consider how a user of the
class may be piecing together data by reusing existing QByteArrays).
The read(n) and readAll() functions are already documented to be
inefficient and should-not-use, we may want to remove them in the
future to force users to think about this problem in the context of
their domain.
Pick-to: 6.4
Change-Id: Ia152db0a1fc65bbef35acd463f12fba1b7726d4a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The doc comments were missing the classname, and therefore did not show
up in the correct places.
Pick-to: 6.4 6.3 6.2
Change-Id: I23a56356dcad862e2fe1f6f8c3da2f39852b80c7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
It is a noop on all our supported compilers.
Task-number: QTBUG-105098
Change-Id: Ic59d4c86d96ea29a5513d778ddd35df8c7a6877a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
In cross-compilation, the CMAKE_FIND_ROOT_PATH will have path to the
host Qt and examples build will pick up wrong Qt6Config.cmake unless
the build dir path is prepended.
Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-104270
Change-Id: I7fc7499369a2e5446e1c5257155f81c72716fef7
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
QT_POST_CXX17_API_IN_EXPORT_CLASS (introduced in commit e996253774)
works around a deficiency of MSVC by marking affected methods as
templated. Anyhow, this doesn't need to be reflected in the
documented API.
Pick-to: 6.4
Change-Id: I9d5dd8b979a84f2fecc582613c2e944bb33eb790
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Used QGesture for this as per the gesture example.
Moved the help and info text to separate lines.
Enabled word wrap to prevent text going off screen.
As a drive-by, the code to center the window at a size that's a fraction
of the screen is replaced with a simple sizeHint() override. The user
should have control over placement, particularly now that it should be
placed manually onto a touchscreen if the user has one.
Done-with: Shawn Rutledge
Fixes: QTBUG-96702
Pick-to: 6.4
Change-Id: I8dba8b09bed474f585341e9a7a8c71fb60293eee
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
They're ALWAYS const objects, though they also chock full of relocations
so they are never in read-only sections of memory (except maybe in final
executables that are position-dependent).
These are methods in a private sub-class of QVariant. No one outside of
QtCore (at least qtbase) should be using them directly. QVariant doesn't
have many friends (a bit anti-social); the one that matters is
qvariant_cast and that one does access QVariant::Private. This is not a
BC problem because QVariant::Private::type()'s signature is not
changing. In any case, QVariant's Q_CORE_EXPORT does not apply to
QVariant::Private anyway (see [1]).
[1] https://msvc.godbolt.org/z/r9cer8eWh
Pick-to: 6.3 6.4
Change-Id: I3859764fed084846bcb0fffd17035355f823dc8f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The feature is not ready for prime-time. Too many linker bugs have been
found, Clang hasn't finished implementing it, and the status of gold and
lld are simply unknown.
Task-number: QTBUG-105002
Pick-to: 6.4
Change-Id: I3859764fed084846bcb0fffd1702fead133a9a96
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Found while compiling qtdeclarative tests:
FAILED: qtdeclarative/tests/auto/qml/qmlcppcodegen/tst_qmlcppcodegen
[...]
ld: qtdeclarative/tests/auto/qml/qmlcppcodegen/data/TestTypes/libcodegen_test_moduleplugin.a(codegen_test_moduleplugin_TestTypesPlugin.cpp.o): non-canonical reference to canonical protected function `_Z28qml_register_types_TestTypesv' in qtdeclarative/tests/auto/qml/qmlcppcodegen/data/libcodegen_test_module.a(codegen_test_module_qmltyperegistrations.cpp.o)
ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
See https://sourceware.org/bugzilla/show_bug.cgi?id=29377
Pick-to: 6.4
Change-Id: I3859764fed084846bcb0fffd1702fe6da341a9e3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
And take the opportunity to remove the "m" in the qmake feature name and
.prf file.
Pick-to: 6.4
Change-Id: I36b24183fbd041179f2ffffd170224ab75cdd968
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Clang has the option, but spells it differently.
Fixes: QTBUG-105002
Pick-to: 6.4
Change-Id: I36b24183fbd041179f2ffffd170217e82ff6d14d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Use the full name of LTCG to make it clearer to the user.
As a drive-by, also remove the "Intel" word from the
CET feature's title, according to MSVC & GCC's manual,
they don't contain "Intel" in the feature title either.
Change-Id: I099ba6c5e7470b5699c1ab6b3c4ef2a4bf084580
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
To enable CET for MSVC, only passing "/CETCOMPAT" to
the linker should be sufficient.
Enabling generation of EH Continuation (EHCONT) metadata
is additional protection and should not be necessary.
It also requires all the dependencies to be re-compiled
with EHCONT enabled, otherwise the linker will refuse
to link the obj files. However, this is rather hard
to achieve if your application depends on many 3rd-party
libraries, so to let people enable CET more freely,
we don't enable EHCONT guard by default.
Pick-to: 6.4
Change-Id: Iba08a5ec56c474d291991fb751a0de764719bd85
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We have one for touch->mouse synthesis, so perhaps it's a good idea here
too; then we can confirm that it's missing on Windows, because Windows
normally does the synthesis (setPlatformSynthesizesMouse(false) is not
called on this platform, so the default is true, meaning we expect that
it does that). The cross-platform synthesis (and ability for a platform
plugin to disable) began with f931e5e72d
Pick-to: 6.4
Task-number: QTBUG-102764
Change-Id: Ic6913adbeb6b91e3953ddfe8b401975d95cd9af3
Reviewed-by: Doris Verria <doris.verria@qt.io>
Amends 8e506fdd29
Also remove the lcQpaXInputEvents().isDebugEnabled() check to ensure
that the qCDebug output is emitted. It was meant as an optimization, but
skipping of printf-style qCDebugs when the logging category is disabled
is efficient enough.
Pick-to: 6.3 6.4
Fixes: QTBUG-104875
Change-Id: Id8dc710a8fdb596ddce70380a577205fc52df4cc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Copy them from QRegExp docs in qt5compat to
doc/global/includes/corelib/port-from-qregexp.qdocinc, so that the
porting docs can be included from both Qt 6 porting guide and qt5compat.
Task-number: QTBUG-89702
Pick-to: 6.4 6.3 6.2
Change-Id: I616e2333f60f36e4851398479939fd062016748d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The instructions for porting away from QRegExp to QRegularExpression in
the Qt 6 porting guide were mostly copied from the similar docs for
QRegExp, which are moved to
doc/global/includes/corelib/port-from-qregexp.qdocinc. The later now
covers everything that the docs from porting guide did and doesn't have
the issues listed in QTBUG-89702.
Remove the old docs and include the docs from doc/global/includes
instead.
Task-number: QTBUG-89702
Pick-to: 6.4 6.3 6.2
Change-Id: Ifdb79d5775bc0cadd02c21299d58adb27ae13337
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
resultsMapSize is modified inside the runReduce() method, and the
writes are protected via mutex lock. However, reads of resultsMapSize
through shouldThrottle()/shouldStartThread() (that can be called by
multiple threads) are done without a lock. Added the missing locks.
Task-number: QTBUG-104787
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I700e7b66e67025bc7f570bc8ad69409b82675049
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The qstrtoull() function returns ulonglong, not int, so we'd be
incorrectly detecting 0x1'0000'0814 as NyNorsk. Paranoia? Sure.
Fix by using auto to hold the result.
As a drive-by, make the QByteArray const so .data() doesn't
attempt to detach(), and shorten a long variable name to stay
within line-length limitations.
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-103531
Change-Id: I740d0c5934e54c9f716688fa9c00de0ac4029936
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The function returns a pointer, not an integer.
Found while working on QTBUG-103721.
Change-Id: I18a9987d99c645a5b410c4b11128bfebcc5dcddd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>