Add a test running QAbstractItemModelTester on the model.
Pick-to: 6.6
Change-Id: I40c141c7e754ca05234da611534bd65e456be2fb
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Found by using -Wshorten-64-to-32 clang compiler flag, or adding that
flag to the flags clangd uses.
Drive-by changes:
- Refactor a small while loop
- Use reverse iterators
- Move instead of copy while constructing a QList
- Replace QPair by std::pair (see QTBUG-115841), and also for its CTAD,
otherwise I'd have to spill the types out:
updatedFiles.emplace_back(QPair<QString,QFileInfo>{translateDriveName(driveInfo),
std::move(driveInfo)});
otherwise the clangd complains:
Alias template 'QPair' requires template arguments; argument deduction
only allowed for class templates
Task-number: QTBUG-115841
Pick-to: 6.6 6.5
Change-Id: I942459f039f6db23f7c1928fe758c6dbf339cd2b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QXcbWindow::requestActivateWindow() is called from the main thread,
while handleMapNotifyEvent() is called from the XCB event thread.
In a data race, handleMapNotifyEvent sets m_mapped to true, before
requestActivateWindow() checks if it is false and sets
m_deferredActivation to true.
If that happens, a window activation is skipped until the next window
systems event is processed.
This is harmless in a normal application environment, where each mouse
move causes window systems events to be processed. In an autotest
environment, it causes flakiness, because an expected window activation
may or may not happen.
As a workaround, QApplicationPrivate::setActiveWindow() is frequently
called after QWidget::activateWindow() or QWindow::requestActivate(),
to set the active window on application level. In essence, this is
setting expected outcome of a skipped deferred activation by force.
This patch protects access to m_mapped and m_deferredActivation with a
QMutex in both methods. That prevents the data race and ensures all
deferred activations processed.
Calling QApplicationPrivate::setActiveWindow() after activation on
window/widget level becomes redundant.
Task-number: QTBUG-119287
Pick-to: 6.6 6.5
Change-Id: I2eee69292afe0ef6381880a10d4e8483c2c7cbfa
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We need an owning container to keep the data alive when the _data
function computes the expected value instead of passing it as a
literal string, so replace the QByteArrayView we used so far with a
const QByteArray.
If a test failed, print the tail ends of the failing strings. This
is useful when toString() implementations printing the operands of
the failed toString()-under-test result comparison decide to
truncate the output. It works around the fact that we both test
toString() and use toString() to report any failure.
As a drive-by, add a missing blank line between function definitions.
Amends a2551c45d4.
Pick-to: 6.6
Change-Id: I0b217aeb1a6d475df8e8b9fb821046f1cceb1a3e
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Derive them from the chosen output buffer size instead, itself a
symbolic constant.
Pick-to: 6.6 6.5
Change-Id: I33aa351ba358b106b448f886b92e952e53bc75f9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Use C++14's std::index_sequence instead of our home-brewed
QtPrivate::IndexList. I used make_index_sequence<sizeof...(Types)>
instead of index_sequence_for<Types...> to avoid having to resolve
another type-dependent template alias.
Remove the helper's vacuous \internal qdoc block.
As a drive-by, rename the helper function to prevent it from
participating in QTest::toString() overload resolution, and
fix spaces around &.
Pick-to: 6.6 6.5
Change-Id: I5981a9b1a99fbe741e75820a6954d066ced9573d
Reviewed-by: Jason McDonald <macadder1@gmail.com>
In Qt 6, it is no longer possible to create a weak pointer from a plain
QObject pointer.
Consequently, we don't need the work-aronuds introduced for QTBUG-22622.
Except that we still need to keep the functions as they are exported.
Mark them as QT6_ONLY, so that they'll be gone automatically come Qt 6.
Amends e40320c552.
Change-Id: I568da04008374c891a111eee49f6679dabdfdee4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The cast that prevented it was a remnant of QStringView (which, like
QString itself, stores char16_t, but interfaces in QChar).
Remove the cast, add the constexpr.
[ChangeLog][QtCore][QUtf8StringView] data() is now constexpr, too.
Change-Id: I7891b89bf26176484411b4388ded04e56651b607
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
It's required for C++ containers.
Change-Id: Id5b51e1af22ac6e452019e976f50c727bbba6948
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
When I split Qt::partial_ordering off of QPartialOrdering, O
duplicated the partialOrdering() test, but lost the conversion() part
of the tests.
This patch brings them back.
Because we maintained the test coverage for Qt::partial_ordering, it
suffices to check that QPartialOrdering::X correctly maps to
std::partial_ordering::x. The rest follows from transtivity of
equality.
We're still lacking conversions of QPartialOrdering to Qt::_ordering
types. That will be the subject of a follow-up patch.
Amends 4b6f757020.
Change-Id: I1938d09f696ed8d58143dbacccb72cfd54ca12dd
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
First, replace double quote characters with 3 escaped double quotes
to allow QProcess::splitCommand() to treat it as an actual quote
character that's part of the tag.
Then, escape single quote characters so they don't interfere with
the shell command and also to be treated as part of the argument.
Lastly, surround the args with escaped double quote so that args
with spaces are also treated as one.
Amends b044323c16.
Example of this:
tst_qkeyevent::modifiers("M","e","t","a") for double quotes
tst_qunicodetools::wordBreakClass(two words) for spaces
tst_QSpinBox::stepSelectAll("don't select all") for single quotes
Task-number: QTQAINFRA-5703
Change-Id: Ie4317e4350bbac619bac41e41f42613f50cf1ad4
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
It uses the ciphersuite name which smart tools one day will mark as
weak (i.e. https://ciphersuite.info/cs/TLS_DHE_DSS_WITH_AES_256_CBC_SHA/
in our example), names in the example are not in the standard notation,
+ it is and always was OpenSSL-specific example.
Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-119464
Change-Id: Ic6f095ff2c861582de756bf220e2e74106b88e83
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This change is required when running in real hw with eglfs backend. It passed on CI because CI used "offscreen" backend and eglfs is not tested on CI at the moment.
Task-number: QTBUG-115777
Change-Id: I4bbfbedcbe21c5c2041be9bdb8ae370156bb6200
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Function is the more popular term in the documentation. Method is
also a tad confusing, because QCryptographicHash calls the algorithm
'method'.
Pick-to: 6.6
Change-Id: I9922f837b04311a4ef45e1c6de6b8e12a32e4f1e
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Move the orientation change handling to the display manager
and call it from the relevant places to repeated and scattered
code for the same functionality.
Bring back part of 072387edec
which checks discard a resize event that's not valid that
reports not up to date layout size.
If DisplayManager.DisplayListener.onDisplay() initiates the
orientation change, handle it immediately if we don't expect
the size to change, i.e. if the orientation is changing from
portrait to inverted portrait and vise versa for landscape.
Otherwise, expect the change to be initiated again shortly
after from QtLayout.onSizeChanged().
Also, add improve the unit test of the orientation change,
and test for the widget size after such changes to make
sure QTBUG-94459 is not reached again.
Fixes: QTBUG-119430
Task-number: QTBUG-115019
Task-number: QTBUG-94459
Change-Id: I5f060d91531af677ddf891f2af360d5f399e26e5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
We need to warn only when using a major version that is the next one
after the 'max supported version'.
Add an assertion that the max sdk version specified in .cmake.conf
needs to be just the major sdk version, without a minor or patch
version component, otherwise the '+1' math expression will fail.
Pick-to: 6.6
Task-number: QTBUG-119490
Change-Id: Ib30abe7157c2ccbe0ad7a98e81fc241685a141a8
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The minimum sdk / xcode version is a requirement, so if the minimum is
not met, we should generally error out.
Changing the behavior in the already released 6.6.x series is not nice
though.
Refactor the code to support both a warning-first and error-first
approach. Keep the warning-first behavior as-is in this change and pick
it to all relevant branches.
A follow up change will switch the default to the error-first approach
for as-of-yet unreleased Qt branches.
To support both approaches, there are now two variables to flip the
warnings into errors and vice-versa depending on which is the default
for a particular branch:
- QT_FORCE_FATAL_APPLE_SDK_AND_XCODE_CHECK
- QT_FORCE_WARN_APPLE_SDK_AND_XCODE_CHECK
The maximum SDK version check remains a warning, because building
against the newer SDK might still work, even if it isn't yet marked as
supported.
Amends a29bff3d80
Pick-to: 6.6
Task-number: QTBUG-119490
Change-Id: I92dedd69efc266dfc1c8cf15c93887be74fc99d8
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This fix uses the \ingroup command to add the stereoscopic example to the
examples-widgets-opengl group.
I also elaborated on the hardware requirements.
Fixes: QTBUG-119280
Pick-to: 6.5 6.6
Change-Id: I6d5b992e533b897d84100f0f897aae97ef89290f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
qt_mainwindow_layout(mainWindow) returns the pointer to a stale object,
if the layout has already been deleted.
Most users of qt_mainwindow_layout() assert the returned pointer, or
handle nullptr explicitly. If the mainwindow layout has already been
deleted, they will still access it. While this has not lead to (known)
issues yet, a UAF exception is thrown in an ASAN build.
=> Use a QPointer instead of a bare pointer.
=> Add missing nullptr check in QDockWidgetPrivate::endDrag()
Pick-to: 6.6 6.5
Change-Id: I3484b53e0e2213b82085ceed3ffa66913947189f
Reviewed-by: David Faure <david.faure@kdab.com>
As a step towards a more synchronous event delivery on macOS,
we enable synchronous delivery of touch events.
Change-Id: I2ceda2684a973ed2a83beec624b2bab8dd073dda
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The OpenGL context was only destroyed when the HasNativeWindow flag was set,
as a consequence there was a context leak.
Remove this condition and always destroy the context.
Change-Id: I3e3424e9d6f179171872fdef5c929a5718af0ed5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
The local version of the fortune server and clients were not using the
transaction paradigm yet. This patches fixes it and makes the example in
line with the network version.
Pick-to: 6.6 6.5
Change-Id: Ieb68f67e2921f46acd682f81dfa5dc5b040c88f5
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
When using CMake 3.19 or newer, we generate a .qt/QtDeployTargets.cmake
file per project. This contains the following information for each
deployable target:
1. The full path to the produced artifact. This will allow us to avoid
the file name heuristics when deploying QML plugins.
2. The DLLs that are needed at runtime, when using CMake 3.21 or newer
on Windows. This will allow us to deploy QML module backing libraries
and runtime DLLs of to-be-deployed targets.
Task-number: QTBUG-117948
Task-number: QTBUG-118153
Change-Id: I8a670e44f62a872f1a21174e947d87ccb8191073
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The tests were skipped since 2018 due to QTBUG-66223.
The tests were never re-enabled even though the issue log indicates
that failure were not reproducible anymore.
Task-number: QTBUG-66223
Task-number: QTBUG-59336
Change-Id: I96ddfb2cd4ddbcac82feddcd15279e218104a9b4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Regression in the previous commit, 5ef5f2f1b9
Pick-to: 6.6
Change-Id: I03786264d064b7d0cf2b88a5d06aa63ffb19ae8b
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
It passes locally, let's give it a shot in the CI.
Fixes: QTBUG-24318
Change-Id: I7df735bdc7963c9c1a8ad8befdc0642f796c32a1
Reviewed-by: Doris Verria <doris.verria@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
It fails frequently. Might have to blacklist the entire test case, or
even skip when running on qemu, if this doesn't help.
Task-number: QTBUG-119616
Pick-to: 6.6
Change-Id: I446612c0fb5b2afc021aeb2fab9be010ac071acd
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
QDockWidgetGroupWindow was documented by a few lines of code comments,
omitting the most critical part of its design: It must not become able
to acquire focus (i.e. be dragged or dropped) while having only one
QDockWidget child.
=> replace legacy code comments by structured internal documentation.
Pick-to: 6.6 6.5
Change-Id: I410ebf2e4c20c7479038417a4d8448dce8ab995f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The legacy QWindow convenience subclass does not have the
robust logic that was later implemented for the Vulkan backend of
QRhi. (i.e., never trust the QWindow; problem with QVulkanWindow
is that it half-trusts those values still, which leads to the
classic pixel-size-differs-by-one problem)
Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-118568
Change-Id: I5f83999e86a9907efe08b38ca069bae20152a4e0
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Mention 'HMAC' as something people will search for
* Change description to actually reflect code snippet
(where the key is passed to the constructor)
* At least mention that the security of the HMAC depends
also on the length of the key, as the code snippet
uses an artificial/short key. Not sure whether we
should further expand on this, or link to some other source?
Pick-to: 6.5 6.6
Fixes: QTBUG-119499
Change-Id: I2768d9a9d553957e1a778c798d82a73468bee16f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Oldest GCC version we nowadays support is GCC 9.
Change-Id: If35ef1aa7bf63da55404832107226e1fa139723e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Merge different lists, and make order of compiler options more consistent.
Change-Id: I3a760d581cc2062f97d519c7316b77cbc9992203
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
The compilers will only warn about using makeValueFuture from
Qt 6.10 onwards. Anyhow, for the documentation, it makes more
sense to deprecate it right now, as an alternative API is
available. So deprecate in documentation for Qt 6.6, but
mention that the compiler warning will only be shown in Qt
6.10.
While at it, also make sure the deprecation messages are
proper sentences (end with a dot).
Pick-to: 6.6
Fixes: QTBUG-116898
Change-Id: Iff90441372b788f9ea42634866d97068275bf0ca
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It was an oversight.
Amends a29bff3d80
Pick-to: 6.6
Change-Id: I696d7a2650c336dc93df01245065bcbb61ca1d6b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This adds API to set arbitrary values for axes in variable
fonts to QFont.
It also implements support for the API in CoreText, FreeType
(on all platforms) and DirectWrite.
Note that in order for the mechanism to work with
application fonts on DirectWrite, we need to keep the loader
for the fonts around for the life time of the font (otherwise
they cannot be reloaded with different parameters). The way
this was handled before (just re-creating and throwing away
the loader every time) was not ideal anyway, and this finally
gives us a good reason to fix it.
Fixes: QTBUG-119421
Fixes: QTBUG-117835
Fixes: QTBUG-117838
Fixes: QTBUG-117839
Change-Id: I3d1fe95fba1f9df52f34aa42e1ac5fa47dbe6d1a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
- Use QStringView.
- Use a list of a pair-like struct to represent the state instead of
2 lists.
- Use qsizetype.
- Use constLast() to avoid detaching.
Pick-to: 6.6
Change-Id: I5ff8a17a4d583a7d2a0a11a52c29b9117280382c
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Add a test running QAbstractItemModelTester on the model.
Pick-to: 6.6
Change-Id: I6ea5d34308357409b9a13eb0271392c8d171addd
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
The default behavior for QColorDialog is to use the native dialog,
but for clients that implement their own color dialog we should
provide the plumbing to do the actual color picking. The fallback
path for this on macOS involves grabbing the screen, which brings
up the permission dialog. The NSColorSampler API does not have this
issue.
[ChangeLog][macOS] Non native color dialogs now use native color
picking when picking colors from the screen.
Pick-to: 6.6
Change-Id: Idd08a90a3747546fd9825431ab7a4f5b5fa40784
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
We don't need to keep the entire original message in QDBusMessagePrivate
after we've demarshalled it, nor do we need to keep a link to the
message we're replying to. In order to reply properly to a message, we
only need two pieces of information: the serial of the method call being
replied to and the service that originated the call.
Fixes: QTBUG-69919
Change-Id: Ic5d393bfd36e48a193fcffff13b7375db459e619
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
QDoc in Qt 6.7 introduced new commands for C++ type ordering, \compares
and \compareswith .. \endcompareswith. The latter is a block command
that allows defining a comparison category, a list of types the
category applies to, and optional further information inside the
command block.
Introduce convenience macros that allow a single-word/single-line
command to provide the category/types in cases where further information
can be omitted.
Task-number: QTBUG-104110
Change-Id: I850498c79bd6885906fbc58d0517d33f5a13cf4b
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>