Commit Graph

67047 Commits (706fe558d89046ef2df842affed40a188dbe709e)

Author SHA1 Message Date
Frédéric Lefebvre 706fe558d8 task_QTBUG_1071_changingFocusEmitsActivated() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I33e7f6b7a9d883de91084b2578990d9641dd9b8d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 19:20:22 +02:00
Frédéric Lefebvre 68b5eb6bd8 tst_QComboBox::keyBoardNavationWithMouse() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Iea8d365bb6e07663517aa710d4730e728d3d1533
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 19:20:22 +02:00
Santhosh Kumar 8f283aa299 Fix progress bar rendering issue when using windows 11 style
The Windows 11 style checks for QProgressBar type and gets the
respective orientation required for rendering. This creates an issue
when we use QStyleItemDelegate as it's not QProgressBar type. This patch
removes that condition and gets the orientation information through the
style option similar to Windows Vista style.

Fixes: QTBUG-124447
Pick-to: 6.7
Change-Id: Ic2b36d79d7af017262e44dd2800ad45fbe63f8f2
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2024-04-29 18:26:15 +02:00
Lena Biliaieva fa456ad550 Add QHttpHeaders to QNetworkRequest
Added headers() and setHeaders() methods to QNetworkRequest.

[ChangeLog][QtNetwork][QNetworkRequest] Added headers() and setHeaders()
methods to QNetworkRequest, which provide an interface to work with
QHttpHeaders.

Task-number: QTBUG-107751
Change-Id: I2e1dc7cb2efab5903eb7ff23b75d01aefe13273d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-04-29 18:26:15 +02:00
Frédéric Lefebvre 979836382e tst_QComboBox::task220195_keyBoardSelection2() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Iaf1ba189666877743eed378403ac4c38500ade18
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 18:26:14 +02:00
Frédéric Lefebvre 2d82a42fea tst_QComboBox::task247863_keyBoardSelection() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I54cfee848fbfbf65f7dd7e87c5eed9e226e03e20
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 18:26:14 +02:00
Frédéric Lefebvre 63e39d573c tst_QComboBox::flaggedItems remove QApplicationPrivate::setActiveWindow
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I49a2b3809f76e6f9db8e807bc4dcdc9d11c43fcb
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 18:26:14 +02:00
Frédéric Lefebvre 78c20baf7d tst_QComboBox::autoCompletionCaseSensitivity remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I973f310c7d2c575612a2ebd4c36693f0dee2be29
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 18:26:14 +02:00
Frédéric Lefebvre 6a6ca07003 tst_QButtonGroup::task106609() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I8cd3ce928ede88ad7351174f6d34c29ba0a7e246
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 18:26:14 +02:00
Frédéric Lefebvre c54a1d7eb8 tst_QButtonGroup::keyNavigationPushButtons() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I07af8483a15344261a316da23707495f7ec2c84b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 18:26:14 +02:00
Frédéric Lefebvre 7b6f7a80da tst_QButtonGroup::arrowKeyNavigation() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Icd8737a881712bb9192b401a0e318fcec4622ac2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 18:26:14 +02:00
Frédéric Lefebvre c36aa81264 tst_QAbstractButton::setShortcut() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I027b78c969affe195bd7dde9a3c974586804d1e9
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 18:26:14 +02:00
Frédéric Lefebvre efbac03168 tst_QScroller::mouseEventTimestamp() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I8f118386b861bfab61fa61c9fb4cf5863abcac83
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 18:26:14 +02:00
Frédéric Lefebvre f81fa1de1d tst_QScroller::overshoot() remove QApplicationPrivate::setActiveWindow
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Iabebbeed38c20a5de150d688850e32a361290a90
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 18:26:14 +02:00
Andreas Eliasson f8bc0e7c3b Doc: Remove \note that indicates you can access the source code
There used to be an examples page; this is no longer the case. Thus,
remove the \note that indicates you can access the source code.

Fixes: QTBUG-122166
Pick-to: 6.7 6.6 6.5
Change-Id: I1abe88000ae406e8d2cc9cc1deed42664607626b
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2024-04-29 17:38:52 +02:00
Tor Arne Vestbø 0b494c47d3 Don't quit automatically via QEventLoopLocker if there are open windows
As part of df359bcb70 the semantics and
interaction between QEventLoopLocker and QGuiApplication was changed,
based on the assumption that these two mechanisms were independent
and should not affect each other.

This had a surprising regression where the use of QEventLoopLocker in
combination with the QCoreApplication::isQuitLockEnabled() automatic
quit would end up quitting the app, even if it had open windows, for
example when the last job of some internal job queue finished.

It could be argued that if the app has open windows that should not
be closed, they should ignore the Close event, and that an application
with running QEventLoopLocker jobs should maintain an active window
showing the progress of those jobs, but still, this is regression
that we want to fix.

We now bail out if !lastWindowClosed() in QGuiApplication's
canQuitAutomatically, which is triggered from QEventLoopLocker's
isQuitLockEnabled() behavior. And we do so regardless of whether
quitOnLastWindowClosed is set or not, as the latter property
determines the behavior when closing a window, not the behavior
when a QEventLoopLocker goes out of scope.

Similarly, we now block quitting of the application when triggered
by quitOnLastWindowClosed() if a QEventLoop is active, regardless of
the isQuitLockEnabled(), as the latter property is determining
whether we should trigger a quit, not whether we should block them.

[ChangeLog][Important behavior changes] Fixed a regression where
the last QEventLoopLocker going out of scope would quit the app,
even if there were open windows, if quitOnLastWindowClosed was
false.

[ChangeLog][Important behavior changes] Fixed a regression where
closing the last window would quit the app, even if there were
active QEventLoopLockers, if isQuitLockEnabled was false.

Fixes: QTBUG-124386
Pick-to: 6.7 6.5
Change-Id: I84fd0ddea78a2f417f3a17b326113c880079cf85
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-04-29 14:26:38 +00:00
Frédéric Lefebvre d93ec246c7 tst_QGraphicsWidget::verifyFocusPolicy() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I2e3a630036b313696f62bbd3183c0448624395e8
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:26:38 +02:00
Frédéric Lefebvre 462b85b7e9 tst_QGraphicsWidget::verifyFocusChain() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Ie762c7fa6bc4bf15f8580b3569e2196a5bd40b25
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:26:38 +02:00
Frédéric Lefebvre 3c2062f5ee tst_QGraphicsWidget::setTabOrderAndReparent() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I5bbe1cbd1e00a82504ed040347581264caf5b560
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:26:38 +02:00
Frédéric Lefebvre bdf136b1b3 tst_QGraphicsWidget::setTabOrder_data() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: If105d1c2db3646c7d31d72aeaa373015f175fd44
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:26:38 +02:00
Frédéric Lefebvre 2e6a25da7c tst_QGraphicsView::QTBUG_70255_scrollTo() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: If78234df30ca5716bd8bb23eb4297ae461ae88a8
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:26:37 +02:00
Frédéric Lefebvre 02f493f6d8 tst_QGraphicsView::hoverLeave() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I0d16654ed837009391967b187f8dbe5dced0849d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:26:37 +02:00
Frédéric Lefebvre c65aebfad6 tst_QGraphicsView::QTBUG_5859_exposedRect() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Iafebaaf4c737c2e07dbc7a5ea1d3a5a4cd335150
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:26:37 +02:00
Frédéric Lefebvre ec4221a37c task255529_transformationAnchorAndViewportMargins remove setActive
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Id88665c413398c4bca844b178ad24ea23c674d89
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 14:26:37 +00:00
Frédéric Lefebvre 5680789b2f tst_QGraphicsView::inputContextReset remove() setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number:  QTBUG-121488
Change-Id: If4e12607b1fb34fcab10e57d259e876df7ea6949
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:26:37 +02:00
Frédéric Lefebvre 27a40eacf6 tst_QGraphicsView::inputMethodSensitivity() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I9d3645af06caaa457e00798bc099f43f5a282767
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:26:37 +02:00
Frédéric Lefebvre 30e638c877 tst_QGraphicsView::update() remove QApplicationPrivate::setActiveWindow
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Id9d32ad9d346219c24e29dc5f9772ea60cf372a3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:26:37 +02:00
Frédéric Lefebvre 317fcbf101 tst_QGraphicsView::task239729_noViewUpdate() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I586c77e9bd5dd78c2229bd0483893c12f8601694
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:26:37 +02:00
Frédéric Lefebvre 7f8f27c22a tst_QGraphicsView::task207546_focusCrash() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Ic1de76054aed90ad07ee0233c45018afdf2a45c8
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:26:37 +02:00
Frédéric Lefebvre 83668a3762 tast187791_setSceneCausesUpdate() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Iaaff78826e74df119d4c4a8ea376e1b414da3c3d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:26:37 +02:00
Frédéric Lefebvre 4232fc5c41 task172231_untransformableItems() remove setActiveWindows()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I61f03a01e6001b0ced0297ff4d9bb0d199585445
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:26:36 +02:00
Frédéric Lefebvre b3ae097a2c tst_QScroller::scroll() remove QApplicationPrivate::setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I3bfbad661ffc157777a1d598b1999b0d8625eec3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:12:02 +02:00
Frédéric Lefebvre bcd3a00dfa tst_QScroller::scrollTo() remove QApplicationPrivate::setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Ife4096dbe6f196d91f3d865c9e58908c4c30759f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:12:02 +02:00
Frédéric Lefebvre 3718c0c320 tst_QCompleter::QTBUG_51889_activateSendTwice remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Id670b3f3cf34438c729afc3c82faf18a45b45d4f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:12:02 +02:00
Frédéric Lefebvre ab664ea01a tst_QCompleter::QTBUG_14292_filesystem() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls from the end of the function.

Task-number: QTBUG-121488
Change-Id: I465558f404b5bf656f5ed9c3f4b2ed605da6c6b8
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:12:01 +02:00
Frédéric Lefebvre d32360cbca tst_QCompleter::QTBUG_14292_filesystem() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I6546dc09a51037d7c3dea5c816273ddfe3a8797e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:12:01 +02:00
Frédéric Lefebvre 11a37c6cdd tst_QCompleter::task247560_keyboardNavigation remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I889d5301d44b1ba222aa0392347817a458ff66c3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:12:01 +02:00
Frédéric Lefebvre 11f23e346d tst_QCompleter::tast253125_linedEditCompletion remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Ie06a9326cb06f4ba657e065a52dfa1d8b319086b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:12:01 +02:00
Frédéric Lefebvre 8ba6695c9d tst_QCompleter::task250064_lostFocus() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I45c0d92021f7404298e9836bb6c876fbcc8d7a7a
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:12:01 +02:00
Frédéric Lefebvre f51402e23d tst_QCompleter:task246056_setCompletionPrefix remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Ib4ba40cc668395a1e5d826dab4caac7f307d1de7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:12:01 +02:00
Frédéric Lefebvre 5f1c67dab4 tst_QCompleter::task178797_activedOnReturn() remove setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: Ia8a81f7d00131b1a80be9fe65c3e3ed557a149d6
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-29 16:12:01 +02:00
Matthias Rauter 737c6680b4 QRegularExpressionMatch: port API from QString to QAnyStringView keys
The QRegularExpression capture-by-name keys are currently QStringViews,
but are only ever used to compare them against a const char16_t*, so
this API is a perfect candidate for replacing all of these overload sets
with a single QAnyStringView function.

[ChangeLog][QtCore][QRegularExpression] Keys can now be passed as
QAnyStringView (was QStringView).

Fixes: QTBUG-103097
Change-Id: I1a80e85f301cc08370d70b3b5eb0ae10c6a51f33
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-04-29 07:40:29 +00:00
Marc Mutz ab0b2a490e QSignalSpy: fix -Wweak-vtable by removing the QObject inheritance
Normally, we'd fix -Wweak-vtable by exporting the class and making at
least one virtual method out-of-line (typically the dtor), thereby
pinning the vtable to exactly one TU.

We can't export QSignalSpy, though, because it also inherits QList,
and we don't want to export QList subclasses to avoid QList API
becoming part of the ABI.

So remove the vtable, and therefore its being a weak symbol, by moving
the qt_metacall implementation from QSignalSpy into its newly-added
Private, at the cost of an additional memory allocation at
construction (though there was already the wish to make this class
pimpl'ed for extensibility, and this patch accomplishes exactly that).

This class used to be one of few places left that prevents adding
-Wweak-vtable to headersclean, so while this is a breaking change,
QSignalSpy doesn't really model is-a QObject. It uses QObject to
reuse, not to be reused. In fact, no external code should use the
QObject-ness of QSignalSpy, so it should be an acceptable SC break to
drop the inheritance.

We don't need to care about BC here, as we don't promise BC for
QtTest.

This now also allows (and requires) to make the dtor and the private
ctor out-of-line, avoiding the need for the init() hack.

[ChangeLog][QtTest][Potentially Source-Incompatible Changes]
QSignalSpy no longer inherits from QObject. If your code uses the fact
that QSignalSpy is-a QObject, you need to redesign around this now.

Task-number: QTBUG-45582
Fixes: QTBUG-123544
Change-Id: Id93ba0ee6bbb811455d3744a045e38e1b9f9c584
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-04-29 09:23:50 +02:00
Tuomas Vaarala 4946982534 [QNX] Add support for QLoggingCategory in QNX QPA debug log output
Makes it possible to enable debug log outputs via QLoggingCategory.
Earlier it was only possible via buid time flags.

Change-Id: Iaec732e7acdf44a74c9d7c806bf0e6f5a5f87b1c
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
2024-04-29 06:39:18 +03:00
Kai Köhne f0633e8237 SQLite: Update identified license
SPDX nowadays has a dedicated license identifier for SQLite. Let's use
this.

[ChangeLog][Third-Party Code] Change identified license for SQLite from
'Public Domain' to more accurate 'SQLite Blessing':
https://spdx.org/licenses/blessing.html

Pick-to: 5.15 6.2 6.5 6.7
Change-Id: I6c3378c45bc5edf498673c1b060f8e8c14d96a62
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-04-28 12:14:17 +02:00
Thiago Macieira 15eb9dccae QTest::test*Operators: test reverse order too
There's no need to condition that comparison only for heterogeneous
types. The reverse comparisons will compile if the types are homogeneous
(it's what we had already tested), but this now ensures the results are
also the expected ones.

Change-Id: If1bf59ecbe014b569ba1fffd17c4a2dd756157b2
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-04-27 21:35:38 +00:00
Doris Verria 8c44064f62 QWindowPrivate: Introduce virtual setFocusToTarget
When a window gains focus, the focus will be set to the focusWidget,
if one exists, in the case of QWidgetWindow, and to the window's
contentItem's subFocusItem, in the case of QQuickWindow.
However, we want to be able to customize this as we may want to set
the focus item/widget to the first, last, prev, or next, depending
for example, on the reason the window got focus. Eg.: on a TabKey
we want to focus the next focus object, on a BackTabKey the previous
one, and so on.
To be able to do this, add a virtual method in QWindowPrivate that sets focus to the specified item, and override for QWidgetWindowPrivate.

Task-number: QTBUG-121789
Done-with: axel.spoerl@qt.io
Change-Id: Ib5e17d6ff52c2323a4013c80bf411e92b4c8ce9b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2024-04-27 20:13:20 +00:00
Thiago Macieira f8359084b9 QString{En,De}coder: add constructors with QString parameters
Because QStringConverter::availableCodecs() returns QString.

Added as Q_WEAK_OVERLOAD so this doesn't create ambiguous overloads when
passing QByteArrays.

Fixes: QTBUG-123919
Change-Id: If1bf59ecbe014b569ba1fffd17c29a253ac22abe
Reviewed-by: Sune Vuorela <sune@vuorela.dk>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-04-27 13:03:36 -07:00
Thiago Macieira 99f78eb708 QTimer/QObject::startTimer: improve the detection of overflow
Converting from int milliseconds to int64_t nanoseconds can't overflow
(it won't even for picoseconds, so we'll be fine for a couple more
decades), so we only need to address the cases where the millisecond
value was passed in int64_t: that is, in the std::chrono::milliseconds
overloads. For the other cases, I added a comment.

Amends bfc7535a10 to not allow the
detected overflow to happen at all, which could cause the timer to
become very small. Instead, we saturate to the maximum, which is about
292 years (just under 106752 days). That's longer than computers have
existed, so the chance that some Qt application is still running on a
computer without any reboots from today to 24th century is remote at
best.

This parallels QDeadlineTimer, which already has code to saturate when
using milliseconds.

Change-Id: I6818d78a57394e37857bfffd17b9b1465b6a5d19
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-04-27 16:24:42 +00:00
Christian Ehrlicher 3abb1e7b54 SQL/IBase: factor out applying decimal scale into own function
Move the calculation of the decimal scale into own function and preserve
HighPrecision string values by not converting them into doubles before.

Change-Id: I839923189e9f6b1f8fb9ce234c987423703b79bf
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-04-27 16:35:11 +02:00