When the format is an ASCII string, there's no point widening it to
UTF-16 before the actual formatting step. Also, don't construct the
format string using string arithmetic, when passing another parameter
to arg() will do just as well. In the process, restructured
generic_data(), split long lines and conform spacing to Qt coding
style on affected lines. Simplified initialization of two string
fragments by using QL1S instead of QString, too.
Change-Id: Ib101dcf9296cc532291518bcef8e0a8de597b8a0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
In tst_qguiapplication and tst_qcoreapplication,
the application version should be set. On Android, this
is done using QT_ANDROID_VERSION_CODE.
Pick-to: 6.2 6.3
Change-Id: I6b473ad25092fb24df9400e0ab8fbb8ea4edbb6a
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Tests are run for QNX in qemu similar to b2qt currently (using offscreen
plugin and software rendering). So the issue is same.
Pick-to: 6.2 6.3
Task-number: QTBUG-100930
Change-Id: Ie973c6c611ac48703fd7cce53925940b80858bc8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
That only Windows and macOS are supported is mentioned, but deep down in
the description. Let's make it more prominent.
Pick-to: 6.3
Change-Id: Ia34a10f2fcbe0b2f86b5a0c5585277e169b11fa6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The group is not used anymore. It also prevents qdoc to properly put
the variables in the breadcrumb menu (under "CMake Variables in Qt6 Core")
Pick-to: 6.3
Change-Id: I1afe3b1cb7be8dcdda9a6c6e1235e4457800179d
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
GTK buttons can be pressed with Space, Return and Enter, so this should
be considered native behavior for GTK based desktop environments.
Qt::Key_Select is also included here because QAbstractButton has been
pressable with Qt::Key_Select for a long time.
Change-Id: I2c279ad05d1a10e5968a18996b8b40a83d2251fa
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
on Wayland
Task-number: QTBUG-100891
Pick-to: 6.3 6.2
Change-Id: Iadf12364ded4549988ad75a9487c7e96e963a956
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Clang uses arch names directly, and not the "arch=xxx" format of GCC.
Appears we do not use this target though.
Pick-to: 6.3 6.2
Change-Id: I1d295f25fe2278c5c6bc0f617496555e28427bea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Scroll tests relied on having a small window. On Android, the
window can not be smaller than the screen.
This patch changes the tests so that the windows have large
enough content so scrolling can happen.
Fixes: QTBUG-87408
Pick-to: 6.2 6.3
Change-Id: I26a444518fd934527089297c594673937f0ecf88
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
The required canvas configuration is an implementation
detail; move it out of the .html file (which we expect
that users will replace), and into the QWasmScreen
constructor.
This also enables using a div element as the container
element (instead of a canvas), since Qt then can create
and configure the canvas during QWasmScreen construction.
Change-Id: Ia849517d00fa3e8ec307065a524c0c91296dd490
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Platforms should allow more than just Qt::Key_Space and Qt::Key_Select
to press buttons. KDE Plasma developers want to be able to press buttons
with Return/Enter. GTK allows buttons to be pressed with Return/Enter,
so this should be considered the native behavior for GNOME as well.
Adding this ThemeHint allows customizing the keys that can press a
button via a QPlatformTheme subclass.
Change-Id: I73284e9b73590fbdd0b94a0cb4557e94b3722af9
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>