Qt 6 automatically registers all types used in properties. Thus, the
functionality is mostly obsolete since Qt 6. We can simply return the
stored metatype's id instead.
The code in moc is kept in place for compatibility with older code,
though there seem to be no remaining users of the metacall in Qt itself
anymore.
Change-Id: I3c654150988ae7780b4e9ea1f16191fdadf8d791
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Qt 6's metatype does no longer care whether the type is from Core, GUI
or a user metatype.
Change-Id: I4f41d44a61a9839f58b957219c2404512630587a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
[ChangeLog][Potentially Source-Incompatible Changes] The qmetatype.h
header no longer includes qvarlengtharray. It might be necessary to
include the header explicitly if code previously relied on it being
implicitly included.
Change-Id: If58245836715ec8a323ec8cbadc67d73a742b15f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Create QAbstractSpinBox test
Update test for QSpinBox
Add tests for QDoubleSpinBox, QDateEdit, QTimeEdit
Add test for QDateTimeEdit incl. calendar popup
Task-number: QTBUG-99677
Change-Id: Ia74686f47a1520ab4c7e878b19fc774e00db88dd
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
During a touch update, this looked questionable since I don't have any
barcode readers or buttonboxes attached:
XI2 touch event type 19 seq 1481 detail 193 pos 116.3, 77.8 root pos 6476.3, 2941.8 on window 3e00006
valuator BARCODE value 47796.365791 from range 0.000000 -> 65535.000000
valuator BUTTONBOX value 59504.858830 from range 0.000000 -> 65535.000000
touchpoint 193 state QEventPoint::Updated pos norm QPointF(0.729326,0.907986) area QRectF(...
After the fix it's like this:
XI2 touch event type 19 seq 1235 detail 201 pos 154.0, 64.3 root pos 6168.0, 2794.3 on window 5000006
valuator Abs MT Position X value 45520.589958 from range 0.000000 -> 65535.000000
valuator Abs MT Position Y value 56519.790001 from range 0.000000 -> 65535.000000
touchpoint 201 state QEventPoint::Updated pos norm QPointF(0.6946,0.862437) area QRectF(...
ValuatorClassInfo's QXcbAtom::Atom is a Qt enum, which has to be
converted to xcb_atom_t before we can call xcb_get_atom_name_name.
Originally in ce2fe90faa vci was of type
XIValuatorClassInfo; then 7499d4404f
changed it to our ValuatorClassInfo struct, but didn't add the lookup
indirection to this qCDebug.
Pick-to: 5.15 6.2 6.3
Change-Id: Ib6107f17d6c6c209573e3df54149d6cfffc0b8b6
Reviewed-by: Liang Qi <liang.qi@qt.io>
...for now anyway. The plan is to have C++ API for custom handlers
later on; and we'll see if we find any other "must-have" use cases.
Task-number: QTBUG-68110
Pick-to: 6.2 6.3
Change-Id: I5e624a500af37797345d25bb5f54b146b13a45ca
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Since this is only used by qtpaths and qmake, let's not make every
application pay the price of dynamically initializing a QString whenever
QtCore is loaded (which 100% of Qt applications do). Instead,
initializing a null pointer costs zero and is one third the size of
QString. Even the assignment in qmake and qtpaths is faster this way.
Pick-to: 6.3
Change-Id: I6fcda969a9e9427198bffffd16ce8d1eb8dc19da
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
As with QHoverEvent, it's better to require globalPos rather than
"initialized to QCursor::pos(), which may not be appropriate" as the
docs have pointed out for many years now. This removes the remaining
calls to QCursor::pos() in event constructors.
Task-number: QTBUG-52430
Task-number: QTBUG-69433
Task-number: QTBUG-100324
Change-Id: I076dae56f37abaad7085cc95dddee453a80a45f3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Clang-cl supports the clang detections, and only approximates specific
MSVC version.
This works as the MSVC standard library is ahead of the clang standard
library. Where this logic was written 7 years ago when it was not the
case.
Pick-to: 6.3
Change-Id: Ic13e2f2fbcde011a0d8831cc48c0c9041bfe3b99
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Change ref() and deref() in qatomic_cxx11.h to use acq_rel ordered
semantics as documented instead of the stricter sequential consistency
that was previously used implicitly.
It was pointed out in the discussion on atomic reference counts that
acq_rel semantics should be sufficient for reference counts. It also
turned out that that is all that the definition of "Ordered" in the
documentation really guarantees.
Original-patch-by: Kevin Kofler <kevin.kofler@chello.at>
Change-Id: I6cd50b34bdc699ff8b7c8fe6d303b28d71494731
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The string was used as the return value of QLibraryInfo::build() and
also string-pasted into the format string in qt_core_boilerplate(). As
a proper substring (not suffix) of the format string, QT_BUILD_STR
could not be shared among the two users.
Fix by interpolating QT_BUILD_STR into the format string, so
QT_BUILD_STR appears by itself in both functions. The string should
now be shared, but compilers have quite low limits on lengths of
strings they will share, so turn the macro into an static function so
the actual string literal appears only once, guaranteeing
de-duplication.
It also feels a bit safer to interpolate the build string instead of
pasting it into the format string; it's not immediately obvious that
it cannot contain %s itself, even if we could expect a compiler
warning in that case.
Change-Id: I69d90c37c3a3dcf8ac46d4f36e7c0d2cf3b947af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It's literally
return true; // or
return false;
so it can be marked as noexcept and (the stronger form of) pure.
Change-Id: Id55fee1db5d18201be2ea6c6778ece3de68b05f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Even if it's unlikely any of those would exceed 2 billion entries.
Pick-to: 6.3 6.2
Change-Id: Ib0d4d4e7a64fcde03b7f24bc0667d63c4a737deb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Avoid allocating all these strings on load. Part 1: tables.
Pick-to: 6.3 6.2
Change-Id: Ibf7af9aea0088efe68b247c68022b98143634616
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The cachedRelaySlotMethodIndex started out as -1, assuming no slot
could have that index.
But 0 is just as good a marker, because we know that method index 0
will be one of QObject's (destroyed() or deleteLater()).
So start out with a zero initial value, which means the variable can
be placed in the BSS segment now and doesn't need to be stored in
DATA.
Pick-to: 6.3 6.2
Change-Id: I40b96d54f11e60348f465cafa15af98d41038c95
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Apple Clang 12:
qcalendar.cpp:456:22: error: loop variable '[key, value]' is always a copy because the range of type 'QFlatMap<QString,
QCalendarBackend *, (anonymous namespace)::CaseInsensitiveAnyStringViewLessThan, QStringList, std::vector<QCalendarBackend *>
>' (aka 'QFlatMap<QString, QCalendarBackend *, (anonymous namespace)::CaseInsensitiveAnyStringViewLessThan, QList<QString>,
vector<QCalendarBackend *> >') does not return a reference [-Werror,-Wrange-loop-analysis]
for (const auto &[key, value] : byName) {
^
Change-Id: I54f205f6b7314351b078fffd16d05e5cd3ef4c22
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Common module uses the qt-cmake-private-install to install.
This ensures all configurations are installed.
Pick-to: 6.2
Change-Id: I4be97685c25392838dbc7ab7c3526f55987c08e6
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
The option name should be passed instead of it's value.
Pick-to: 6.2 6.3
Change-Id: I74529c36c438f5d40ecd4dcf689b3ea2a100e5fb
Reviewed-by: Iikka Eklund <iikka.eklund@qt.io>
Because it's BiC.
From the API review.
Pick-to: 6.3
Change-Id: I69f1fe58428241a876ae9058e8a0108a8e496c22
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
During delivery of a pointer event, another type might be synthesized
from it; and we are not yet "done" with all access to the original event
until the delivery of the synthesized event is completed. Further,
there could be a nested event loop if exec() is called on a dialog.
If QPointingDevicePrivate::pointById() causes activePoints to grow
(for example if we handle a fresh incoming touch event in the nested
event loop), reallocation could cause the persistentPoint reference near
the top of processMouseEvent() to be dangling by the time we get to the
bottom; so we need to call queryPointById() again to be sure to get the
persistent QEventPoint that is actually used in the current mouse event
to ungrab.
Fixes: QTBUG-97157
Pick-to: 6.2 6.3
Change-Id: Ib3b90eef5db691675b03474fd75981e972d11d2d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
When the positions were large enough, we would get precision errors
with the floating point numbers.
We calculate the relative position:
dpos = pos + dashes[istart] - doffset - estart
and then later
pos = dpos + estart
If estart is a huge number (range of 10^18) and dashes[istart] is
a low number (10^1), then estart + dashes[istart] == estart and
the loop will never progress, dpos will be 0.
Since the loop should never iterate more than dashCount times
(since we cut away all full dash sequences before entering it),
we add a failsafe that exits the loop if it detects the error.
Fixes: QTBUG-99690
Pick-to: 5.15 6.2 6.3
Change-Id: Ia6a42f21b6b4c6adf5cdd703b6483750513a88ba
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Use alternative method for finding searchPath since
QT_TESTCASE_SOURCEDIR did not point to a correct location on webOS
QEMU test environment.
Fixes: QTBUG-99954
Pick-to: 6.3
Change-Id: I05f95b4aa02027976036d0842ca564a602e01d0e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
It's more efficient than our QThreadStorage and definitely much better
than the Q_GLOBAL_STATIC+QThreadStorage solution. We can do this because
the last compiler not to have thread_local support was MSVC 2013, which
is no longer supported since Qt 5.11.
QThreadStorage also managed the lifetimes of pointers for us, so the
equivalent thread_local requires std::unique_ptr.
Change-Id: Id59bdd8f1a804b809e22fffd15405f1b394c48d8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
When QCborValue referred to an empty array or map, toArray() and toMap()
would respectively return the default value instead of the empty object,
as expected.
Pick-to: 6.2 6.3
Change-Id: I5e52dc5b093c43a3b678fffd16b60456d0037ad7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Instead of duplicating two dynamically-initialized statics each in two
functions, causing four threading guards to be emitted by the
compiler, pack the two variables into a static struct and the struct
into an Extracted Method, leaving just a single threading guard.
https://godbolt.org/z/a9e5o848f
Uses C++14 NSDMI-in-aggregates, so doesn't work in 5.15.
Pick-to: 6.3 6.2
Change-Id: I98e053df48aafd5720ceffd514d6811fd3b28b1a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Qt6QmlMacros uses the value of GNUInstallDirs's CMAKE_INSTALL_LIBDIR
to calculate the rpath from a Qml plugin's location to the Qt
libraries.
By default CMake detects the value of CMAKE_INSTALL_LIBDIR, and on an
RHEL system it is set to 'lib64', whereas we usually configure Qt with
the lib dir set to just 'lib'. This might cause issues with Qml
plugins not locating the Qt libs due to an incorrect rpath.
Ensure that when building Qt libraries and plugins,
CMAKE_INSTALL_LIBDIR is set to the same lib dir value that Qt was
configured with.
Pick-to: 6.3
Fixes: QTBUG-99707
Task-number: QTBUG-100432
Change-Id: I17b2a22d46ef3b40084a2f6a4992f0e23b35d4d3
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The call becomes simpler, and QCollator no longer needs to befriend
QString.
Pick-to: 6.3
Change-Id: Ie2c977dc39973423f07563a0702a83fa3c75270d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Specifying the options would do nothing, so it's better to error out
early in case the developer accidentally added them.
Pick-to: 6.2 6.3
Change-Id: Ia516468a22c3c48e9e84dc78e522e8870186d96b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The option is used to specify a list of Qt repos (git submodules)
that should be included in the configuration of a top-level Qt build.
The option takes a comma-separated list of qt submodule names e.g.
'qtbase,qtsvg,qtdeclarative'
It can also take a single value like 'qtbase' or 'qtquick3d'.
Each specified submodule and all of its transitive dependencies will
be included when configuring the top-level Qt build (assuming that the
submodules have previously been already checked out).
Any missing submodules or dependencies will not be automatically
checked out, but rather skipped. This can result in a failed
configuration if a required submodule is missing.
If some optional transitive submodule dependency is not desired in the
build, you can combine the -submodules option together with -skip
options.
E.g. configuring with
-submodules qtdoc,qtnetworkauth -skip qtmultimedia,qtimageformats
will result in a top-level build with the following submodules:
- qtbase (common dependency)
- qttools (dependency of qtdoc)
- qtactiveqt dependency of qttools)
- qshadertools (dependency of qtdeclarative)
- qtdeclarative (explicit)
- qtnetworkauth (explicit)
- qtdoc (explicit)
Pick-to: 6.2 6.3
Fixes: QTBUG-100388
Change-Id: Ie8c47cfd1d1e0e44a27260bf9ddf968531cc1cc0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This makes skipping a list of submodules more concise.
e.g. instead of passing
-skip qtsvg -skip qtimageformats -skip qtmultimedia
pass
-skip qtsvg,qtimageformats,qtmultimedia
Pick-to: 6.2 6.3
Change-Id: I6a48828b2fd7cec9f6e19988f7b4033333768abb
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Fixes errors like
In file included from
qtbase/include/QtCore/6.4.0/QtCore/private/qcore_mac_p.h:1:
qtbase/src/corelib/kernel/qcore_mac_p.h:61:9:
error: unknown type name 'mach_port_t'
Amends e05300163e
Pick-to: 6.2 6.3
Change-Id: I8f4c579e9b8ef187859497361c4e126a486a543c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
There are issues when building examples as external projects in the CI
in child repos like qtsvg.
QEMU configurations fail to find some CMake Config files, Windows
configs fail to find libraries.
Until these issues are fixed, build examples in-tree (without using
external projects) like we did before.
Temporarily disables 98c89c8cc1
Pick-to: 6.2 6.3
Task-number: QTBUG-90820
Task-number: QTBUG-96232
Change-Id: Ia4b39812b27cfde5f5a103fd39cc1cb032842643
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Use Q_CORE_REMOVED_SINCE macro for fromAce()/toAce() API changes.
Pick-to: 6.3
Change-Id: I057c6d648c2141929f04e4b4c4a38ba3275261ab
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Use Q_CORE_REMOVED_SINCE macro for languageToCode()/codeToLanguage()
API changes.
Pick-to: 6.3
Change-Id: I8cc5279b1272165541c345241af49523c0f25737
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
When QFont::PreferNoHinting is set, we disable the automatic
grid-fitting done by DirectWrite in order to get shapes as close
as possible to the original design.
[ChangeLog][Windows][Text] Automatic grid-fitting is now disabled
for fonts that set QFont::PreferNoHinting.
Change-Id: Idfd3707153799bb8aa13f0d23e4dd6f1893ce53d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Switched to use runtime path instead of compile time path for the
helper executable. Some tests cases were failing on webOS because of
wrong path.
Fixes: QTBUG-99846
Pick-to: 6.3
Change-Id: I566bc04bdb96ac6e7dd0a875eadb50685aef8282
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
It leaves the system in a state that breaks at least one later test,
so put it last. (This was first seen when picking back to 6.2, but I
am now able to reproduce it on dev.)
Amends commit 78eac57f3d
Pick-to: 6.3
Change-Id: I918cf43cdfc27357329a175518d6f9755747bae5
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The QSinglePointEvent ctor assumes that the given globalPos is correct,
so it was wrong that the QHoverEvent ctor passed along a local position
as global. It's better to require globalPos as an argument; and in fact
it seems that everywhere we construct a QHoverEvent, global position is
available, or possible to get by transformation (which is better than
resorting to QCursor::pos()).
Also, don't convert to QPoint: pointer events have qreal resolution and
there's no reason to truncate them.
Fixes: QTBUG-100324
Change-Id: I919455da36265988d3d149eb97563c9ed0d2c660
Pick-to: 6.3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
On X11 we already had to wait as window managers might scroll windows
in. On macOS we also waited - albeit a bit shorter - also because
screens scroll in slowly.
We didn't wait on Windows, and on Windows the test is quite flaky.
Attempting to make it run stably by waiting for long enough so that all
paint events are flushed to the screen.
As a drive-by, break some overly long lines.
Task-number: QTBUG-100412
Pick-to: 6.3
Change-Id: I49b1e447aced2fe1af3c5d30b514f8df3cc1813c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Rename the `failureLocation` variable to `messageLocation`, as
it does not necessarily contain information about a failure.
Change-Id: I9e78dc76c8111c78e34c36f6623e9a8cc9e4764e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
A default-constructed QPluginLoader erroneously reports that the
load hints are empty. However, setting a filename would then
automatically set the PreventUnload hint, surprising the user.
Return the correct flags instead.
Amends 494376f980
Change-Id: I7a95964cb680afd3adf2f71ed73d2f93023238f2
Fixes: QTBUG-100416
Pick-to: 5.15 6.2 6.3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When running a test under increased verbosity levels, QTestLib would
print "failure location" for every QTest function (QVERIFY, QCOMPARE,
...), even if there's no failure at all.
Keep the code centralized, but split the formatting of failures and
non-failures (other messages).
Task-number: QTBUG-96844
Change-Id: I3c508653176b68579dc0eb0cffcc153a52da2e2c
Pick-to: 5.15 6.2 6.3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It is an important and useful part of the API contract that the
QFutureWatcher signals will emit complete information after
setFuture() on an already started QFuture. If that wasn't so, some
API clients would need two code paths to gather state and progress
information: one through the signals for not yet started QFutures,
and one through the state querying APIs for already started
QFutures.
The previous documentation was not precise enough to rely on, even
though the implemented behavior - cf.
QFutureInterfaceBasePrivate::connectOutputInterface() -
seems well thought out and implemented to rely on.
Pick-to: 6.3 6.2
Change-Id: Iaf3db37a851f07ac85881adaea5c83612a7fd843
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Remove a couple of unnecessary string literals that only coped with an
impossible situation (default return after a switch that cover all the
enumerators).
Add a Q_UNREACHABLE() for good measure.
Change-Id: I8065218554edf98408d9c0823b8c301932681c59
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Avoid, for years before the first rule, a whole lot of complications
needed when handling dates later than that rule's start. It is not
entirely clear the code would previously have Done The Right Thing; it
now is clear what it does.
Change-Id: I00a79c0a4733f1deb0bbfecb03e1c64a104d08a3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>