Behavior of EnterKey for virtual keyboard need to be changed for
QLineEdit. Before this commit, ImeOption was set to IME_ACTION_DONE.
Because of that, setting any text in QLineEdit automatically accept
QDialogs. That was annoying, when more than one QLineEdit need to be
set.
[ChangeLog][Widgets][Android] EnterKey type is now changed from
EnterKeyDefault to EnterKeyNext for virtual keyboard in QLineEdit. It is
done only if the focus can be moved to widget below.
Fixes: QTBUG-61652
Change-Id: I98a7686f9f675fccf0112b8d27d48ad8fd7a887f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
The issue came from 53b413f1c5.
Change-Id: Idb77a66dbd8649bdece213298b1e1676b22cc8ba
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The compositor is redundant in the process of moving the window.
Have the title bar react to move all by itself.
Additionally, a clearer structure in the window was introduced.
The non-client area has been extracted into a separate class, as
was the icon store and free DOM functions used across files.
Since it was now easy, made the window maximize/restore on double click
on the title element.
Fixes: QTBUG-107626
Pick-to: 6.5
Change-Id: Iba7f207e46806ae7162656965892ae5a48ac5ebe
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
1. Remove unused include.
2. Replace unnecessary null checks with asserts.
3. Remove dead code after the cleanup.
Change-Id: Ia3c01ae8a1fb491d513071c09f8095c93e35c292
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
1. Use Q_D and Q_Q instead of d_func() and q_func().
2. Use early return.
3. Remove unnecessary semicon.
4. Add one new line to separate two unrelated functions.
Change-Id: Ie6171c857f00ca171e97723a0d517d2295bbbbd1
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Not all focus objects have a cursorPositionChanged signal, so don't
connect unless there is one. The code should perhaps not show the
software keyboard at all unless the focus object responds to the input
method query with cursor positions, but that's for a different patch.
Pick-to: 6.5
Change-Id: I0e01da42e96eb579d260b9158f005ad3215d0c26
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Based on existing code, it appears that it's always
preferred in wasm to use synchronous delivery
(<QWindowSystemInterface::SynchronousDelivery>),
however, we can simply define this as the default mode
of operation, which will make these unnecessary.
Change-Id: Ia4c78593333e314f91efb266268917317794e2f5
Pick-to: 6.5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Name filters may be not empty and include all files ('*'). We should
not add any file type limitations in this case. Ammends commit
ce20b81070
Pick-to: 6.5
Change-Id: I3983e576a0ada4b7b40837c5c797359114b1ae02
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
... in lieu of <cctype>'s toupper(), which is locale-dependent, and
out-of-line.
The code doesn't run into the toupper(i) issue in the Türkiye locale,
because we don't run tests in that locale and because 'i' is not a
valid format specifier, but don't let the next reader of the code
guess when the use of toAsciiUpper() provides unambiguous guidance.
Task-number: QTBUG-109235
Pick-to: 6.5
Change-Id: I8988f5190441e1ae5cb57370952cda70ca6bb658
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
After we start to use THEME: Theme_DeviceDefault_DayNight, status bar
icons have low contrasts on some devices.
That is why we need to set APPEARANCE_LIGHT_STATUS_BARS[0] in case when
Status bar color is too bright.
[0]https://developer.android.com/reference/android/view/WindowInsetsController#APPEARANCE_LIGHT_STATUS_BARS
Fixes: QTBUG-108365
Pick-to: 6.5 6.4 6.2
Change-Id: I38a31cfb0a3a1b912b86ed1b302c567e14a7ffcc
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Allow renaming content uris if the destination is provided
as a direct fileName (i.e. not full content scheme path),
and if the destination has the same trailing path (or parent)
which means a rename in the same folder structure.
Pick-to: 6.5 6.4 6.2
Task-number: QTBUG-98974
Change-Id: Ibc4973366807dd5284c19912ab04ff90f2a573cb
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Add generated qrc files to source of the target so they will be
displayed (and reachable by Follow Symbol in QtCreator) under
the '<Build Directory>/.rcc' node in the Project Tree of QtCreator.
Fixes: QTCREATORBUG-28604
Change-Id: I0c56e168de03027ec2981cfa0bceb8f10a8d71b2
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Instead of using QStringBuilder (which always allocates a new QString to
hold the result of the concatenation), reuse the existing QString, and
use prepend which will typically have allocated extra space, reducing
the chances it will reallocate.
Change-Id: Ic4ef775246db58e56152a6ede1a75f7621950dd9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The delta (drag distance) for dragging a tool button with in a tool
bar was calculated by subtracting the global mouse press position from
the drag event's global position.
This has lead to a miscalculation when dragging the button across
screens with different resolutions. The new relative position within
the tool bar became negative, which eventually has lead to resizing of
other tool buttons in the same tool bar.
This patch calculates the delta based on native pixels, which ensures
a correct value in all cases. It falls back to the existing calculation
if no window handle can be established from the tool bar.
Fixes: QTBUG-103720
Pick-to: 6.5
Change-Id: I09168b597f6c43a119041d00f5b07e1895fdf4b3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
... to prepend/append/insert QByteArray and const char*, instead of
the old inline QString::fromUtf8(), which litters the call sites with
temporary QString objects.
Can't use qToUtf8StringViewIgnoringNull() for QByteArray parameters to
avoid the extra isNull() check, because some QString tests depend on
whether we append/prepend/insert null or empty.
Pick-to: 6.5
Fixes: QTBUG-109092
Change-Id: Ibf7b99aad844d0c2219ccc1c30f6666c5dfc7758
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Get those values from the file engine instead, this is relevant
especially on Android for content uris.
Pick-to: 6.5 6.4 6.2
Task-number: QTBUG-98974
Change-Id: I65fe4c59e5f1feed0dcf14cc8988b4a40d9d979e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The example docs were difficult to find.
Pick-to: 6.4 6.5
Change-Id: Id7003b140275e722dad2c41767eabc24fef728e5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
... to make moc code locale-independent.
The C toupper function is locale-dependent. Given the right locale
(Türkiye, e.g.), toupper('i') is either
- İ (LATIN CAPITAL LETTER I WITH DOT ABOVE; if representable) or
- i (unchanged; if it isn't)
Both results are wrong for the present use-case.
Fix by adding QtMiscTools::toAsciiUpper(), complementing existing
toAsciiLower(), and using that. It's private API, but moc.h, despite
the name, is not a public header.
Pick-to: 6.5 6.4 6.2 5.15
Task-number: QTBUG-109235
Change-Id: Iaf071ba2113b672aa0aed3da6a4e1d47fb659365
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This makes it possible to process QML files using qmlcachegen, and
retain the file nodes in the resource file system, but remove their
actual content from the binary. To do so, you need to mark your files
with the QT_DISCARD_FILE_CONTENTS source file property.
Fixes: QTBUG-87676
Fixes: QTBUG-103481
Fixes: QTBUG-102024
Fixes: QTBUG-102785
Change-Id: I93d5a2bfca1739ff1e0f74c8082eb8aa451b9815
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: hjk <hjk@qt.io>
It has been commented out since at least 5.3 (the earliest version
hosted on the GitHub mirror), so it seems this code is not used
by anyone for more than 10 years. We can safely remove them.
Change-Id: Ia475ce5a5fdd6db48f415b3647677a35c79bfc5d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
This turns const char[] arrays into const char* pointers and
therefore prevents the implicit conversion of string literals
to QString in QT_RESTRICTED_CAST_FROM_ASCII.
Fix by avoiding the decay.
Also simplify the template magic.
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I88164a1866ac71b41d9cd1564f3a5e83d2d42aaa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If a widget's geometry is restored to a screen, which is smaller than
the one it was saved from,
- the widget could appear (partly) off screen
- the widget's title bar and resize handles could be inaccessible
This patch refactors and documents checkRestoredGeometry.
In a first step, the restored geometry's size is checked against
a given screen size. It is corrected if necessary.
In a second step, the restored geometry is moved inside the screen,
if necessary.
It makes the function a static member of QWidgetPrivate in order to
expose it for auto testing and adds a respective test function to
tst_QWidget.
Fixes: QTBUG-77385
Fixes: QTBUG-4397
Task-number: QTBUG-69104
Pick-to: 6.5 6.4
Change-Id: I7172e27bfef86d82cd51de70b40de42e8895bae6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Check for state.remainingChars to signal an encoding error only after
the last chunk has been processed. Splitting surrogates at chunk
boundaries is normal operation, not an error. Only if this happens at
the end of the whole input should we raise an error.
Amends fa2153bd10.
Pick-to: 6.5
Change-Id: Id92e37becaed25bbc11e0c22dedc4d41fb23f92a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Since e0cad1aab5, the code suffered
from an ABA problem where the TestFunctionStart expectation is set
in testFinished(), but by the time WatchDog::run() gets around to
examining the state when returning from condition_variable::wait()
in waitFor(), the next beginTest() has already set the expectation
back to TestFunctionEnd.
There are several known solutions for ABA problems. Embedding a
generation count into the expectation state seemed to be the most
straight-forward fix, and can be done without DWCAS support, because
the state is just 2 bits, leaving the other 30 or 62 bits for the
generation counter, so do that.
[ChangeLog][QTestLib] Fixed a bug which caused
QTEST_FUNCTION_TIMEOUT to be applied to the whole test execution,
as opposed to each test function.
Fixes: QTBUG-109466
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: If71ade932330407b85d204d45c74350c651325fe
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
... not just those in the BMP.
The use of char32_t makes the isValid helper function easier to
read. Its passing to write() is enabled by the recent port to
QAnyStringView, which has a char32_t ctor.
Split into per-plane executions of the test function to avoid
running into timeouts on asan builds down the road.
As a drive-by, replace use of QPair with a proper struct, and
make the intervals symmetrically inclusive the bounds.
Pick-to: 6.5
Change-Id: I2c6858d7e6a88f448eac1b1e124d7d7b82828d4c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
1) Check only for the events that the dispatcher is able to process,
otherwise it enters an endless loop
2) Take care to run the correct wake up callback with
Asyncify.handleSleep
Fixes: QTBUG-109066
Change-Id: I10d29d18962c3e438e56712e1f43ecadedb6205c
Pick-to: 6.5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
When an external screen is connected to an iPad, and the application is
starting up on that screen, we will get a connection notification about
that screen as part of the initial bootstrap of UIApplicationMain,
before we call the user's main().
Since we initialize and add all available screen on QIOSIntegration
creation, we can just ignore the early connection notification.
This avoids a crash, but the window will not show anything on the
external screen, which is a separate issue.
Pick-to: 6.5 6.4 6.2
Fixes: QTBUG-106701
Change-Id: I9e0a9736bf602277316bd004e0d01c640feaf319
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Some more modern protocols like Bluetooth LE transmit data in little
endian. QtBluetooth will benefit from this.
Change-Id: Id8e48e8f498c4a029619fffd1728c94ddd444537
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This is inspired by QBluetoothUuid's quint128, but with a better
name. It also matches systemd's sd_id128.
Change-Id: Id8e48e8f498c4a029619fffd172893dc1545adda
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This makes sure the browser only uses a basic password store and
doesn't try to do anything fancy with the OS pass store, since it
causes an issue on opensuse (kwallet isn't set up in CI).
Change-Id: Ib48a15f4834fa9bb26cf8cf3fff9bb4d0fd0238a
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Relevant mainly if we want to consistently expose these as the
theoretically correct uint32_t/quint32 from Qt Quick's
QSGRendererInterface. (not that int is not sufficient for
indexing the typical 3-4 families and 2-16 queues per family)
Some checks are not actually needed since the family index
must always be valid after create().
Pick-to: 6.5
Task-number: QTBUG-108895
Change-Id: I474ccea51a81e7a096281604ff79b7db4cdd2484
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
qdbusxml2cpp takes a filename to use for generated output. It may be in
the form 'name.cpp' or just 'name'.
For the moc file we need to convert this from a path to a name of a file
in the same relative folder. It's not uncommon for this name to contain
dots as sometimes a dbus interface name is used directly. For the cases
where a suffix is not provided the whole name should be used.
Pick-to: 6.5
Change-Id: I3bf4ae8b2b9121184c2786009e8b5abcc5e3e410
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
WHEN writing an invalid character, THEN we expect the writer to report
an error.
The old code had it the wrong way around. It checked that WHEN the
writer reports an error, THEN the character was invalid.
The formulations are equivalent, but the latter is mixing up cause and
effect, making it less clear what's being checked (QXmlStreamWriter,
not isValidSingleTextChar()), so swap.
Pick-to: 6.5 6.4 6.2
Change-Id: I703de9ddde98d9913977a913f671472930735900
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
This improves the runtime of this particular test function by
almost 17% on my machine.
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: Icd77cdda92374b92121988c99e56787d405fa2d9
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Added the QtOpcUa module, as well as the relevant opcua plugin
Fixes: QTBUG-109336
Pick-to: 6.4
Change-Id: I5edd886e6224de14cd2b68727655c64514ef5158
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
For Qt resources, enforce QT_RESOURCE_ALIAS for source files that are
specified with absolute paths.
Users can add generated files to resources, e.g. in
qt6_target_qml_sources or qt6_add_qml_module. The file paths of those
generated files are typically absolute paths.
The function __qt_get_relative_resource_path_for_file is used to
construct file paths in the build directory. For the files in question,
this function returned an absolute file path. This led to very long
subdirectories within the build directory and even invalid paths on
Windows.
We cannot guess how the user intends to address the file via the
resource system and require now that QT_RESOURCE_ALIAS is set on such
files.
[ChangeLog][CMake] In Qt resources, files that are specified as
absolute paths must have the property QT_RESOURCE_ALIAS set.
Task-number: QTBUG-108150
Change-Id: Ida092c3d103a243caffc869b4bb887d4b5ce70ab
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
We have this logging category on xcb and ios already.
Task-number: QTBUG-103620
Pick-to: 6.5
Change-Id: I70153c4ea9d62316d0e05550559010d85e2f9d85
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
As QOpenGLContext can be destroyed
it's a bad idea to store QOpenGLFunctions
(which are QOpenGLContext bound)
This change remove the inheritance and replaces it with
querying the functions per call.
Pick-to: 6.5 6.4 6.2
Change-Id: I2f3104b62f395f3e65337a15d0a0835383b66e16
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>