Replace a manually-managed pointer + size with QVarLengthArray,
allowing use of pre-allocated space.
Change-Id: Ife3abea0b3b0f2577bb76c348513d52d46f79641
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Extend tests to explicitly check the behavior of empty
default-constructed container.
Also add some missing tests to increase the code coverage.
Task-number: QTBUG-91736
Pick-to: 6.2 6.1
Change-Id: Ib3c3f5bcb967cd1031cb24ffceaa77a146212ffd
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
All internal libraries, plugins, object libraries (resources, plugin
initializers) need to be built with bitcode flags when targeting iOS.
Internal here means all libraries added by qt_internal_add_X
functions or associated with internal libraries.
We didn't do that for plugin initializers, which were added not too
long ago.
Extract the logic that links to Qt::PlatformModuleInternal into a
separate function to be used for object libraries.
Use it for resources and plugin initializers. It will also be used
in qtdeclarative for qml plugin initializers.
Pick-to: 6.2
Task-number: QTBUG-95208
Change-Id: I366996078f5e9d1c2d2797f6b81c522ee99529e3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Both the compiler and linker -fapplication-extension flag should only
be applied when building Qt's libraries (not executables).
It's up to the user project whether their code will be restricted with
application-extension-only APIs.
In qmake that can be achieved by adding to the qmake project
CONFIG += app_extension_api_only
In CMake it can be achieved by either adding the compiler and link flags
in the project directly (using target_X_options) or by setting the
appropriate setting in the Xcode project when using the Xcode
generator.
Amends e189126f1a
Pick-to: 6.2
Task-number: QTBUG-95199
Change-Id: Ie7a764d460a89c7650391abff0fcc5abfcabef64
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
We shouldn't force add the bitcode linker flags to user projects.
And we don't link anything when building Qt for iOS itself, we only
archive object files into static libraries.
The final decision whether bitcode should be used is up to the Xcode
project. That is controlled by Xcode's ENABLE_BITCODE option.
Bitcode compile flags are still added when building Qt itself.
Amends a046833176
Pick-to: 6.1 6.2
Task-number: QTBUG-95199
Change-Id: I04c77f659b82269bb8010ea262b2e51f36e9def3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Make qtpaths also available under qtpaths6. In fef850c51a, qtpaths
got extended to replicate the 'qmake -query' behavior. This was meant for
IDE's like Qt Creator, so that they can use qtpaths instead of qmake to
identify Qt versions.
Anyhow, since qtpaths was also available in Qt 5, letting users just select
_any_ qtpaths executable won't work for this purpose. Adding qtpaths6 - like
qmake 6 - allows IDE's to query for a Qt 6 qtpaths.
Pick-to: 6.2
Task-number: QTCREATORBUG-25546
Change-Id: Ifc7e1a76b26cf706872db1bb1f9d3de5f006de24
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Use unique_ptr to indicate ownership.
The QPainter dtor is now empty, = default it.
As a drive-by, fix a non-sensical if (p) p = nullptr;
Change-Id: I5c811eb7de6abf8a9f279cf3630d5f86db6b3864
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
We keep QVector2D storage Qt 6 BC (to avoid making QNativeGestureEvent
larger), but in Qt 7 we should return exactly the same value as given
(for what it's worth, in spite of this being overkill for panning a
reasonable distance).
Change-Id: Iecbd4c9b60ad9ae5e0466c7027b038ddb85b8c8b
Pick-to: 6.2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
In QItemSelectionModel, items which are disabled or marked as not
selectable should not be considered as selected. But this was
not handled consistently.
The following methods considered only items which are enabled and
marked selectable: selectedIndexes(), rowIntersectsSelection(), and
columnIntersectsSelection(). The following methods considered only
items which are marked selectable, but did not check whether they
are enabled: selectedRows(), selectedColumns(), isRowSelected(),
isColumnSelected(), isSelected(). Finally there is hasSelection(),
which did not check for enabled nor for selectable.
This patch introduces consistent behavior. All methods check
both whether the items are enabled and whether they are selectable now.
[ChangeLog][QtCore][QItemSelectionModel][Important Behavior Changes]
All methods in QItemSelectionModel now consider only items which
are marked as enabled and selectable as part of the selection.
Fixes: QTBUG-93829
Pick-to: 6.2
Change-Id: I4725243ea6b0db4f289ce34ada22c7a9d3282713
Reviewed-by: David Faure <david.faure@kdab.com>
The members view, par, and itemFlags were initialized in each
of its nine constructors. This patch moves the initilaization to
the declaration to prevent this repetition.
Change-Id: I71d136e7615dca5d87e8a4dc161c877633017ad0
Reviewed-by: David Faure <david.faure@kdab.com>
The maximum size for a hash result is 64 atm. Even if, and esp when,
we'll get to 128 and 256 bytes in the future, there's no reason to use
dynamic memory, because the sizes will always be statically known.
So use, essentially, a std::array<char, 64> to hold the result
internally. Add a bit of convenience API on top to limit impact on the
rest of the code and add a few static_asserts that ensure this is large
enough. Then give users access to the internal buffer by adding
QByteArrayView resultView() const noexcept. The documentation snippet
is taken from QString::data(), suitably adjusted.
Use resultView() in a few places instead of result().
[ChangeLog][QtCore][QCryptographicHash] Changed to use a
statically-sized buffer internally. Added resultView() to access it.
Change-Id: I96c35e55acacbe94529446d720c18325273ffd2f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
It timed out the other day on the CI. Even the SHA-1 check took 137s
(with a 300s timeout). Skip the SHA-512 test on the CI, but keep it
for manual runs.
Pick-to: 6.1 6.2
Change-Id: I49792ac9bcab6512e1803f66cd986b2830e634c0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Change-Id: I22617a5f7b8971eae679058feaf41ba811e0a3dd
Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
By switching out the static_assert for an enable_if we end up producing
a clearer error, at the call site:
/qt/qtbase/examples/gui/rasterwindow/main.cpp:69:9: error: no matching member
function for call to 'nativeInterface'
app.nativeInterface<QNativeInterface::QCocoaGLContext>();
~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/qt/qtbase/src/gui/kernel/qguiapplication.h:176:5: note:
candidate template ignored: requirement
'NativeInterface<QNativeInterface::QCocoaGLContext>::isCompatibleWith<QGuiApplication>'
was not satisfied [with NativeInterface = QNativeInterface::QCocoaGLContext, TypeInfo =
QNativeInterface::Private::NativeInterface<QNativeInterface::QCocoaGLContext>, BaseType =
QGuiApplication]
QT_DECLARE_NATIVE_INTERFACE_ACCESSOR(QGuiApplication)
^
By using SFINAE for the TypeInfo we can also ensure that it works for
types that are not native interfaces, such as if the user tries to
call nativeInterface<QString>().
Since we can no longer use decltype(*this) to resolve the base type
we need to change QT_DECLARE_NATIVE_INTERFACE_ACCESSOR to take the
type as an argument, as we do for other QT_DECLARE_FOO macros.
Pick-to: 6.2
Change-Id: Ie3f7e01ab7c3eb3dcc2ef730834f268bb9e81e0c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This was the case in Qt 5.15 as well.
The CMake toolchain file that Qt's CI is using is already setting
BUILD_SHARED_LIBS to OFF, but it's better to be explicit like we
are with WebAssembly and iOS.
Pick-to: 6.2
Change-Id: Ief17259c15690a97337e9df451663718601c2a52
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
The watch-dog timer was killing some tests, that take time quadratic
in the size of the data to test on, on their test-cases with larger
data-set sizes. Enable tuning of the data-table creation to leave off
the larger data-sets for thse tests.
Task-number: QTBUG-91713
Change-Id: I9f462f4f2ba03c6518486a26361aa2b847322f8c
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
The tests failed because they couldn't find the servers they needed to
run. The dbus server wasn't being built, due to mis-configured CMake
config; fixed dbus server CMake config. Once built, the servers werent
at the paths relative to the test binaries that were given in the test
source files, because the test binary was in the test/ sub-directory.
The dbus test just needed a ../ on its path; the qprocess one also
needed its path wrapped in QFINDTESTDATA(), and a ".exe" suffix on MS.
Pick-to: 6.2 6.1 5.15
Task-number: QTBUG-91713
Change-Id: I5ace23a5815575bbf88ea88e0b16afc7b8ba6a08
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
QMetaType now implicitly knows how to convert any QFuture<T> to
QFuture<void> without needing to manually register a converter
function.
QtWebChannel will make use of this to transparently support QFuture<T>
return types.
[ChangeLog][QtCore][QMetaType] QMetaType now supports converting any
QFuture<T> to QFuture<void>.
Task-number: QTBUG-92903
Change-Id: Ied7e71be37c346cc3d2c274ffb0d91a6821ab4d4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
For nonblocking Unix domain sockets the connection may not be
completed immediately. So, add a blocking call to waitForConnected()
to improve test stability. Also, explain a possible reason that
cause the connection to fail on Unix.
Task-number: QTBUG-91713
Change-Id: If34070f2383fd0c854e2707c734fe5da4bda1b42
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This is the standard way to call base class methods in Python 3 and
it is shorter than the custom one used now.
Task-number: QTBUG-83488
Pick-to: 6.2
Change-Id: Ifaff591a46e92148fbf514856109ff794a50c9f7
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This replaces QLocale::system().collation(), which left client code
with no way to change this default. Since QLocale's default is the
system locale initially, the old behavior is retained until the first
call to QLocale;:setDefault(). Addition of a separate collation locale
in 5.14 changed from using the default locale to using the system's
collation locale; the present change restores the ability to override
this.
[ChangeLog][QtCore][QCollator] The default locale used by QCollator is
now the collation locale of the default QLocale. This restores the
ability (lost at 5.14) to control the locale used by
QString::localeAwareCompare(), while retaining the use of a collation
locale when the default is the system locale.
Task-number: QTBUG-95050
Pick-to: 6.2 6.1 5.15
Change-Id: I232772bb8f23fffd74573174de70ef2deae372a9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It now uses QtPrivate::condition_variable, it pulls in the correct
header for that, so #include <condition_variable> is no longer needed.
Separate opening braces of function bodies onto next line.
Change-Id: I08f721c4d52756932bb9409e34e51dcbb3eda104
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
It may be the hobgoblin of little minds, but consistency makes code
easier to read. Turn the implementation test into a method of the
class, like all the others, and rename it to match the common pattern.
In the process, eliminate the data-column that was constant, use
simpler expressions for the lists whose entries are all the same and
Split some long lines.
The test still fails, as it did previously.
Change-Id: Ic2d6db1edc0bbafad91cd732babcbc129c430b8f
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Including the error string gives whoever's running the test at least
some clue what's going wrong. One day it might even give them the
information they need to get later runs of the server past this
hurdle.
Task-number: QTBUG-95136
Change-Id: I5d67097339f1db78dfb7ba2ed4357121396977dd
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Extend tests to explicitly check the behavior of empty
default-constructed container.
Also add some missing tests to increase the code coverage.
Task-number: QTBUG-91736
Pick-to: 6.2 6.1
Change-Id: I5b418265fc7cb3e56e44782be7704d642923a8e9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
In case of
QTranslator translator;
translator.load("somedir/file.qm");
and file.qm being a meta catalog file, the sub-catalogs in somedir
couldn't be located, unless "somedir" was set as second argument.
Pick-to: 5.15 6.1 6.2
Fixes: QTBUG-95013
Change-Id: I06103244ce2ff9800c2c64cb0c17f9bc7ef0e8de
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
This makes it easier to further extend the test. The overhead this
causes is negligible.
Pick-to: 5.15 6.1 6.2
Change-Id: I42941879f55337268bb2914e122a5f573ab7e6f9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Pick-to: 6.2
Task-number: QTBUG-94407
Change-Id: Ie9c05dbe498cd372c015b5125e6cb8d59ca96b59
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Otherwise it will confusingly only list the host arch
Pick-to: 6.2
Change-Id: Ic6d080f1fd9ebfa260ce7c35bd5e5b4ee686f083
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Instead of implementing all the intricacies of a cmp for the python
sort-function, support for which is due to be dropped at Python 3 in
any case, implement a much simpler key function that achieves the same
result.
In the process, eliminate the ugly kludge of setting an attribute on a
function to, in effect, communicate with it via a global. Instead,
instantiate a class, that wraps the value previously given to the
attribute and whose instance provides the key-function.
Thanks to Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> for
pointing out that a key function is the way of the future - and
sorted() is a nicer way to sort.
Pick-to: 6.2
Change-Id: Icf1ed5597fedf420d054fbc860e3e7fc6615875c
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
The ordering function used to sort the locale data generated for
QLocale attempted to sort the default territory for a given language
and script before other territories, but was too tangled for it to be
obvious this is what it was doing. The result turned out to be
non-transitive. Replace with code that implements the same preference
but only applies it where the result is compatible with transitivity.
This leads to a shuffling of the order of the Serbian-language
locales, which sorts the Cyrillic ones before the Latin ones. This is
consistent with my reading of the CLDR data, which fills in Cyrillic
and Serbia for Serbian; Serbian/Cyrillic/Serbia did previously sort
before all other Serbian variants.
Thanks to Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> for
discovering the non-transitivity.
Pick-to: 6.2
Change-Id: I0ce9f78e620e714f980f32b85b7100ed0f92ad74
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
... instead of QSharedPointer.
QSharedPointer performs twice as many atomic operations per pointer
copy as std::shared_ptr, and this is private API, we're not bound by
BC constraints, so we can port to the more efficient version.
Change-Id: I9572a8321aae381e5dbe4a51119f2c9494a8fbc7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Both readChannelFinished() and disconnected() signals should be emitted
after closing the pipe. Otherwise, these signals do not correspond to
the state of the socket and may even be resent, if a slot connected to
one of these signals processes events.
[ChangeLog][QtNetwork][Important Behavior Changes] QLocalSocket on
Windows now emits both readChannelFinished() and disconnected() signals
after closing the pipe and emitting stateChanged(UnconnectedState),
which is consistent with the behavior on Unix.
Pick-to: 6.2
Change-Id: I1cc551b7897fdba3cec1fd6705f5396790818c7d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
They will only expand what's currently in the model.
As a drive-by, remove superfluous : after the \warning macro.
Fixes: QTBUG-94981
Pick-to: 6.2 6.1 5.15
Change-Id: I85d38373fb7edf5a5407622b32870e7bcd5d9aeb
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Use unique_ptr to indicate ownership, even though it's conditional (on
QPaintEngine::autoDestruct()). That just requires a custom deleter.
Change-Id: Icf8e356c333f9617b2e5172b14f13197e63c9502
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Android 12 introduced a notification which is shown to the user each
time the app accesses the clipboard via getPrimaryClip.
Currently this notification is triggered, even if we just want to check,
if some clipboard data exists.
So lets not get the actual data and instead use getPrimaryClipDescription
to check for the existence of the correct mime type in the clipboard.
Pick-to: 6.2 6.1 5.15 5.12
Change-Id: I4800f5545ab46b7f6cade0ce9d78c04b50ae96cf
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
With a stylesheet that defines a rule for checked:selected menu items,
the rule was never rendered. Instead, the checked rule was used.
The 'act' variable was initialized based on State_Selected being set, but
that state flags was never set on the temporary QStyleOptionMenuItem
used to render the PE_IndicatorMenuCheckMark.
Note: QStyleSheetStyle falls back to QWindowsStyle for this draw path.
Task-number: QTBUG-73966
Pick-to: 6.2
Change-Id: I3044dbe8f60f1896f79af1afdb26094971704616
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The correct variable to check is WIN32, not WINDOWS.
Amends 85e25d93b3
Pick-to: 6.2
Change-Id: I4570eb5a124bcaa0bd38135dd7c7f48345c40c9d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
In QPanGesture this is called delta().
OTOH we have QWheelEvent::pixelDeltas().
Delta is a vector, and there's only one (with two components).
Native gestures hold incremental values: e.g. the pinch gesture event
provides an incremental amount of either zooming or rotation (so most
events have QNativeGestureEvent::value() very close to 0).
It's the same with the pan gesture's delta().
Add better docs for swipe and pan gestures.
Change-Id: Ia147c7c9a22e084c3700b1620dec46427d792bd1
Reviewed-by: Povilas Kanapickas <povilas@radix.lt>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It came up during 6.2 API review that we prefer all floating-point API
to be double-precision on 64-bit platforms, despite the awkwardness of
representing a displacement vector with something called a "point".
The docs for QPointF explicitly state "A QPointF object can also be used
as a vector: Addition and subtraction are defined..."
Amends 31f90e99b8
Change-Id: I01029661f2586640cbf846f49df164c176d17f7a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>