Instead of the more verbose currentDateTime(QTZ::UTC).
Pick-to: 6.5
Change-Id: Ie759f4270b12fca39c458bf85c8296f5342033db
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The predicate passed to e.g. a std::sort shouldn't modify the objects
it's called on, so move filling the cache to the QDirSortItem
constructor where possible. While that can't be done in all cases, e.g.
filename_cache is used as the tie-breaker when two items have the same
time or type ...etc, so it's only assigned to _if_ needed, we can at
least move some stuff out of the predicate to the QDirSortItem c'tor.
Drive-by change: replace comment with asserts
Change-Id: I0199797ab8e261fe3c0fcb791cfc69b23b6fdc48
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It is a valid URL reference, which is not what people may want.
Fixes: QTBUG-109855
Pick-to: 6.4 6.5
Change-Id: I69ecc04064514f939896fffd173783ce2228c1d2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
They got marked as Qt6_PRIVATE_API because of these ARE private classes,
however their pointers are used in user code. For QMutexPrivate, because
we manipulate the pointer in inline code; for QPostEventList, because
it's used in a virtual member function's parameter list.
Pick-to: 6.5
Fixes: QTBUG-109605
Change-Id: I69ecc04064514f939896fffd1736d1fa8d3f1768
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
We may get PointerDown events with "no buttons" as the button
state in some cases such as for tap events on Apple trackpads.
Make sure the mouse button which caused the pointer down
event is in the mouse buttons set for the event.
Fixes: QTBUG-108639
Pick-to: 6.4 6.5
Change-Id: I0a49abc398308bbfed657b99fc74f60c16e05a59
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
According to the CMake documentation, IMPORTED_TARGET should be
specified before the moduleSpec, and after QUIET.
Additionally, double-quote the moduleSpec everywhere, since before, it
was only quoted in some cases.
While this is not required for pkg_check_modules to work, it unifies the
coding style.
Pick-to: 6.5
Change-Id: Ic8ad708a8146f9b39ee40e9a719412441e231452
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
When encountering a batchable target, only add its defines to the
sources that the target contains. Otherwise, the defines interfere
with other tests in the batch.
Fixes: QTBUG-109848
Change-Id: I35d1665d29bb0ce93b82059f7f3b715070539d21
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Fix test failure in WasmEventDispatcherTest::postEventSecondaryThread()
Revert to using qGlobalPostedEventsCount() for determining
pending events state, but move the final check to after
sending posted events. Also remove a superfluous check.
This partially reverts/amends cc60d706.
Task-number: QTBUG-109066
Pick-to: 6.5
Change-Id: If4f437ce9379282c3d60b0272845a975794883de
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
For both QMutex and QAtomicInt, we have QBasic{Mutex,AtomicInt}, which
are PODs, and therefore constant-initialized. Q_GLOBAL_STATIC, otoh,
forces dynamic initialization, so don't use it.
Raw pointers don't need Q_GLOBAL_STATIC, either.
Patch up users. Instead of adding &'s to QMutexLocker arguments, port
directly to qt_scoped_lock, which takes by reference.
Change-Id: I1a13db2a5e88a52d4338a174a80522a3f5e58fa2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This is useful when sorting by time and using QTimeZone::UTC, since
native filesystem API uses UTC, that means less conversions, which is
potentially faster.
Use UTC internally except for strings that are going to be shown in a
GUI to the user, these should be in QTimeZone::LocalTime.
[ChangeLog][QtGui][QFileSystemModel] Added lastModified() overload that
takes a QTimeZone, this is useful when e.g. comparing file timestamps
and all that's needed is time in UTC (this is faster as no time zone
conversions is required). QTimeZone::UTC is used internally when sorting
by time (using the sort() function), which should ideally make it
faster too.
Task-number: QTBUG-100349
Change-Id: I0e58f8eb7856b8da7d55db86ddd2c009ff83d970
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
The method is now deprecated in Qt 6.5, not Qt 6.4.
Also, keep the documentation for now, but mark it as
deprecated there, too.
This amends 2436e259ce.
Pick-to: 6.5
Change-Id: Iff3e2c170a8fdb8834c0283de9554b503ed3aca4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
To support cancellation of continuations attached via the parent future,
we store a pointer to continuation future's data in parent. This
requires preserving the lifetime of continuation future's data while the
parent is still alive (see 24dedaeaa1).
This is achieved by capturing the promise in the continuation's lambda,
which is only cleaned up after the parent's data is destroyed. This is
already the case for continuations without context, but was overlooked
for continuations with context: they transfer the ownership of the
continuation promise to lambda passed to QMetaObject::invokeMethod(),
which destroys the lambda's context after it's run. As a result, the
continuation's promise (and data, if there are no other copies of it)
is also destroyed, leaving the parent pointing to deleted continuation
data.
To fix this, capture a copy of continuation future's ref-counted data in
the continuation's lambda. This will guarantee that the continuation
data remains alive until the parent is destroyed and the continuation
is cleaned up.
Fixes: QTBUG-108790
Pick-to: 6.5 6.4 6.2
Change-Id: Ief4b37f31e652988d13b03499505ac65c7889226
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Added baseline test case for menu (popup), combobox, command link and
lcd number.
New API takeScreenSnapshot() has been added for screen capture and
it serves to capture pop up windows
Change-Id: I5c1e46df270d94faf5c53431cddbd07532c256ee
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Not all locales use ASCII hyphen-minus U+002D as minus sign. On macOS
using the nb_NO locale the U+2212 character is used instead when
displaying negative years. Verify that one of the two characters is
found.
Fixes: QTBUG-109853
Change-Id: I424539cc8d427ac199b4528e44bef98e45312d07
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
with default QObject::connect signal may active from next message loop. invalide cache will hit while accessibility interface is called from windows. Invalide cache will lead to a crash
Fixes: QTBUG-106653
Pick-to: 5.15 6.2 6.3 6.4
Change-Id: I5359672bcd60ed6cfb2edf238645225164cb1b88
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
As discussed in the latest CMake API Review, we are deprecating the
FILENAME_VARIABLE variable name everywhere, and replacing it with
OUTPUT_SCRIPT.
[ChangeLog][CMake] The FILENAME_VARIABLE option of
qt_generate_deploy_script and qt_generate_deploy_app_script is now
deprecated, use OUTPUT_SCRIPT option instead.
Change-Id: Ic8be33eefbc48540166ea0fcf1d1948b052d4b8a
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
For tiny scanline lengths, even the initial offset to align on 16
bytes may overflow.
Fixes: QTBUG-109477
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I198c6fa5a2551a951893515f905bb7cc35479608
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Set the RUNTIME_OUTPUT_DIRECTORY for configure-time executables so
executable will be located inside the QT_BUILD_DIR. This allows to
re-build syncqt and make sure ithat ts binary is replaced and located
in the libexec directory.
Comment on how to rebuild syncqt. Configure-time tools reserve the
original tool name for the imported executable. To re-build syncqt use
'syncqt_build' target.
Task-number: QTBUG-109792
Change-Id: Id7d912b1d75d18d82cb2a69fbd62b89440120d78
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Only use an actual QPromise when the calculation will be async.
Change-Id: I5900c6498f56721dd04c4da204c0270492f52eee
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
When the qtMainLoopThread calls QSGThreadedRenderLoop::polishAndSync(),
it waits for the QSGRenderThread.
In the QSGRenderThread, QAndroidPlatformOpenGLWindow::eglSurface()
calls QtAndroid::createSurface() and waits for the "android main
thread" to return a valid surface.
When the "android main thread" now calls "runInObjectContext" (e.g. by
calling QtAndroidAccessibility::childIdListForAccessibleObject()) it
waits for the qtMainLoopThread and the program is stuck in a deadlock.
To prevent this, we protect all BlockedQueuedConnection from the
"android main thread" to the qtMainLoopThread by acquiring the
AndroidDeadlockProtector.
When QAndroidPlatformOpenGLWindow::eglSurface() already acquired the
AndroidDeadlockProtector we abort the current A11y call with an emtpy
or default value.
Note: b8a9527544 already tried to fix
this by checking "getSurfaceCount() != 0", but there are situations,
where a new surface is being created while an old surface is still
present.
Task-number: QTBUG-105958
Pick-to: 6.5 6.4 6.3 6.2 5.15
Change-Id: Ie40e8654c99aace9e69b0b8412952fa22c89f071
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
All current modules are free of qAsConst, make sure new ones will be,
too.
Change-Id: Iae3c67bca86eddf62ae664b00ff39a9b513d7290
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
qt-cmake-standalone-test uses add_subdirectory call when evaluating the
project. This leads to an error if users try to use path to
CMakeLists.txt as an argument, instead of directory when configuring
standalone tests with qt-cmake-standalone-test. It makes sense to check
if the user-specified path points to CMakeLists.txt and cut the
filename part when calling add_subdirectory.
Pick-to: 6.5 6.4 6.2
Change-Id: I6b9ac0ca8323eaf11f219eb1e6bed3057120a231
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
The standard accelerators page was deleted, drop the link to it.
Pick-to: 6.5 6.4
Change-Id: I2fa9a94200d0e5f8895bb8c6981c73b3e9dd159e
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
These are time stamps, and they use toMsecsSinceEpoch(), no point
getting the time in Local time zone then converting it.
Change-Id: I2db2db5f9ebc062e65514a592fa7fa00cf1d179d
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Unify wording as "{Latin-1,UTF-16} string viewed by \a str".
Drive-by change: Fix a grammatical error, it's "a US-ASCII", not an
(because it's pronounced by the letter name "U" which is pronounced
like "you", so "a" not "an").
Task-number: QTBUG-108711
Pick-to: 6.5
Change-Id: Iff763f4008341c35317bb3d7a2a228767ff6a648
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Add internal documentation to header and implementation of
QGtk3Interface.
Pick-to: 6.5
Change-Id: I3e6e970afa0c2ab26e0ce9efe6285cad1edfdb94
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Remove duplicate 'for', and unify the article of NSWindow to "an".
Change-Id: Iccf762ac54e90816f61634404fb88c9fdd1a43e1
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The example overrides QWidget::resizeEvent() without using the
QResizeEvent * argument. This results in a compiler warning.
This patch marks the argument unused.
Pick-to: 6.5
Change-Id: I647d0eda7d895e70ed6f232960aec992f5e37b6c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This is inherently faster than getting it in UTC from the underlying
native API stat call, then converting it to the Local Time Zone just to
compare them. The same goes for any use-case where you get a QDateTime
then the first thing you do is call t.to{Msec,Secs}SinceEpoch().
Change-Id: Ic13bcfd99b937c9f10f102ea7741832950a553c6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
... instead of manual QPromise handling.
QtFuture::makeReadyFuture() is both more efficient and more readable.
As a drive-by, replace size() > 0 checks with !isEmpty().
Change-Id: I299fbe8e6be10d8f65b8f86fcc6b586ac3cbd9d2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sona Kurazyan <kurazyan.sona@gmail.com>
The g_pendingPermissionRequestsMutex protects only the
g_pendingPermissionRequests QHash, so we can drop it immediately after
the QHash::insert() call. In particular, we don't use reference into
the QHash afterwards, and the following runOnAndroidMainThread() call
is internally synchronized, anyway.
Change-Id: I66a0e402e9ed1edb5fd9fec14e85f9371cc4fc36
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
In 705665957b we started relying on the
input method to decide whether a key event should include the resulting
text or not, based on the assumption that text insertion would happen
via the insertText:replacementRange: selector.
But the NSStandardKeyBindingResponding protocol includes several other
commands for inserting content, including insertTab:, insertBacktab:,
and insertNewline:.
https://developer.apple.com/documentation/appkit/nsstandardkeybindingresponding
We explicitly handle the latter, but for any command we didn't handle,
we concluded that the input method didn't want us to insert text, and
sent the key event without text, which broke tab character insertion
in text edits.
As long as we're not handling these commands explicitly, we adjust
the logic to treat any command starting with "insert" as an unhandled
request to insert text, and forward it as a key event with the text
included, as before 705665957b.
Fixes: QTBUG-109754
Task-number: QTBUG-106393
Pick-to: 6.4 6.5
Change-Id: I4a164bc809c3606b43f267514a66ff017efeb4af
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
There are two ways to override whether shortcuts (key sequences) should
be shown in menus, QStyleHints::::showShortcutsInContextMenus() and
the Qt::AA_DontShowShortcutsInContextMenus application attribute,
but only the latter is checked by our own menu implementations.
This was confusing, as overriding the style hint had no effect.
It makes sense for the QStyleHint to be based on the platform style
hint, but since we also allows overriding it, the logic in QGuiApp
that initializes Qt::AA_DontShowShortcutsInContextMenus should be
based on the QStyleHint.
Note that the inverse relationship is not maintained, as the app
attribute should not affect the style hints.
This creates a somewhat awkward situation in terms of when you need
to override the behavior, so we might consider deprecating one of
the options.
Fixes: QTBUG-109590
Task-number: QTBUG-69452
Change-Id: I366c17ff00fd8ae10553bbfb88d162ffd2c8040f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>