Commit Graph

55365 Commits

Author SHA1 Message Date
Andreas Buhr
9beca76786 Repair tst_qabstractitemview in case of no cursor
tst_qabstractitemview requires a movable cursor.
This patch skips the test if there is no movable cursor.

Pick-to: 6.2 6.3
Fixes: QTBUG-87400
Change-Id: I4e917b2ad062ce068f23603410aa9209edb9828d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-02-16 21:09:59 +01:00
Andreas Buhr
e87233fbd8 Repair tst_qfileinfo on Android
Pick-to: 6.2 6.3
Change-Id: I79e0236b90b8a6ca2618d7a9ddac34b26bbd5b5f
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-02-16 21:09:59 +01:00
Pasi Petäjäjärvi
8aba951d98 Gui: test also depends for clipboard feature
Pick-to: 6.2 6.3 5.15
Change-Id: Id8684b6800bd5659991bc56f8b374ec3989ee590
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-16 21:02:44 +02:00
Axel Spoerl
43b25286ce Update QToolButton texts and add more stylesheets to test with
Adapt QToolButton texts to descriptive versions.
Add dummy stylesheet that will be used for all test functions, and a
specific style sheet to test rendering of QToolButton with a menu button.

Task-number: QTBUG-100401
Pick-to: 6.3 6.2
Change-Id: I5440407ddb3ea5b45124e77a6f0d1013362b4398
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-16 16:41:43 +00:00
Kai Köhne
3cd8099cfc Doc: Fix cmake example snippets
The argument to file(GENERATE...) is called CONTENT, not CONTENTS.

Pick-to: 6.3
Change-Id: I22fb9eb966223e034b2606cf24315d3cf6a03df1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-02-16 17:41:43 +01:00
Marc Mutz
f310f426d0 qvkgen: optimize generated string tables
Use qOffsetStringArray instead of array-of-const-char* to hold
strings. Saves 174 relocations, as well as over 4KiB in combined TEXT
and DATA size on optimized Linux GCC 11.2 C++20 AMD64 builds.

Pick-to: 6.3
Task-number: QTBUG-100536
Change-Id: I5849168d0340f78664e566920f92ad136f9dc435
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-02-16 16:49:16 +01:00
Jani Heikkinen
58173027b3 Update LICENSE.QT-LICENSE-AGREEMENT
Newest version is 4.4 so update it in the git as well

Task-number: QTBUG-98971
Pick-to: 6.3 6.2 5.15
Change-Id: I4b5bd2852c6c2775bd285c6584eb712fd0b73db3
Reviewed-by: Akseli Salovaara <akseli.salovaara@qt.io>
2022-02-16 17:19:34 +02:00
Kai Köhne
7c801ec93a configure.bat: Fix call without arguments
If there are no arguments, echo will print its status, and config.opt.in
will contain

  ECHO
  is
  off.

Fix this by using "echo." idiom.

This amends 57ad532e75

Pick-to: 6.2 6.3
Change-Id: I1697e59f23cd28256a4a6ce357eae70e36c49d5a
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-02-16 12:05:48 +01:00
Thiago Macieira
1f7089437a CBOR: disable UUID and QRegularExpression support in bootstrapped builds
We don't need them.

Drive-by opportunity to ensure byteData() didn't return null. It could
happen.

Change-Id: I74249c52dc02478ba93cfffd16d1e1fc060cdaef
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-02-16 01:59:51 -08:00
Thiago Macieira
a1b2c474fd QPluginParsedMetaData: avoid the indirection through QCborMap
value[x] is the same as value.toMap()[x] but avoids the refcounting up
and down just to call the operator[] overload. We're calling the
operator[] overload taking an integer, which means it could match an
array, but we know the data member won't be one because of how
QPluginParsedMetaData::parse() parses.

Change-Id: I2cffe62afda945079b63fffd16bd5c690b2bfee4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-16 01:59:51 -08:00
Axel Spoerl
ea0e0a8652 Eliminate double arrow in QToolButton
- InstantPopup mode is set and
- application uses a stylesheet that does not apply to QToolButton

Task-number: QTBUG-100401
Pick-to: 6.3 6.2
Change-Id: Iadf752ad9280d59763f4efc1938927a9b83e6ad9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-16 10:57:20 +01:00
Thiago Macieira
8de0493896 QMetaObjectBuilder: fix addProperty() recording of the property type
Issue introduced by commit 465701bb98.

[ChangeLog][QtCore][QMetaObjectBuilder] Fixed a bug that would cause
addProperty() to use the incorrect type for the property if the
property's name matched a valid type registered with QMetaType.

Pick-to: 6.2 6.3
Change-Id: Ic15405335d804bdea761fffd16d402f2c9611f30
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-02-16 01:47:09 -08:00
Thiago Macieira
d34282dba0 QFile::copy: add the underlying error messages to ours
Fixes: QTBUG-100867
Pick-to: 6.3
Change-Id: Ic15405335d804bdea761fffd16d401a7c16f32f9
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-16 01:47:09 -08:00
Thiago Macieira
8f1a827d91 QIODevice::read: don't truncate to int(readBytes)
QByteArray in Qt 6 *can* hold more than 2GB-overhead of data.

Untestable.

Fixes: QTBUG-100546
Pick-to: 6.2 6.3
Change-Id: I74249c52dc02478ba93cfffd16d1a0ab398efe9c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-16 09:47:09 +00:00
Zhang Hao
d978c230a4 Do not highlight the HTTP Example anymore in Qt Creator
Pick-to: 6.3
Fixes: QTBUG-100647
Change-Id: I413b37daf784f3a4975caa5a48273f4a83aa1da6
Reviewed-by: Kimmo Leppälä <kimmo.leppala@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-02-16 14:40:34 +08:00
Alexandru Croitor
e5b3436255 CMake: Add default launch screen storyboard for iOS apps
Bundle a default LaunchScreen.storyboard file for an iOS app and make
sure it's referenced in the generated Info.plist file.

When launching Qt examples, it ensures the app uses the whole screen
space on the device rather than just a square-ish part of it.

The storyboard file is a copy of the qmake one, which qmake adds
to the Xcode projects it generates.

A custom launch screen can be provided either by setting the
QT_IOS_LAUNCH_SCREEN variable or by setting the
QT_IOS_LAUNCH_SCREEN target property.
The value must be an absolute path to the launch screen file.

The automatic addition of the launch screen entry in the Info.plist
file can be prevented by setting the QT_NO_SET_IOS_LAUNCH_SCREEN
variable to TRUE.

The automatic bundling of the launch screen file in the application
bundle can be prevented by setting the
QT_NO_ADD_IOS_LAUNCH_SCREEN_TO_BUNDLE variable to TRUE.

The current implementation has a limitation that only one launch
screen storyboard and one iOS executable can exist within a project.

If there are multiple executables in the project, all of them will
use the launch screen that is specified last (the last
qt_add_executable call).

Because of this limitation, the API is marked as Technical Preview,
to be improved upon in the future. For now it simply serves as an
improvement to the out-of-the-box experience of iOS apps built
with CMake.

Amends 4d838dae5a

Pick-to: 6.2 6.3
Fixes: QTBUG-95837
Change-Id: I6b067d703d635122959a1ef17fcca713da694a86
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-02-16 05:14:24 +01:00
Mårten Nordheim
a1fb3971f2 QHash: fix off-by-one in assertions
Coverity-Id: 378365
Coverity-Id: 378366
Coverity-Id: 378399
Coverity-Id: 378427
Coverity-Id: 378468
Coverity-Id: 378472
Pick-to: 6.3 6.2
Change-Id: Ib1efeacb59030b9d004320e56f560367f564d207
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-16 04:24:21 +01:00
Marc Mutz
a24ef92468 QColor: eradicate QT_STRINGVIEW_LEVEL
It's not used and not useful.

Task-number: QTBUG-100861
Pick-to: 6.3 6.2
Change-Id: I30f7f41311182f056f2f6d5a9b49385fb09d194e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-16 04:20:51 +01:00
Sona Kurazyan
221df41572 Move QBindingStorage methods marked for removal to removed_api
From the API review.

Pick-to: 6.3
Change-Id: I676ff811a3b3d43ebcbee78ed0210d669d642947
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-16 02:28:53 +01:00
Thiago Macieira
d1f077a435 QJsonValueRef: don't export the entire class in Qt 7
Change-Id: I54f205f6b7314351b078fffd16d061ca8870b453
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-02-15 17:00:05 -08:00
Thiago Macieira
705ea62f9e QJsonValueConstRef: prepare for Qt 7
Instead of storing a pointer to the QJsonArray or QJsonObject (like the
Qt 4 & pre-5.15 versions did), do like QCborValueConstRef and store the
pointer to the QCborContainerPrivate.

Unlike QCborValueRef, we must keep the is_object bit because of API
behavior that assigning an Undefined to an object reference deletes it
from the container. I've chosen to use size_t instead of qsizetype for
this because then we don't lose any bits of the index. Therefore, the
index in the case of objects is stored as pair count (like before),
different from QCborValueRef which stores the actual index in the
QCborContainerPrivate.

It's the LSB (on little-endian architectures) so the calculation of
2 * index + 1 is the actual value stored in memory or in the
register. Unfortunately, right now, both Clang and GCC don't realize
this and generate unnecessary instructions. Clang:

0000000000000000 <QJsonValueConstRef::concreteType(QJsonValueConstRef)>:
   0:   mov    %rsi,%rax
   3:   shr    %rax
   6:   mov    %rsi,%rcx
   9:   or     $0x1,%rcx
   d:   test   $0x1,%sil
  11:   cmove  %rax,%rcx

[GCC code is identical, except it uses an AND instead of TEST]

That OR at offset 9 is a no-op because it sets a bit that is already set
in those conditions. At least they don't do unnecessary shifts.

Change-Id: I89446ea06b5742efb194fffd16bb7aadb6a9b341
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-02-15 17:00:05 -08:00
Thiago Macieira
a747ab0b72 QJson{Array,Object}: rewrite & simplify some iterator functions
Instead of manipulating indices in multiple functions, make some call
the others. This reduces the number of places porting must happen at, if
we wanted to.

Change-Id: I89446ea06b5742efb194fffd16bb78d24e0528b2
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-02-15 17:00:05 -08:00
Thiago Macieira
01fe59a3b7 QJsonObject::removeAt: stop dividing and multiplying by 2
Change-Id: I89446ea06b5742efb194fffd16bb7d17182c6a2a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-15 17:00:05 -08:00
Thiago Macieira
d263147921 QJsonValueRef: optimize the assignment
Inline some content to avoid unnecessary round-trips through
qcborvalue.cpp, qjsonarray.cpp and qjsonobject.cpp.

Unlike the CBOR counterparts, JSON support has this extra functionality
that assigning Undefined causes the item to be removed from the object
(arrays don't have that behavior, they just become null).

And unlike QCborValueRef, we detach on assignment, not on the obtention
of the QJsonValueRef. This is more dangerous, so we may want to revise.

Change-Id: I89446ea06b5742efb194fffd16bb775e9566ca1a
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-02-15 17:00:05 -08:00
Thiago Macieira
c1780165ee QJsonValueConstRef: optimize to{Int,Integer,Bool,Double,String}()
The CBOR-based implementation from Qt 5.15 simply created a QJsonValue and
then called the equivalent function on that result. For integrals and
double where the QJsonValue matched the asked type, the cost was minimal
anyway. For the other types and when the type didn't match, this
resulted in up/down the reference counter in QCborContainerPrivate and
an out-of-line call to the destructor.

This improves the performance for code like:

  for (QJsonValue v : array) {
      if (v.toString() == x) {
          doSomething();
      }
  }

This change propagates the inadviseable behavior of allowing a
dereference of the end() reference in concrete() to concreteType() (and
unit-tests it) but does not do the same for the toXxx() functions. Doing
that causes a dereference of QList's end() iterator, which is UB
(asserts false in debug mode).

Change-Id: I89446ea06b5742efb194fffd16bb3beccd1098e4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-15 17:00:04 -08:00
Thiago Macieira
dccd1e87f5 QJsonValueConcreteRef: optimize concrete()
Inline the content to avoid a round-trip through qjsonarray.cpp and
qjsonobject.cpp.

This change revealed an inadviseable unit test check that dereferences
the end() iterator to get its type. I haven't changed it, but have
marked with ###. I also fixed a likely copy&paste mistake in that test.

Change-Id: I89446ea06b5742efb194fffd16bb774f3bfbe5f5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-15 17:00:04 -08:00
Thiago Macieira
e99417106f QJsonObject::erase: erase unnecessary and wrong code
Commit 35adb74ddd ("Reimplement JSON
support on top of Cbor") accidentally forgot to multiply by 2 the index
stored in the QJsonObject::iterator. The same mistake was propagated
when QJsonObject::iterator was converted to QJsonValueRef. This had no
ill effects because the o->elements container would always contain more
elements, but it meant the check was ineffective and meant nothing.

So instead of doing nothing when the iterator does not point to this
container, simply assume it does. Bad things will happen if you try to
erase an iterator that points to another container, but that's true for
almost all container/iterator mechanisms.

Drive-by modernization of some of the surrounding lines.

Change-Id: I89446ea06b5742efb194fffd16bb7c322c2fc4f2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-15 17:00:04 -08:00
Thiago Macieira
f276f9ec6b QCborValue: use assignContainer() in few more places
Change-Id: I5e52dc5b093c43a3b678fffd16b6eb65ef37399d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-15 17:00:04 -08:00
Thiago Macieira
ccea344640 QCborValue: optimize the array-to-map conversion
Yes, this is a cold function, but we can do it in-place if we want to.

Done in three separate passes so the autovectorizer can do its thing, if
it wants to.

Change-Id: I5e52dc5b093c43a3b678fffd16b6eb34d02fc40b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-15 17:00:04 -08:00
Thiago Macieira
f4d49910be QCborValueConstRef: optimize to{Integer,Bool,Double,String,ByteArray}()
The initial implementation from Qt 5.13 simply created a QCborValue and
then called the equivalent function on that result. For integrals and
double where the QCborValue matched the asked type, the cost was minimal
anyway. For the other types and when the type didn't match, this
resulted in up/down the reference counter in QCborContainerPrivate and
an out-of-line call to the destructor.

This improves the performance for code like:

  for (QCborValue v : array) {
      if (v.toString() == x) {
          doSomething();
      }
  }

Change-Id: I5e52dc5b093c43a3b678fffd16b6022da4e2d446
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-15 17:00:04 -08:00
Thiago Macieira
afe2f80c6a QCborValueRef: merge the operator[] into a template
Change-Id: I5e52dc5b093c43a3b678fffd16b6e94ad9d3f39b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-15 17:00:04 -08:00
Thiago Macieira
832fcbf37f QCborValue: merge the const operator[] into a template
Change-Id: I5e52dc5b093c43a3b678fffd16b6ec4b7d841955
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-15 17:00:04 -08:00
Thiago Macieira
072f0d5717 QCborValue: merge the non-const operator[] into a template
Change-Id: I5e52dc5b093c43a3b678fffd16b6e7b32b3e2835
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-15 17:00:03 -08:00
Thiago Macieira
f1c305cbd2 QCborMap: merge the operator[] methods into a template
Change-Id: I5e52dc5b093c43a3b678fffd16b6e7a123338178
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-15 17:00:03 -08:00
Thiago Macieira
11ea172178 QCborMap: merge the constFind methods into a template
Change-Id: I5e52dc5b093c43a3b678fffd16b6e558c4e1f089
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-15 17:00:03 -08:00
Thiago Macieira
3531f578d3 QCborArray: allow large but in-range keys
The 0x10000 limit should not apply if the key is a valid index in the
array.

Change-Id: I5e52dc5b093c43a3b678fffd16b6a2a5a69acd61
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-15 17:00:03 -08:00
Thiago Macieira
800f60657d QJsonObject: use QJsonValueConstRef
Change-Id: I5e52dc5b093c43a3b678fffd16b608f32f8eb4b4
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-02-15 17:00:03 -08:00
Thiago Macieira
f5762cd4b3 QJsonArray: use QJsonValueConstRef
Change-Id: I5e52dc5b093c43a3b678fffd16b6086dcd1d3268
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-15 17:00:03 -08:00
Thiago Macieira
51fc317041 QCborMap: use QCborValueConstRef
Change-Id: I5e52dc5b093c43a3b678fffd16b606e4249a205b
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-02-15 17:00:03 -08:00
Thiago Macieira
64d568b550 QCborArray: use QCborValueConstRef
Change-Id: I5e52dc5b093c43a3b678fffd16b6077e5c4abd63
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-02-15 17:00:03 -08:00
Thiago Macieira
04dc959d49 Introduce Q{Json,Cbor}ValueConstRef
I screwed up when I wrote QCborValueRef by not having the ConstRef
type. The code worked, but it wasn't const-correct, allowing you to
write:

  const QCborArray &arr = something();
  *arr.begin() = QCborArray();

This mistake was brought over to QJsonValue in Qt 6.0, so it has to be
fixed for QJsonValue too. The actual fixes are in the next couple of
commits.

This change is believed to be binary-compatible: the Q{Json,Cbor}ValueRef
classes continue to have the exact same size, except that they're now
empty and have a new base class. They weren't trivial before this commit
doesn't change that.

[ChangeLog][Potentially Source-Incompatible Changes] The iterator
classes for Qt's JSON and CBOR containers (array and map/object) had a
const correctness issue which allowed a const_iterator to mutate the
container being iterated on, even if that container was itself const. Qt
6.4 has a fix for this, but will cause compilation issues where
QCborValueRef and QJsonValueRef were used where the correctness could be
violated. To keep code compiling with both 6.3 and 6.4, either change to
non-const iteration or replace the QxxxValueRef with a const QxxxValue
reference. This change is binary-compatible.

Change-Id: I5e52dc5b093c43a3b678fffd16b6063333765ae0
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-02-15 17:00:03 -08:00
Thiago Macieira
9b8f064cd3 QCborValueRef: fix using operator[] to convert an empty array to map
The flag IsContainer was not set, causing the QCborContainerPrivate to
become confused.

This commit also expands and subsumes the existing test for QCborValue
(non-Ref).

Change-Id: I5e52dc5b093c43a3b678fffd16b6a17c6f4a0676
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-15 17:00:03 -08:00
Thiago Macieira
3c7b507d1c QCborValueRef: add a test to confirm that its methods reflect QCborValue
This has found several missing const qualifications, a missing
QCborMap::Iterator method, and a missing one in QCborValue too.

The methods "### TEMPORARY" in this commit are actually removed in two
commits.

Change-Id: I5e52dc5b093c43a3b678fffd16b6939f62954dc4
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-02-15 17:00:02 -08:00
Marc Mutz
e7706429bb QLibrary: add a #warning if the fall-back plugin-meta-data parser is used
Change-Id: I4b42f8dbc9fb03fc6e7243ed4914acfb1bdfe62a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-16 01:20:13 +01:00
Tatiana Borisova
773362fb68 Fix failures for tst_eventdispatcher on INTEGRITY
- New testcase tst_eventdispatcher added under commit d292f0143f.
  It shows that only glib implementation works correctly.

Task-number: QTBUG-99123
Pick-to: 6.2 6.3
Change-Id: I7b861a6207fcb319de362645fc8f00a8ab6cd4b9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-02-15 18:20:40 +00:00
Ivan Solovev
60799fc141 Android A11Y: Fix value rounding
QAccessibleInterface stores values as QVariants. When dealing with
double values, as a result of some calculation (for example, Slider
value update), rounding errors can be introduced.
When converting double values to QString using QVariant::toString(),
these rounding errors result in strings like
0.30000000000000004 instead of 0.3 or
2.7755575615628914e-17 instead of 0.3 - 3 * 0.1 and similar zeroes.

To fix this issue, this patch introduces a custom conversion for
floating-point values. The idea is to convert QVariant to double,
and then convert double to QString using 'f' format and a suitable
precision, determined from the UI element's minimumStepSize(), if
it has one, otherwise falling back to QString::number()'s default
(which is 6).

Task-number: QTBUG-93396
Pick-to: 6.3 6.2 5.15
Change-Id: Ia5ca7345812e39629e9c191b6d8b896a8f51de80
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-02-15 17:51:33 +01:00
Ivan Solovev
a374d59abc Android A11Y: Announce value together with element name when focused
Before this patch when we focus a new element, only its description
was announced.
For elements like Slider that means that if it had no accessible name
or description, its value would be announced (all is fine here).
But if the slider is defined like that:
 Slider {
     Accessible.name: "int slider"
     value: 5
     from: 0
     to: 20
     stepSize: 1
 }

only the name ("int slider") will be announced, but not the actual
value.

This patch fixes the logic of content description generation. If the
element has value, then it is added to the description and announced
as well.

Task-number: QTBUG-93396
Pick-to: 6.3 6.2 5.15
Change-Id: Ia8667149ebd867945c5f57d951fd6ade0f382598
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-02-15 17:51:33 +01:00
Ivan Solovev
b238f83380 Android A11Y: handle valueChanged events
Before this patch Android A11Y implementation was missing
ValueChanged event handling. As a result, no update was given
when the element's value was changed.

Handling these events allows us to announce value changes on such
objects like Slider, SpinBox, etc...
This is a universal method of value-change announcement, so it
supports all sorts of A11Y gestures.

On the Java side a new function was introduced to announce the
values, because we need to use the actual element's *value*,
not its accessible name or description.

Task-number: QTBUG-93396
Pick-to: 6.3 6.2 5.15
Change-Id: Ic44abd5f01b9b6f5468962131466edaf6a49d498
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
2022-02-15 17:51:33 +01:00
Edward Welbourne
e5ba838045 tst_qsqlquery coding style: use braces correctly
Single-line bodies of single-line controls don't need braces.
If one block of an if/else chain needs braces, the rest get them too.
One long condition needed a split that forced its body to need braces.

Change-Id: Ic4116b1273e16a586fdec18e6d8228e48a9cb07c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-15 17:32:47 +01:00
Edward Welbourne
1013cf49c7 Prefer QString(count, character) over QString::fill()ing
It lets the string be const, if nothing else.

Change-Id: Iffc1cfe71c5f6030b3f7434f964f2f2c102bf9c0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-15 17:32:47 +01:00