There is no need to generate wrapper functions for equals,
lessThan or debugStream for pointer types, as those can
easily be handled by a few lines of code in QMetaType itself.
Change-Id: If79b3bc3a629249c1d17c9e592202f08b59f80ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Refactor the methods retrieving data in Q*Iterable so
that we don't return pointers with unclear ownership. Instead,
copy the data into a out pointer provided by the caller.
This also means there is no need for the metatype flags
anymore and we can remove those.
Change-Id: I517de23a8ccfd608585ca00403aca0df2955f14b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Store a QMetaType, not a meta type id in the classes.
Change-Id: If27a60512a46fa029cc914d65b8cad7f89d7f3b0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove the old revision of the interface, this is not
required with Qt 6 anymore, as everything is being
recompiled anyway.
Change-Id: I66070c4dc6b5e2a6d22f5a9ebea7688ed38333fe
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This code is now unused, as streaming operators are
registered automatically.
Change-Id: I0e48944c33a92cf1f2f158fb2dc0ca49256d7938
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use the builtin support in QMetaType instead.
Change-Id: Ifc0e88719a384aa7fb525652bada22b6f7ee1c45
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
And remove the old manual registration code for those operators.
Add some special handling for long/ulong, as these types could be
streamed as a QVariant so far, but are not directly streamable
through QDataStream.
[ChangeLog][QtCore][QMetaType] The QMetaType::registerStreamOperators()
and QMetaType::registerDebugStreamOperator() methods have been
removed. The streaming operators for a type are now automatically
registered together with the type registration. This implies that the
operators should be visible wherever the type is visible and being used.
[ChangeLog][Behavior Incompatible Changes] Because the QDataStream and
QDebug serialization operators are automatically registered with
QMetaType, the declarations of those functions must be present at any
point where the type is used with QMetaType and QVariant.
Change-Id: I4a0732651b20319af4a8397ff90b848ca4580d99
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We shouldn't rely on include path containing also /QtCore
Task-number: QTBUG-82615
Change-Id: I0f98f6097865cc5aa2c2fc9a0fabf2c4513b7afe
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
I'm pretty sure we want to keep supporting statements like
bool ok = connect(~~~);
that is, statements that do use copy initialization and not
direct initialization. As such, QMetaObject::Connection has
to keep using the restricted bool trick and cannot be ported
over to explicit operator bool.
Change-Id: I07a38f7c134686e67b5984aa93fe5cf3201561d7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The debug feature for the CMake build is solely determined by the value of
CMAKE_BUILD_TYPE or CMAKE_CONFIGURATION_TYPES. There is no point in
restricting the autoDetect expression to developer builds or MSVC and
macOS builds.
User-visible result: -DCMAKE_BUILD_TYPE=Debug now actually turns the
'debug' feature on, also for non-developer builds on Linux.
Change-Id: I65c92575c9483bff16beb78b60606c55aeadcece
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Very simple AUTODETECT expressions worked fine, but expressions with
parentheses, for example, were not correctly evaluated.
Change-Id: Ibec4fa55474e149a701f861838fdea41d31beca0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This configure switch controls the feature 'optimize_size'.
This isn't merely a mapping to CMAKE_BUILD_TYPE=MinSizeRel, because
we potentially want to combine -optimize-size with -force-debug-info,
which maps to CMAKE_BUILD_CONFIG=RelWithDebInfo.
Task-number: QTBUG-85373
Change-Id: I1a9343ebc54816f52e90e9d33ea3df4c99b1ec9f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Command line options like -debug result in setting the variable
INPUT_debug. INPUT_debug is mapped to the CMake argument
-DCMAKE_BUILD_TYPE=Debug. INPUT_debug also matches the feature
'debug', and the CMake argument -DFEATURE_debug=ON was passed.
Do not pass -DFEATURE_xxx CMake arguments for inputs that are already
handled.
Change-Id: If096dff1c6dd694545c6f671f5f3512a43c3ec50
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
tst_moc uses qt_wrap_cpp, which tries to dispatch to qt6_wrap_cpp
depending on the value of QT_DEFAULT_MAJOR_VERSION. That value is only
set in Qt6CoreConfigExtras.cmake.in, which is not loaded as part of
the qtbase build unless something does find_package(Qt6Core).
Set the QT_DEFAULT_MAJOR_VERSION to 6 before including the
Qt6CoreMacros in the qtbase top-level project.
Change-Id: I7b81d89d965f755e51727007e68771ac3931ac55
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The -host prefix was added to the 'preliminary' directory rather than
the actual wrapper shell script. This caused it to be overwritten
every time by the cross-compiled qmake binary.
Change-Id: I103811c6aa9181fa701e3e7ecaf828ecdd1e3c90
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
While trying to implement instructions for building examples with
qmake in the CI, an issue has surfaced.
When building examples with CMake with -DBUILD_EXAMPLES=ON in the CI,
the examples are built in-source, aka source dir == build dir.
This means that the header files generated by qdbusxml2cpp will be
placed in the qtbase source dir.
The instructions that try to build examples with qmake build the
examples in a separate build dir after building the examples with CMake.
Unfortunately the qtbase/examples/dbus/remotecontrolledcar/car example
includes the generated DBus adaptor header via a statement like
#include "car_adaptor.h"
and the compiler prefers to pick up the header file from the example
source dir (the one generated by CMake), rather than the one generated
by qmake in the example build dir.
Because CMake's DBus integration uses different flags than qmake's
DBus integration, the generated header file code is not compatible
with the qmake generated cpp file, and the example fails to link when
building with qmake, because it can't find an appropriate constructor
symbol.
In an ideal world, we wouldn't do in-source builds with the CMake
build, but that leads to other issues which I currently don't recall.
To circumvent the issue, adapt the CMake DBus qt6_add_dbus_adaptor
function to allow not passing the problematic '-l' flag by making it
optional. This shouldn't break existing code, but allows us to
generate a compatible header that will be used by qmake and succeed in
linking the example.
Task-number: QTBUG-85986
Change-Id: I06759f79aeb66bb32da7f158f55dd4734c4a9887
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The code was developed against the narrow-contract version of mid(),
but not updated when mid() became wide-contract.
Change-Id: I038054fb3f5acc0085c48fbf36af13dd14c917b8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reduce the scopes so that also the result of 1-arg-sliced() can be
called 'sliced'.
Change-Id: Ie156f76838f8650d6926d3c198007aaf12f90734
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QLatin1String::mid() etc were changed from narrow to wide contract,
but the narrow-contract replacements weren't added. This blocks using
the narrow-contract functions in QStringTokenizer.
As a drive-by, Q_REQUIRED_RESULT -> [[nodiscard]] and Q_DECL_CONSTEXPR
-> constexpr. Also centralize most Q_ASSERT()s in a single function,
verify(), in an attempt to reduce the amount of string data generated
from the asserts in assertive builds.
[ChangeLog][QtCore][QLatin1String] Added from(), sliced(), first(n),
last(n) functions.
[ChangeLog][QtCore][QLatin1String] size_type/size() is now qsizetype
(was: int). This makes QLatin1String(ptr, 0) ambiguous now between the
(ptr, ptr) and (ptr, qsizetype) constructors.
Change-Id: Ie195f66ae1974eb0752c058aa9f3b0853ed92477
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Quanifying a parameter passed by value (which is correct for QTime,
there is no need to pass it by reference) as const is pointless.
Change-Id: I86850f65dfac28ffcc4a8633dd6d212259bb33d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The serialization code neglected to check against null. Sinze zones
are saved either by IANA ID or in our special OffsetFromUtc format,
representing an invalid zone by a string that cannot possibly be a
valid IANA ID will do.
Fixes: QTBUG-86019
Pick-to: 5.15
Pick-to: 5.12
Change-Id: I6882026403d00f8b254aab34c645f1cf8f9fcc2d
Reviewed-by: Taylor Braun-Jones <taylor@braun-jones.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The read data wasn't encoded into the state correctly.
Change-Id: Ib0a3b50bfeb56968de5c5e8353b28383cb586271
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Among other things, this allows for ignoring proper indentation
of code that's contained in a wrapper function which serves the
purpose of compiling the snippet only. This is useful because
the extra indentation is included in the output generated by QDoc.
Task-number: QTBUG-84470
Change-Id: I3d702e82169a87447939f357cbee15cb0f74a391
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
setFilterRegExp retains the caseSensitivity() while setFilterRegularExpression did not.
Change setFilterRegularExpression to also retain the case sensitivity.
Fixes: QTBUG-83313
Pick-to: 5.15
Change-Id: I46f494d320aee99d50612f01f63558c693276989
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: David Faure <david.faure@kdab.com>
This code path was deprecated in 5.12 and scheduled for
removal in Qt 6. See 9184384bc9.
According to the source comments from f48170b479,
apperantly XInput2 had some issues when running on Xinerama screens
and therefore there was a check for it in xi2MouseEventsDisabled().
We plan to remove Xinerama support, therefore Xinerama handling in
xi2MouseEventsDisabled() is irrelevant.
Task-number: QTBUG-69412
Change-Id: I384d7c46337358caecccf644acc8ffbd381dc69d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We actually do not need this "mode" in qwsi API. I think while
writing the patch from 00ae1e6b7b I got confused by focusing
on my test application. We can't know what the native event
filter will filter out, therefore it makes sense that we
unconditionally do filtering at qwsi level as well for user input
vs other events in QWindowSystemInterface::sendWindowSystemEvents().
Pick-to: 5.15
Pick-to: 5.12
Change-Id: Idb23152a24bf3ba3b91804427a6e78f991969c29
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Try to fix an API mistake there: there is no reason why these
functions should take pointers to non-const widgets, as that
actually preventing reasonable code (e.g. finding out the index
of "this" inside a const method of a QWidget subclass).
Unfortunately, indexOf(QWidget*) is also virtual, meaning that
changing its signature is an API break. Hopefully, there are
only few users that override this method (Woboq says 0).
[ChangeLog][Potentially Source-Incompatible Changes]
The QLayout::indexOf(QWidget *) virtual function has changed
signature, becoming QLayout::indexOf(const QWidget *).
This is source incompatible, although the fix (for the few
users that do override indexOf() in their layouts) is
straightforward.
Change-Id: Id2183f5ecd9dc7e2a37c7355266e8494ef7929f2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This extends to/fromString to include style strategy, capitalization,
letter and word spacing and stretch. QFont::fromString() keeps
compatibility with strings from earlier versions as well.
Fixes: QTBUG-67687
Change-Id: I5e95a58f1cd850214af2a7d8906a214facd4e661
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
When using X-forwarding we're not using shared memory for the backing
store image, and end up in a code path where we first copy the updated
parts of the backing store from our client side image over to the server,
and then flush those parts from the server-side image to the window.
The problem was that this code path didn't account for the possibility
that we'd flush a sub-window at an offset, and would end up uploading
the sub-window local region directly, without applying the offset.
This problem was revealed when 79bf1b7e34 started being smarter
about what regions we flush and to what windows when we have sub
windows.
Fixes: QTBUG-81723
Pick-to: 5.15
Pick-to: 5.12
Change-Id: I1c9c8bc53c088cdc1ae8b892e17930f4a468ccad
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
MidButton had its // ### Qt 5: remove me
upgraded to Qt 6 at 5.0; but it dates back to 4.7.0
Replace the many remaining uses of MidButton with MiddleButton in the
process.
Pick-to: 5.15
Change-Id: Idc1b1b1816673dfdb344d703d101febc823a76ff
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QtQuickTest synthetized events can have modifiers, but those modifiers
were not accessible globally, from QGuiApplication::keyboardModifiers
for instance.
eg. calling QML's TestCase::mouseClick with modifiers triggering a call
to QGuiApplication::keyboardModifiers did not give the expected result.
QtTest synthesised events can also have modifiers and those were
correctly handled by QApplication to set modifiers globally.
This fix moves the handling code from QApplication::notify to
QGuiApplicationPrivate::maybeSimulateModifiers and calls this function
from QGuiApplication::notify too.
The definite fix would be to do as suggested in the comment attached to
the moved code:
> Qt Test should not call qapp->notify(), but rather route the events
> through the proper QPA interface. This is required to properly
> generate all other events such as enter/leave etc.
Pick-to: 5.15 5.12
Change-Id: I734e5bbc82232b13828b1a1f82e06ee8eb695417
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>