QMetaTypeInterfaceWrapper tries to find the metaObjectFunction using
the MetaObjectForType template. Using SFINAE, for a QObject, it should
resolve to a suitable specialization.
Such a specialization doesn't yet exist. It had to be created.
The following path returns nullptr for registered meta types:
auto metatype = QMetaType(typeId);
requestedTestType.metaObject() -> returns nullptr since a bad template
argument is fed to MetaObjectForType<T> in
QMetaTypeInterfaceWrapper<IneritingFromQObject>::metaType's static initializer.
Change-Id: I8b31c51e12cb19c333e00480b0177354b910ce1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Port the constructor and addData() method to QAnyStringView, but keep
the overloads taking a QByteArray to avoid extra copies when actual
QByteArray is passed. These overlaods need to be Q_WEAK_OVERLOADs, to
avoid ambiguities (e.g. for const char * arguments).
Additionally, add a test to make sure the patch doesn't break parsing
from a QLatin1StringView input.
[ChangeLog][QtCore][QXmlStremReader] Added constructor and addData()
overloads taking QAnyStringView.
Change-Id: I0efaab82a2123271c88407e380f3c67d1099a4a6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Smooth scaling of icons etc. give far better visual results,
particularly with fractional dpr scaling. So enable this generally in
QStylePainter, and make more of the relevant widgets use QStylePainter
instead of QPainter directly.
Differences can be seen in the widgets examples, e.g. textedit,
gallery, stylesheet (Pagefold), mdi.
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-96223
Fixes: QTBUG-101058
Change-Id: I3c34a455d097e5f6a6a09d3b020528b4fbda4d85
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The win32 printing paint engine copies tiles of the source image into
temporary target images for printing. It does that using QPainter
painting. If there is a difference in DPR between source and target,
the painting will be scaled, leading to distorted results.
Fixes: QTBUG-99990
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: Ie7368655ef3abeece49fb1a6421e2d6ea7ed5e95
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
There's no reason to. It's not a Qt module, it's just a plugin and
does not expose any public headers.
Amends d754e43721
Pick-to: 6.4
Task-number: QTBUG-96283
Change-Id: Idf56c82025b81fd6614ef7e1efeb015e89c84f93
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
We started recording extra dependencies for the QtNetwork TLS plugin,
but we never actually processed them to write out the necessary
find_package calls.
This broke static builds of qtopcua, because the OpenSSL::SSL target was
no longer created in the root scope, but only in some child ones like
src/opcua, whereas the target was referenced in generator expressions
in a different sibling scope src/declarative_opcua, leading to errors like
CMake Error at lib/cmake/Qt6/QtPrlHelpers.cmake:116
(file): Error evaluating generator expression:
$<TARGET_LINKER_FILE:OpenSSL::SSL>
No target "OpenSSL::SSL"
Call Stack (most recent call first):
lib/cmake/Qt6/QtModuleHelpers.cmake:837 (qt_generate_prl_file)
lib/cmake/Qt6/QtScopeFinalizerHelpers.cmake:21:EVAL:1
(qt_finalize_module)
src/declarative_opcua/CMakeLists.txt:DEFERRED
Make sure to process the extra deps for plugins as well.
Amends d754e43721
Amends 3c23317552
Pick-to: 6.4
Task-number: QTBUG-96283
Change-Id: I11876e0844198b3a794bc06b6691ee694fd3b1c2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
If qtbase was configured with CMAKE_STAGING_PREFIX set to a path without
drive letter on Windows, we must ensure that this exact staging prefix
is propagated to non-qtbase repos.
We already had code that does this for CMAKE_INSTALL_PREFIX. But since
9a74d94ff5 we build our cross-built
packages with CMAKE_STAGING_PREFIX instead of CMAKE_INSTALL_PREFIX.
Move said code into a function and use it for CMAKE_STAGING_PREFIX too.
This fixes Android non-qtbase release libraries not being stripped in
our Windows Android packages.
This amends commit 037fd545c4.
Fixes: QTBUG-104827
Pick-to: 6.2 6.3 6.4
Change-Id: I909f7f39bd0ef7b559619b69f756c042d6c528b0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Since wasm doesn't like filesystems that well, we omit this test in
tst_qchar for wasm, this allows us to still run the test without the
case where it needs to read the normalization file.
Change-Id: I37e54d97e119f94e1a9ca53917d0b93183321899
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
If there were no matches to the name given on the command line, the
message reported included a "Possible matches:" preamble for a list of
functions containing the requested function name. This looked
incongruous when no actual functions matched.
Turn that preamble into an optional parameter to qPrintTestSlots(),
that it'll output before the first match if it finds one, rework
qPrintTestSlots() to package its matching condition in a lambda and
return true if it found any matches. Change this caller to output a
newline in place of the preamble (which ended in a newline), if no
match was found.
Change-Id: I9716ffa29c3c46e3c7e7fcf25a676c0356dab91c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
- QFileInfo::fileName() is not the name of a directory, so we need
absoluteFilePath() to construct a QDir
- QDir::entryList() returns only the name suffix, not the whole path
- stop at any arbitrary depth, and add a find command which does full
recursion
Amends 04a5a74685
Change-Id: I9870db092125a797e8b654e98954ac611dde1ab2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
isRegistered naturally has the potential to run into unregistered
types; in that case, we should not print any warning.
Pick-to: 6.4 6.3 6.2
Change-Id: I060b23199ed1d41f67ebe656ed3c396094edffd4
Reviewed-by: Stefan Gehn <stefan.gehn@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Not in use any more.
Change-Id: I4d4e7b5094544c042b5c500417427233d0b316f1
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
QString has several functions taking a QRegularExpression: indexOf(),
contains(), and so on. Some of those have an out-argument of type
QRegularExpressionMatch, to report the details of the match (if any).
For instance:
QRegularExpression re(...);
QRegularExpressionMatch match;
if (string.contains(re, &match))
use(match);
The code used to route the implementation of these functions through
QStringView (which has the very same functions). This however opens
up a lifetime problem with temporary strings:
if (getString().contains(re, &match))
use(match); // match is dangling
Here `match` is dangling because it is referencing data into the
destroyed temporary -- nothing is keeping the string alive. This is
against the rules we've decided for Qt, and it's also asymmetric with
the corresponding code that uses QRegularExpression directly instead:
match = re.match(getString());
if (match.hasMatch())
use(match); // not dangling
... although we've documented not to do this. (In light of the decision
we've made w.r.t. temporaries, the documentation is wrong anyways.)
Here QRE takes a copy of the string and stores it in the match object,
thus keeping it alive.
Hence, extend the implementation of the QString functions to keep a
(shallow) copy of the string. To keep the code shared as much as
possible with QStringView, in theory one could have a function taking a
std::variant<QString, QStringView> and that uses the currently active
member. However I've found that std::variant here creates some abysmal
codegen, so instead I went for a simpler approach -- pass a QStringView
and an optional pointer to a QString. Use the latter if it's loaded.
QStringView has some inline code that calls into exported functions, so
I can't change the signature of them without breaking BC; I'm instead
adding new unexported functions and a Qt 7 note to unify them.
Change-Id: I7c65885a84069d0fbb902dcc96ddff543ca84562
Fixes: QTBUG-103940
Pick-to: 6.2 6.3 6.4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Before 0681a2dd5a, QCOMPARE'ing types
for which no QTest::toString specialization exists did not output
Actual and Expected lines on failure, as that would only print <null>
for both values (which then look like the same value, confusingly).
Commit 0681a2dd5a changed that behavior,
and started printing the confusing <null> values.
Take care of the logic in the formatFailMessage function: if both values
are nullptr, then print only the variable names, but not the confusing
<null> text representation of the values.
Remove dead and duplicated code related to the formatting logic, add a
self-test function, and update the expected_cmptest files.
Fixes: QTBUG-104867
Pick-to: 6.4
Change-Id: I4be98e79f91196b14690a2cc0a68ffd50b431a45
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add a QTest::toString() override for QKeySequence. This is just calling
QKeySequence::toString(). The default format is PortableText, which
should be ascii. Deliberately avoided NativeText as it can return
unicode, e.g. on Mac.
This is necessary to get helpful information for test failures when
using QCOMPARE for QKeySequence instances.
Currently, the returned output would not only be not helpful, but even
misleading:
Actual (edit.keySequence()): <null>
Expected (QKeySequence()) : <null>
After adding the override, the output is neither misleading nor
unhelpful:
Actual (edit.keySequence()): ""
Expected (keySequence) : "Return"
Some special characters would be escaped in the output, like the literal
double quote:
Actual (edit.keySequence()): "Ctrl+N"
Expected (QKeySequence("\"")): "\""
Change-Id: Ib4b28fca30f6f2ad86c62530767f94a151332e0a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Update to the latest stable version.
Beta/preview versions not included.
Removed Amazon Linux AMI because it's no longer maintained.
Removed tvOS because it now shares the same version with iOS and iPadOS.
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I40e5286b132b8198bf315a2868f89428e8c2f23a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Different shortcut editors seem to have different preferences. By
default, QWidget seems to utilise Tab, Backtab, Return and Enter for
navigation purposes. However, some shortcut editors would like to be
able to record these keys as part of combinations to use in the
application.
Therefore, leave it with the application developers to decide what key
combinations they would like to use for finishing the key sequence edit.
This should provide enough flexibility for application developers to
customize their shortcut editor behavior.
[ChangeLog][QtWidgets][QKeySequenceEdit] Added a property to allow
defining the finishing key combinations.
Fixes: QTBUG-103844
Fixes: QTBUG-103843
Change-Id: Id84644086ca7a4f11618d510e59698a43735b99b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It's needed in QtHttpServer.
[ChangeLog][QtCore][QDebug] Can now stream QMetaType.
[ChangeLog][QtCore][QMetaType] Can now be streamed through QDebug.
Change-Id: I974d77d678137715472a3907ab1e50ba2dbaa087
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Removing the impedance mismatch with the Qt containers.
Pick-to: 6.4
Task-number: QTBUG-104814
Change-Id: I141d9056249644b90c404219792e0fcd87960f7c
Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
Reduces the impedance mismatch with "normal" Qt containers.
Remove useless inline keywords as a drive-by. Functions defined in the
class body are implicitly inline since C++98. C++ declarations are
long-winded enough as they are, no need to add more cruft.
Also make the ctor explicit, we surely didn't intend to allow implicit
conversion from qsizetype to QDataBuffer
Pick-to: 6.4
Task-number: QTBUG-104825
Change-Id: I563dcd825afd63937b87e87fbbd324daaeb49d08
Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
QDataBuffer assumes that its template argument is a POD, iow: it's ok
to not run ctors and dtors and assign a value into uninitialized
memory.
In Qt, we call that Q_PRIMITIVE_TYPE. Asserting that the QDataBuffer
value_type is not QTypeInfo::isComplex, however, has shown that a
large number of types had not been marked as such, sometimes for good
reason, e.g. because their default constructor doesn't
value-initialize all members, but sets some of them to -1.
Since QDataBuffer doesn't memset the memory to zero, it doesn't
matter, as the code obviously has to have worked before, with
uninitialized memory, and all-zeros is just a special, if common, form
of uninitialized memory.
I also tried to assert is_pod in QDataBuffer (working around the fact
that that particular trait is deprecated), but found that almost none
of the types in question were, in fact, trivial. We should fix this,
because it means the compiler is generating code that's less efficient
than it could be, but that's for another patch.
All types marked as Q_PRIMITIVE_TYPE in this patch are private API, so
this doesn't affect users.
For PathSimplifier::Event, had to shorten the unnamed namespace to not
include the member functions, because Q_DECLARE_TYPEINFO cannot appear
in a namespace other than the Qt one.
Pick-to: 6.4 6.3
Change-Id: I4431a2f269ec1ac4804a87ea71f983eaa34ef867
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
QPoint/F are, then so are QLine/F, being a pair of points.
Found by static_assert()ing !isComplex in QDataBuffer.
Pick-to: 6.4
Change-Id: I358a38d79820c9262a86018253002bc991c5a6e4
Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
It's a glorified int, so pass it by value instead of cref.
Pick-to: 6.4
Change-Id: I1c7a37614cd0d2dac63d2d549563600d401d6dad
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
This will come in handy when porting some GUI code to qsizetype.
Pick-to: 6.4
Task-number: QTBUG-104818
Change-Id: I426a4f425ebd7a9fdc2d2bba97dae4c640ded97e
Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
- make them hidden friends
- take lhs and rhs each by value
- noexcept
- remove useless mixed relational operators with int: Every fix op i
is now compiled as fix op QFixed(i) with no loss in performance.
Pick-to: 6.4
Change-Id: If4d0a43fd964547de59fed4ba2cdfea0cf176809
Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
They don't give us anything: For every op=(X), there's an implicit
QFixed(X) constructor that will resolve any
fix = x;
as
fix = QFixed(x);
with no performance penalty.
Pick-to: 6.4
Change-Id: Ia5b0364617a646f3cf122b47363d6099548bb5c2
Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
Gives better naming for the members. A range consists of {begin, end},
not {first, second}.
Pick-to: 6.4
Task-number: QTBUG-104818
Change-Id: I3d6c7be2a137e1c03149d1d86ce9db38ec28a1fb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
56bd1b76d2 changed the update
resolve mask behavior in QPalette to avoid detaching brush data
when modifying the resolve mask if the brush value is not changed.
But this behavior broke compatibility, it introduced unknown risks, and
we cannot ensure that other code in Qt does not depend on the old
behavior.
We both need to ensure that we don't detach when the value is not
changed, and ensure that the resolveMask is always updated regardless
of whether the value changes, so we need to split them up and
independently share the brush data.
QFont will update its corresponding resolveMask even if the value has
not changed, so it is better to correct this behavior so that QPalette
and QFont are consistent.
[ChangeLog][QtGui][QPalette] Always update resolve mask in
QPalette::setBrush, even if the value of brush has not changed.
Fixes: QTBUG-98762
Pick-to: 6.4 6.3 6.2
Change-Id: Ib845361b30f21c3d78c16ced923c1678b12e05ac
Reviewed-by: JiDe Zhang <zhangjide@uniontech.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
when building Qt repositories.
When building for example qtquick3d, the Qt6QmlPlugins.cmake
file should not load the qtquick3d specific plugin config files
because the targets will be created as part of the build and cause
duplicate errors.
We already did it for static builds, but now we also do it for shared
builds.
Amends 7d6f1ee5a7
Amends 98e8180e56
Pick-to: 6.4
Task-number: QTBUG-94066
Change-Id: I66ca71dfa6485eded94c1ecb5eb3b23daf908b39
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Adding Selection pattern for tab bars and SelectionItem pattern for
tab items, which are required for accessibility compliance.
Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-104740
Change-Id: I0e3b1cfbf4838d8bc8b5bc2e2d7c9d372ac8b99d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Implement the ExpandCollapse UI Automation pattern for tree items,
so that accessibility tools like MS Narrator are able to report the
item state.
Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-103988
Change-Id: I1529bdb0104c6e29d8f28bc0bbb8a7fa4670c7ef
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
A call to platformFontDialogHelper() will lazily create the helper,
and is not enough to distinguish whether the helper is actually in
use. The explicit nativeDialogInUse flag also takes properties like
DontUseNativeDialog into account, which may be set after the dialog
is first constructed.
Fixes: QTBUG-104696
Pick-to: 6.2 6.3 6.4
Change-Id: Ia00a39bba4aaae8c99ae0cdd6543c2e451f72ea6
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
In Qt 6.3, a check for WA_InputMethodEnabled was removed
in QWidget, to support IM queries also for read-only
widgets (7c6e4af48). This caused a regression on iOS, which
made the input panel open for widgets that didn't support
IM at all.
A patch was merged that solved the regression (3b12305575),
but it didn't take the widget attribute into account.
Since not doing so has the potential to cause regressions,
this patch will modify the affected code once more, so that
we instead fall back to test WA_InputMethodEnabled when
ImEnabled is not implemented. This will match closely
to the way ImEnabled was implemented in Qt 6.2.
Since we, with this change, now require that either ImEnabled
or WA_InputMethodEnabled is set, our own input widgets will
fail to support IM text selection when they're read-only, since
they actually don't implement ImEnabled.
This patch will therefore also make sure that we do so.
Task-number: QTBUG-104527
Pick-to: 6.4 6.3
Change-Id: I70ad910aec38d0a74f4dd7d3115d3c45c16d2b3b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
BINDABLE should generally behave the same as MEMBER if "WRITE default",
except where it cannot. In particular we cannot know if any NOTIFY
signal should be sent from the synthetic WRITE accessor.
[ChangeLog][QtCore] moc will now synthesize WRITE accessors for
properties with BINDABLE if you specify "WRITE default".
Task-number: QTBUG-97249
Change-Id: I883c40ba0dda7989c840971860addaeaa75a8c83
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The zstd feature is now public, which enabled it in rcc even when rcc
was cross-compiled, but rcc was not linked agaist zstd library.
There is no need to test for cross-compilation anymore or to add
the extra define.
Amends eda4919f252c53f313441afbedb4d0f98e94c9a
Pick-to: 6.4 6.3 6.2
Change-Id: I23987ae0903759cf4f3fd17059c71c8815b8d908
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
QTouchEventSequence simulates a QPA touch event, potentially containing
multiple points. (Despite the name, it only calls qt_handleTouchEvent()
once, so it cannot really send a sequence of events; however, one event
can contain multiple touchpoints.) Delivery is synchronous, and we keep
return values through the QWindowSystemInterface::handleTouchEvent()
template functions; so the remaining step is to return a bool from
qt_handleTouchEvent(), so that we can return a bool from commit().
This allows tests to see the same perspective as a platform plugin can:
check whether the event was accepted or not, after delivery is complete.
Some tests in Qt Quick need to start doing that, to enforce correct
behavior in QQuickDeliveryAgent.
[ChangeLog][QtTestLib] QTouchEventSequence::commit() now returns a bool
so that tests can check whether the event was accepted during delivery.
Pick-to: 6.4
Task-number: QTBUG-104656
Change-Id: I9cf87909a3f847dedbdeca257013e309ac19cf0d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Inspect and change int types to qsizetypes where necessary.
Fixes: QTBUG-103550
Change-Id: Ib92553ab214d06c8daecaa0c48ae2c2e4e32fdb7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This is a UINT/uint32_t/GLuint/NSUInteger in all APIs (with Metal
being special due to being 64-bit in 64-bit apps whereas all others
are 32-bit always, at least on 64-bit Windows)
As the stride is already an uint32, follow suit for the step rate.
There was no reason to have this as int in the first place.
As an added bonus, some casts, that were previously needed when
mapping to the underlying API reality, can now be removed.
Change-Id: I8e0eef037bd795b637578dfc3e59dc2efaa5976c
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
It's an opt-in warning that some people like to use. It was introduced
to clang 3.0.0 in 2011 by
98766db785
However, the feature is intentionally used here and the generated code is legit.
Make both sides happy.
Change-Id: I79335cd3a6a6cc128fa65f77d201a12f67424260
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's deprecated as of Xcode 14, and generates a warning message if a
project explicitly enables bitcode. The App Store no longer accepts
bitcode submissions from Xcode 14.
Pick-to: 6.2 6.3 6.4 5.15
Change-Id: Ib1f9d5114ca4d8b1845ecc7a9de0473ee015db33
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
...that uses the old name after a recent change in the
name of a function.
Change-Id: Ife36fbb0c5d28b350cb1cfc48625528a205af8f9
Reviewed-by: Christian Strømme <christian.stromme@qt.io>