Slot QAbstractButton::animateClick() is commonly connected to
signal QLineEdit::returnPressed() in dialogs.
The function had a parameter with a default for specifying the delay
which requires a lambda when using Qt 5 connection syntax.
Since the default value is used practically everywhere, remove
the parameter.
[ChangeLog][QtWidgets][QAbstractButton] The interval parameter has been
removed from QAbstractButton::animateClick().
Task-number: QTBUG-81845
Change-Id: I4e399138b6aa3a9f0b31c1f10de97ffcbab6a337
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It's very disorienting when a context menu pops up on a different
screen from where the right mouse button was clicked.
QWidgetPrivate::setScreenForPoint() can give incorrect results in
multi-screen desktop configurations; but we can give the menu a hint
by setting initialScreenIndex, which was originally used only when
QDesktopScreen or QDesktopScreenWidget is the parent (see
b3fc5e1ea3 ).
Task-number: QTBUG-76162
Pick-to: 5.15
Pick-to: 5.12
Change-Id: Icd4abdc32564430147e6c63a8ea70d483d25cddd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Using an environment prefix wrapper shell script that sources the SDK's
env setup. The script also ensure that we don't loose cmake on the way.
Change-Id: I9d08bc58f0efaf688512ab26a7ddb800309a5015
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When building for qemu, the target "os" is still set to Linux, so try to
detect qemu by looking at the version field.
Change-Id: I7c66cdb29a47a44d5b8a394977136139fc646155
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Use QAbstractButton::click(). Refactor and polish the tests
to use QTRY_VERIFY() instead of qWait(), speeding them up.
Pick-to: 5.15
Task-number: QTBUG-81845
Change-Id: I119bede8143ec1db5f5250517dee38b576d5a8d2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
... and do a local code cleanup:
- add override
- port from foreach to C++11 ranged for loop
- remove dead code (`gestureEvent` (née event) was already
dereferenced when we check it for null'ness, so it cannot be
nullptr, so the condition is always true).
Pick-to: 5.15
Change-Id: Ica5e34fbe65c95f6573630f188582b90be15c8f7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Cleaning up those that are trivial to remove because they have direct
replacements.
Change-Id: I4f5c25884a01474fa2db8b369f0d883bd21edd5b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
rs is the country code for Republic of Serbia, but se is the Serbian
Language.
According to the IANA subtag registry that is referenced in the error
message, the language subtag for Serbian is se.
https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry
This fixes an error when uploading some apps to the Google Play Store.
Fixes: QTBUG-83780
Pick-to: 5.15
Change-Id: I532a3082ca954a78343c873246b09a14d7a80a0e
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
The last (and only) user was removed in 4f076db3d2.
Change-Id: I59b155017bfd00bbcbfe72dc0e535c92c0384dad
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This makes existing calls passing uint or ushort ambiguous, so
fix all the callers. There do not appear to be callers outside
QtBase. In fact, the ...BreakClass() functions appear to be
utterly unused.
Change-Id: I1c2251920beba48d4909650bc1d501375c6a3ecf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Due to the wrong string comparison, we were writing out the wrong
architecture for the arm64 builds to the deployment settings json file.
This leads to androiddeployqt tool not being able to locate the
stdlibc++.
Change-Id: I3d13b14c27f043445bf46aaca0e9f862f6ca84e5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Those can be trivially removed as they have direct replacements, or
are completely unused.
The migration path for QCursor::bitmap and QCursor::mask is
QBitmap *pb = c.bitmap(); // up to 5.15, warns in 5.15
QBitmap vb = c.bitmap(Qt::ReturnByValue); // from 5.15, works in 6
QBitmap b = c.bitmap(); // from 6.0 on
Change-Id: I3b3acd1c7f09c4c8414e98b3ce11986f1ecd5eda
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Also add a piece of documentation that the input needs to be
in lower-case (the implementation uses qt_hash to index into
a table of TLDs, and qt_hash is case-sensitive).
Change-Id: I911c0e2bb0826fc1b0fc01ed60bdfd6e4c0298f2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
For kinetic wheel events, Qt tries to make sure that all events in the
stream go to the widget that accepted the first wheel event.
It did so by directing all events from the stream to the widget from
which the spontaneous event was returned as accepted.
However, that widget might have passed the event on to some other
widgets; e.g QScrollArea forwards wheel events from the viewport to the
relevant scroll bar. The event might then have come back accepted only
because parent propagation kicked in (the scrollbar might not accept
the event, so the parents get a chance, and some parent's scrollbar
ultimately accepts the event).
In this scenario, the wheel widget would be the viewport under the
mouse, when it should have been the scrollbar of the parent. The
next events from the stream were then delivered to a widget that didn't
scroll; and parent propagation is not (and should not be) implemented
for the case where Qt has a wheel widget.
Instead, make the first widget that accepts any initial wheel event
the wheel widget, even if the event was not spontaneous. With this
change, all events from the stream are delivered to the widget that
actually handled the event. That has the effect that ie. a viewport
of a scroll area only gets the first event; all following events are
delivered directly to the scrollbar.
The test case added simulates the different scenarios - nesting of
scroll areas, classic wheel events and a stream of kinetic wheel
events.
[ChangeLog][QtWidgets][QApplication] Wheel events from a device that
creates an event stream are correctly delivered to the widget that
accepts the first wheel event in the stream.
Change-Id: I5ebfc7789b5c32ebc8d881686f450fa05ec92cfe
Fixes: QTBUG-79102
Pick-to: 5.15
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The method should move out of Qt together with QTextCodec in Qt 6.
Qt 6 will in any case always assume utf8 for 8bit encoded HTML.
Change-Id: I68adbc1f0df7e36a82ef6b434ee3771f23e3b790
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
QMainWindow tries to avoid memory allocations by caching tab bars that
are no longer used. That cache is populated when the layout is
activated.
The layout might never be activated when the main window is never shown,
in which case adding and removing dock widgets at runtime will
continuously allocate more memory for tab bars that are created.
A workaround is to call QMainWindow::layout()->activate() explicitly in
application code, once all dock widgets have been removed. This change
avoids that applications have to do that.
Change-Id: I70eb585d2120f0b7b73f59c3ee65d7242c12ec59
Fixes: QTBUG-83135
Pick-to: 5.15
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
When hiding a popup by clicking outside of its area, a window is closed.
Depending on the platform specific implementation details, this can
result in multiple calls to QWidgetPrivate::setVisible(false). The first
one from the handling of the close event in QWidgetWindow::event; the
second from the destruction of the window in QWindow::event.
Since the first call already sets the Qt::WA_WState_Hidden flag before
calling QWidgetPrivate::hide_helper, we can test if the flag is set
and skip the second call if it is.
The included test does not reproduce the issue, as that issue only
reproduces if the close event is generated by the mouse event handling
in the Cocoa platform plugin (which doesn't call QWidget::close, but
rather sends a native close event to the platform window). However, it
verifies that the fix doesn't introduce any regressions.
Change-Id: Id0eda9326a8adf0cc1f6a3840f9ac0b635ab39a1
Fixes: QTBUG-79134
Pick-to: 5.15
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
In the declaration, leave them in as comments so that the gaps in the
numbering of the values doesn't create confusion.
Change-Id: I92ff299416896c471e7c7d80b988cd4642b6b756
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Addresses FIXME comment in qwidget.cpp, where the operator is being
used.
Add documentation, make constexpr and add noexcept as for the other
operators.
As a drive-by, remove invalid const from return type in the
documentation of the other operators. They all return a non-const
QMargins object.
Change-Id: I5a9ca82978d38acd02e03ec00ca202fe1b8cf6c1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The code for doing that existed in the QListWidget::dropEvent override,
and was only using standard itemview APIs to adjust the selection model.
There is no reason why dropping items internally in a QListView
should not do the exact same thing.
As part of moving the code from QListWidget to QListView, replace QList
with QVector, and other minor optimizations.
[ChangeLog][QtWidgets][QListView] Moving selected items within a list
view by drag'n'drop will maintain the selection of those items.
Change-Id: Ie24bec38234839dcb2f0b0ee0302cc59ca101631
Fixes: QTBUG-83084
Pick-to: 5.15
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Now that the standard gives us proper types for UTF-16 and UTF-32
characters, use them. Will eventually make the code much easier to
read than today, where uint could be an index as well as a char32_t.
It also ensures that the result of e.g. QChar::highSurrogate() can
still be implicitly converted to a QChar now that the
QChar(non-characater-integral-types) ctors are being made explicit.
[ChangeLog][QtCore][QChar] All low-level functions
(e.g. highSurrogate()) now take and return char16_t instead of ushort
and char32_t instead of uint.
Change-Id: I9cd8ebf6fb998fe1075dae96c7c4484a057f0b91
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
[ChangeLog][QtCore][QString] Now supports appending, prepending
and inserting QStringViews.
Change-Id: I7538c050c67590f27d91443eda0b94a4b80b62f2
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Add some more details to make it a bit easier for advanced users
to grasp what this is about.
Task-number: QTBUG-80257
Pick-to: 5.15
Change-Id: I9969b5b62384a25d5e90b57ef25c83a8a2a6c9c7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Rather than have a fontChanged() signal which can be connected to for
tracking when the application font has changed, then it is better to
use the event that is sent to all windows and the application itself.
That way it is easy for a window/widget or item that cares about the
change to the application font to catch it in the event() function.
[ChangeLog][QtGui][QGuiApplication] Deprecated fontChanged() signal in
favor of QEvent::ApplicationFontChanged.
Change-Id: Iae8e832238fc85e385a52305bc04f16e597454b0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The SAX API in in Qt XML got deprecated, and examples using it
removed in commit 82d02b7b95.
Pick-to: 5.15
Change-Id: I39b71378c0f797e82431c8a0e12255626ed145ed
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
This patch allows all the sqldrivers to be built as a standalone project.
It is not possible to build each plugin separately due to the configuration
features definition being located in the sqldriver's folder CMakeLists.txt.
In other words, the project needs to be generated from the
src/plugins/sqldrivers/CMakeLists.txt file.
Fixes: QTBUG-82962
Change-Id: If41c7e3827589391830a894a9c998d2e56239562
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Without this behavior enabled by default it is currently not possible to
build QtVirtualKeyboard as a static build. We run into the error where
cmake is trying to promote the targets to be global due the XCB library
already being found by one of the modules in QtBase.
In case we wish to disable this fix, any module can simply specify
QT_FIND_PACKAGE_DISABLE_DEBUG_BEHAVIOR=ON during configuration time.
Change-Id: Id7f2ad12ddea941dda754361660c7606439cd5a4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Added asserts to insure the invariant declared in the documentation.
Canceled future object is not valid, hence we don't need to handle
this case separately.
Fixes: QTBUG-83389
Change-Id: Ib0653ef40cd3135574a91740e4ce2c6dc4da8a71
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This follows up on commits 3e7463411e and
947883141d.
The changing of the pointer of QApplicationPrivate does not transfer
focus properly. It updates the pointer, but it doesn't deliver events
or update the widget hierarchy's focus chain. The result is that
multiple line edits might show a blinking cursor.
Instead, use QWidget::setFocus when the focus proxy has changed while
it had focus, and pass OtherFocusReason rather than NoFocusReason.
Add a basic test for QWidget::focusProxy, which exercises this code
path and verifies that pointers are consistent when focus changes as
a side effect of modifying the focusProxy.
Change-Id: I15a4d868bab2b590cfe4a1daa6a3c8cebc9c9ca2
Fixes: QTBUG-83720
Fixes: QTBUG-79707
Pick-to: 5.15
Reviewed-by: David Faure <david.faure@kdab.com>
It previously applied to dates and date-times, but was documented as
applying to times (and date-times then included it by reference).
It's only meaningful for a date-time.
Change-Id: Id9e8e8cb987b03e5ddc77b05c581b9b6944065fc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The old code got a QMap serialized as a QString and parsed it to
re-create the same map.
Just copy the map.
Change-Id: Ic71b9fa9d822eab53fe37dfb4d76223cd69ac057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>