Commit Graph

60987 Commits

Author SHA1 Message Date
Amir Masoud Abdol
f5aa8317d0 Add -Wno-error=stringop-overread to warnings_are_errors_flags
Besides `stringop-overflow`, the `stringop-overread` is also buggy, and
it has some false positives. If not silenced, this will break the
unity build as several warnings are being emitted in qmetaobject.cpp,
etc.

Pick-to: 6.5
Change-Id: I708c81057c01d8d8fc9694c394c89602a2f6867b
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-04-07 16:06:22 +02:00
Christian Ehrlicher
3983babd71 QSqlQuery: add boundValueName()/boundValueNames()
[ChangeLog][SQL][SqlQuery] Added two new functions
boundValueName()/boundValueNames() to return the names of the bound
values.

Fixes: QTBUG-97847
Change-Id: I8df5f15e8df13141a34d38b0a2e13b37f4e7829c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-04-07 14:25:28 +02:00
Amir Masoud Abdol
9db9a836fb Remove unused variable/code
Pick-to: 6.5
Change-Id: I8d28db64c1ae2c57c95b2f9f22303d74172226e9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-04-07 11:12:34 +02:00
Alexandru Croitor
f00280337b qmake: Fix incorrect Info.plist replacement of EXECUTABLE_NAME
The app_bundle_name should be used if it's not empty.
Previously it was only used if it was empty.

Amends 0749ba2c5e

Pick-to: 6.5
Fixes: QTBUG-112668
Change-Id: I4a0e8286eabb5156ad62b448afdf7f54cc78a915
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
2023-04-06 20:39:53 +02:00
Alexandru Croitor
b2e586cf15 qmake: Clarify documentation on how to modify QMAKE_BUNDLE
The value is auto-computed from other variables and should not be set
directly by the project code.

Pick-to: 6.5
Fixes: QTBUG-112667
Change-Id: I6132b98f3a1ac0f9d721f390a065f6fa22db2bf6
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-04-06 20:39:53 +02:00
Amir Masoud Abdol
75ea098a16 Use NO_UNITY_BUILD instead of directly setting the property
Pick-to: 6.5
Change-Id: I4f39f7c306cddb3fe6797ac4aa3c3c08d573962c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-04-06 20:39:53 +02:00
Axel Spoerl
947f4df49c Fix CMakeLists.txt of echo plugin example
This patch adds a missing dependency to the echo plugin for shared
builds.

Since it fixes the last remaining example, it closes the Jira ticket.

Fixes: QTBUG-112300
Pick-to: 6.5
Change-Id: Ib1da2d7d5f5d54d7224f1c65a995f3752037e5be
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-04-06 19:36:48 +02:00
Alexandru Croitor
5e378e7374 syncqt: Add more information to verbose output
Makes it easier to troubleshoot issues.

Pick-to: 6.5
Change-Id: If50fafde8748bb0fde58f54ed55fe1ddf9bcf088
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-04-06 19:26:02 +02:00
Alexey Edelev
55f89c76d9 Guard qopenglcontext_p.h with QT_NO_OPENGL
Fixes the macos build with the disabled opengl feature.
Include inttypes.h that used to be implicitly included by
qopenglcontext_p.h. It's needed for 'PRId64' macro.

Amends: ef27cc126c

Pick-to: 6.5
Fixes: QTBUG-112656
Change-Id: I970329c4aacc70790f50e1ff3a57ab2aa6f6bff7
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-04-06 19:26:02 +02:00
Timothée Keller
a516a368c2 Windeployqt: change qtModule return value to prevent invalid modules
When the change from quint64 to bitsets was originally made, the return
value of the qtModule function was not adapted. Where returning 0 was
fine for the quint64 values which started at 1, returning 0 now adds
the first module instead of adding nothing to the used/required modules

Fixes: QTBUG-111984
Pick-to: 6.5
Change-Id: Id1e2b3237a36335ec5071180b4c73f99d5eb5c8d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-04-06 17:51:36 +02:00
Morten Sørvig
a215e6650a Add DPI change tests
We can expand the testing a bit bit verifying that also
created windows work as expected, and that QWindow DPR
is updated when Screen DPI is changed.

Change-Id: I082aac18b6b086c69c16681977b7eaa6c3e54ee0
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
2023-04-06 14:28:24 +00:00
Amir Masoud Abdol
684d301983 Disable Unity Build for Examples
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I20999512e557db618c14e36d62317680bc17c43a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-04-06 14:28:24 +01:00
Kaj Grönholm
a2dccbafcf Clear invalid QApplication styleOverride
When QStyleFactory::create() is unable to find/create an override style
set with QT_STYLE_OVERRIDE or "-style", clear the styleOverride. Reason
for this is that Qt Quick Controls otherwise tries to use this invalid
style.

Task-number: QTBUG-100563
Pick-to: 6.5
Change-Id: I48fa6c211ce27d902e2eaf90c34cb5694ad7ecfd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-04-06 16:28:23 +03:00
Timothée Keller
8009561029 Windeployqt: Prevent '.' and '..' from being added to lconvert
If windeployqt is not able to retrieve any translation information
from the catalog, the translationNameFilters will be empty. This allows
the '.' and '..' folders to be passed to lconvert which in turn causes
an error for the whole deployment. Added a check for the filters being
empty, and a warning in case we have to preemptively return from the
translation deployment.

Fixes: QTBUG-112204
Pick-to: 6.5
Change-Id: I0d114186e630cc3696250006fa093c4c596eb40d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-04-06 12:18:34 +02:00
Timothée Keller
a81fa2047b Windeployqt: Simplify infix detection for --libinfix builds
Removed fetching the infix through the QtCore Module, since
it is already provided by qtpaths -query

Pick-to: 6.5
Change-Id: I844305fc66b21af094724dd3f516078447ee1dd2
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-04-06 11:18:12 +01:00
Friedemann Kleint
aa6339594e Fix qdoc warning about missing QMultiMap code snippet
Bring back missing code snippet src_corelib_tools_qmultimap.cpp#19,
fixing:

qtbase/src/corelib/tools/qmultimap.qdoc:1007 Command '\snippet (//!
[19])' failed at end of file
'qtbase/src/corelib/doc/snippets/code/src_corelib_tools_qmultimap.cpp'

As a drive-by, use a more modern form, avoiding repeated invocation
of end().

Amends 3236b64db8.

Task-number: QTBUG-105109
Pick-to: 6.5 6.2
Change-Id: I09635eedd773ed16517773a9bf282b0386beba26
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-04-06 10:43:22 +02:00
Christian Ehrlicher
be8b3efae6 SQL/QSqlRelationalTableModel escape the auto-generated alias
The alias created by QSqlRelationTableModel to avoid duplicated field
names was not escaped which lead to an inconsistency in the returned
alias name from the database (e.g. postgres lowers all unescaped column
names).
Also adjust the test for QSqlRelationTableModel to use escaped table
names for it's tests and fix it for QIBASE.

Change-Id: I01426320c0c1a70cb9bf8e6dfa2f8b07dbb1c06b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-04-06 05:41:16 +01:00
Christian Ehrlicher
39fab09aad SQL/MySQL: add option MYSQL_OPT_TLS_VERSION & MYSQL_OPT_SSL_MODE
Add the two options MYSQL_OPT_TLS_VERSION and MYSQL_OPT_SSL_MODE to
properly support encrypted connections to MySQL 8.0 servers.
MYSQL_OPT_SSL_MODE will not work when compiled against the MariaDB
C-Connector since it's not supported by the MariaDB client.

[ChangeLog][QtSql][MySQL] Added the two new connect options
MYSQL_OPT_TLS_VERSION and MYSQL_OPT_SSL_MODE.

Fixes: QTBUG-84797
Change-Id: Iec7d682fc00072ce5b2a824c4ea00fca4575a93e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-04-06 04:41:15 +00:00
Volker Hilsheimer
27867de8ca Permissions: respect context object's thread and life time
When a context object is provided, then callers expect that the functor
or slot is executed in the thread of the context object. And if the
context object has been destroyed by the time the permission response
is received, the functor shouldn't be called at all.

To implement this, we either have to plumb the call back through a
signal/slot connection and benefit from QObject's infrastructure. This
is not practical here, as we don't have an "engine QObject" that would
emit a signal.

Instead, we can create a QMetaCallEvent explicitly, following what we do
in e.g. QHostInfo, and using a temporary QObject that handles the event
to then call the functor.

Add test coverage.

Pick-to: 6.5
Change-Id: Id878e45b304857304165ab4a7c6aae76fbee46ce
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-06 00:21:50 +02:00
Alexey Edelev
ef27cc126c Guard qopenglcontext_p.h with the QT_NO_OPENGL check
QtGui/private/qopenglcontext_p.h needs to be guarded to avoid
compilation errors when building Qt with openGL disabled.

Fixes: QTBUG-112656
Pick-to: 6.5
Change-Id: I21d120ed2bdb22e7aa2338e396a9a426adb80dbe
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-05 21:30:29 +02:00
Amir Masoud Abdol
b408bae864 Remove unused code in qmake, triggering -Wunused-but-set-variable
This seems to be a leftover from a refactoring done a few years ago.

Pick-to: 6.5
Change-Id: I2bd2700aca3a5a6104886eaa0957226786ad615a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-04-05 19:36:55 +02:00
Volker Hilsheimer
9476283edb Docs: document QTextFormat::Property::ListStart
Fix qdoc warning by documenting the new value.

Change-Id: I8c289cf103ccf008b6592a9e6e940d02e5cab7b3
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
2023-04-05 19:05:04 +02:00
Fabian Kosmale
63b350b2ed cmake: Indicate that export headers are autogenerated
This should help anyone stumbling upon them to realize that they should
not be modified directly.

Change-Id: Ib5218babdb8943646e222342f1040e5bba693076
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-04-05 18:25:06 +02:00
Rami Potinkara
792a5b15c9 Android: fix cutout area rendering on Android 9 and above
Fix rendering to cutout areas so that they are filled both
in portrait and landscape modes.

Fixes: QTBUG-96877
Pick-to: 6.5 6.2
Change-Id: I8a29557236ed1b7084afc902dc1fb42d9535ef32
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
2023-04-05 15:59:22 +00:00
Joni Poikelin
588eab99d2 Fix some extra semicolon warnings
Fixes: QTBUG-112648
Pick-to: 6.5
Change-Id: I71446459c7fd6018ecb4deb60a7b9b412c0972ba
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-04-05 18:59:22 +03:00
Assam Boudjelthia
a43f349f9c Android: allow using string based versions in compileSdkVersion
Some platform sdk packages have names that contains non-integer
characters such as android-33-ext5 or android-UpsideDownCake
which fail building with androiddeployqt because build.gradle
expects an integer only. This allows using string based versions
and also fallbacks to setting an integer only value if it finds
that the build.gradle of the project is still explicitly
converting to integer (this to avoid breaking existing projects).

Fixes: QTBUG-112465
Pick-to: 6.5 6.2 5.15
Change-Id: If8cfc0fb84f0880a43644dc0a4188671736d3e21
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-04-05 12:38:15 +01:00
Assam Boudjelthia
4521dfe75a Android: fix manual deployment with ANDROID_DEPLOYMENT_DEPENDENCIES
Fix the qtforandroid (i.e. libplugins_platforms_qtforandroid) check
and avoid calling llvm-readobj on non-library files and only add them
to the dependency list.

Task-number: QTBUG-94232
Pick-to: 6.2 6.5
Change-Id: Id1a415b6d9834daaf5337e9bd15e7daf69fd574f
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-04-05 12:38:15 +01:00
Assam Boudjelthia
b92854aed3 Android: don't break when finding opengl plugin
avoid breaking when looking for the android plugin when the dependencies
include opengl lib, since that was valid only in the early days where
the Android plugin was separated into two raster and opengl. Now, that
assumption is wrong and might affect the way the manual dependency
works.

Task-number: QTBUG-94232
Pick-to: 6.2 6.5 5.15
Change-Id: I025a5c8b2b064bb43a356a4ad5cb4a1ada41b09b
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-04-05 12:38:15 +01:00
Ivan Solovev
028c367f75 Deprecate QtFuture::makeReadyFuture()
[ChangeLog][Deprecation Notice][QtCore] The QtFuture::makeReadyFuture()
method and all its specializations are deprecated since Qt 6.10.
The reason for the deprecation is that the method has a
makeReadyFuture(const QList<T> &) overload, which behaves differently
from all other overloads (including other non-const ref QList
overloads).
Use QtFuture::makeReadyVoidFuture() when you need a ready void QFuture,
or QtFuture::makeReadyValueFuture() when you need to propagate the
input type to the returned QFuture, or QtFuture::makeReadyRangeFuture()
when you need to create a multi-value future based on an input
container.

Fixes: QTBUG-109677
Change-Id: I55125269989df0a02840d5ddd5763ef5f1070df5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-04-05 13:38:15 +02:00
Ivan Solovev
9b4b32ec98 Long live QtFuture::makeReadyVoidFuture() and QtFuture::makeReadyValueFuture()
[ChangeLog][QtCore][QFuture] Added QtFuture::makeReadyVoidFuture()
and QtFuture::makeReadyValueFuture().

Basically, these methods behave like QtFuture::makeReadyFuture(), but
QtFuture::makeReadyValueFuture() does not have a "const QList<T> &"
specialization returning QFuture<T> instead of QFuture<QList<T>>,
which allows it to always behave consistently.

This patch also introduces usage of the new methods around qtbase.

Task-number: QTBUG-109677
Change-Id: I89df8b26d82c192baad69efb5df517a8b182995f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-04-05 13:38:15 +02:00
Ivan Solovev
7f38f9f394 Long live QtFuture::makeReadyRangeFuture()
[ChangeLog][QtCore][QFuture] Introduce
QtFuture::makeReadyRangeFuture(). This method takes a container
which has input iterators and returns a multi-value
QFuture<ValueType>, where ValueType is the underlying type of
the input container.

This commit also replaces the usage of buggy
QtFuture::makeReadyFuture(const QList<T> &) overload with the new
method.

Task-number: QTBUG-109677
Change-Id: I019e62eac74c643d88a65b3cc0085bc7c33bc712
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-04-05 13:38:14 +02:00
Ivan Solovev
10242a8250 QPermission: return the combined result of a permission group on Android
QPermission might resolve to multiple underlying permissions on Android.
The existing code was only using the first permission from the list
in checkPermission(), and also checked only for the first result
returned by requestPermissions().
This can lead to a situation when only one of the requested permissions
is granted, but the API reports that all required permissions are
granted.

This patch fixes it by checking the combined status of all permissions.
If at least one of the permissions is denied, the whole list of
permissions in considered denied.

Fixes: QTBUG-112527
Pick-to: 6.5
Change-Id: I243b73bb5a842197cd0ef70937b8eac344ff9596
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-04-05 12:34:15 +02:00
Thiago Macieira
2f226336a2 QPluginLoader: don't instantiante multiple, identical instances
This can happen if the same project has two or more Q_IMPORT_PLUGIN
macros in their source. And that can happen when converting from qmake-
based builds to CMake, as qmake didn't generate a source file with the
macro but CMake does.

[ChangeLog][QtCore][QPluginLoader] staticInstances() will not call
duplicated registrations of the same instantiation function, which can
only happen as a result of duplicated Q_IMPORT_PLUGIN for the same
plugin name.

Fixes: QTBUG-102745
Pick-to: 6.2 6.5
Change-Id: Idd5e1bb52be047d7b4fffffd174fb9dd62d8583d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-04-05 00:29:16 -07:00
Christian Ehrlicher
a74059f2bd SQL/PSQL: remove non utf-8 support
PostgreSQL supports the utf-8 encoding ('UNICODE') since at least
version 7.3 which is the oldest version we support. Therefore remove the
non utf-8 codepath completely.

Change-Id: I64b1a4e7b0b85141fe13f5f57e6f35f9eb7d542e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-04-05 05:37:39 +01:00
Christian Ehrlicher
dbcad6392b SQL/Benchmarks: cleanup
The benchmarks were only copied from the tests without a proper cleanup
- therefore clean them up now.

Change-Id: I0285de3fd2b67c21e732d7f3f9d1f4937965be81
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-04-05 05:37:32 +01:00
Alexey Edelev
db705d0794 Fix multi-thread GNU make build
Add the timestamp file creation for configure-time executables.
GNU make treats the custom command artifacts as 'dirty' when one of
the expected outputs is missing. It displays the following disclaimer

  Deleting primary custom command output ... because another output
  ... does not exist.

which leads to the configure-time executable rebuild. The removal
and rebuild is not in sync with the dependency lookup for other
targets(thanks to GNU make) so targets that depend on the
configure-time executables simply miss the dependency at build time.
This happens to syncqt and '_sync_headers' targets. So creating
the timestamp file at configure time indicates to GNU make that
there is no need of removing the syncqt executable and the build
process doesn't fail because of missing dependency.

Fixes: QTBUG-112018
Fixes: QTBUG-111163
Pick-to: 6.5
Change-Id: I6c1e8cae522104cf50d0376fa2b5653a6770f9ca
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-05 01:04:28 +02:00
Assam Boudjelthia
65d79fb5f3 Android:CMake: use correct key for manual deployment dependencies
androiddeployqt expects a key deployment-dependencies for dependencies
provided by QT_ANDROID_DEPLOYMENT_DEPENDENCIES.

Pick-to: 6.2 6.5
Task-number: QTBUG-94232
Change-Id: I3fc32e0677db3ee69e24b3aeca74bedd9c7ced58
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-04-05 00:04:28 +01:00
Carl Schwan
ac973cb74f Implement setBadgeNumber for xcb backend
This use the unity launcher specification which is defined here
https://wiki.ubuntu.com/Unity/LauncherAPI

This spec is used by Plasma and Unity. On other Linux desktop platform
where the unity DBus interface is not detected this is no-op.

Change-Id: I81a9b95fe4886ad597bb4e775641926b161c49a5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
2023-04-04 23:53:37 +02:00
Ilya Fedin
447f3ade9a Revert "D-Bus system tray: properly check whether StatusNotifierHost available"
This reverts commit 23e9b57e3d.

The original commit was made based on a KDE workaround for
libdbusmenu-qt crash, but Qt is not using libdbusmenu-qt, Qt is not
watching for StatusNotifierHost registration and Qt is not capable
to switch backends on the fly leading to tray support being
not detected on Plasma Wayland sessions and falling back to the poor
legacy protocol on X11.

Task-number: QTBUG-94871
Pick-to: 6.5
Change-Id: Ic3e4a9c2d6db00299ed1f2b14043c4b675fb8ccc
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-04-05 01:27:48 +04:00
Ilya Fedin
9d031caf09 IBus: fix missing Q_SLOTS
The following warning is printed on systems using IBus:
   qt.dbus.integration: Could not connect "org.freedesktop.IBus" to globalEngineChanged(QString)

It seems either the connection has never worked or moc has changed

Pick-to: 6.5 6.2
Change-Id: Ib96229c85c975603d28c76163fa144ddfe827b18
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-04-05 01:27:47 +04:00
Christian Ehrlicher
7763b83c4c Widgets/Styles: pass correct style option struct to subelements
QHeaderView is using QStyleOptionHeaderV2 which should later be used in
the subelements drawings. But since the subelement rect must be
adjusted, a copy is done - sadly only to QStyleOptionHeader so we're
loosing the V2 information.
Therefore explicitly check if it's a V2 and copy it over to the correct
structure.

Pick-to: 6.5 6.2
Fixes: QTBUG-97571
Change-Id: I1482f118e2114cd6ef21c2a800785bd9910c1c5b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-04-04 19:23:37 +02:00
Axel Spoerl
b932f798a2 QSslCertificate: Add property names to debug operator<<
When qDebugging a QSslCertificate, its properties are printed without
property names. That makes it difficult to identify which output string
correlates to which data element.

This patch adds the property name to each output field.

Pick-to: 6.5
Change-Id: Icdc54520e048f5fa03e8d9ed0ab2a42371e5a00d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-04-04 19:23:33 +02:00
Christian Strømme
f1dc42e19e Fix crash in QIOSTextResponder
When a window that has focus is destroyed we can end up calling
into nextResponder where the focus window is in the process of being
destroyed, so make sure we have a window with a valid platform window
before calling winId()

Fixes: QTBUG-110019
Pick-to: 6.5 6.4
Change-Id: I704c3597b46e465ddf2605bdb71a21cb36cb2a26
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-04-04 18:14:56 +02:00
Thiago Macieira
87103e04e9 QMultiHash: fix missing update to m_size
QMultiHash has access to two sizes: one of them is shared with QHash,
stored in QHashPrivate::Data::size, which counts keys; the other, which
is what our public size() function returns, is stored in
QMultiHash::m_size and counts plain (key,value) entries. We forgot to
update it in the non-const operator[] that created a node.

I've reviewed the rest of the code and can't find any more places where
the item count may be changed and m_size isn't updated.

[ChangeLog][QtCore][QMultiHash] Fixed a bug that caused an element that
was created by operator[] to not be counted, resulting in a hash map
with an incorrect element count and which could cause an assertion
failure depending on how the hash was later mutated.

Fixes: QTBUG-112534
Pick-to: 6.2 6.4 6.5
Change-Id: Idd5e1bb52be047d7b4fffffd17527ec274e1d99e
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2023-04-04 08:59:32 -03:00
Cajus Pollmeier
59466abc08 Fix default "credential" flag for WASM HTTP connections
In some cases, you might want to set the "credentials" flag for HTTP
requests. But you can't use it everywhere, because it may break the
use of public APIs. As a result, you're running into

Reason: Credential is not supported if the CORS header
        'Access-Control-Allow-Origin' is '*'

on the client side. See

https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSNotSupportingCredentials

for details.

This commit restores the former default "false", in order to make
WASM connections that worked prior 6.5 work again.

Fixes: QTBUG-112478
Pick-to: 6.5
Change-Id: I46f6a374c07038608c3484ac831a1dc5999fb120
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-04-04 13:41:06 +02:00
Amir Masoud Abdol
da2b0307f8 Replace STREQUAL cases with variable checks
As I was investigating the NO_UNITY_BUILD_SOURCES issue, I realized that
we don't need to pass these quoted, especially now that we have moved
to `cmake_parse_arguments(PARSE_ARGV`, and we can check their existence
just by checking the `arg_*`, and that should be sufficient.

I also left a warning that we are aware of this.

Pick-to: 6.5
Change-Id: I4d939e80dc4671ea3ae9dc61516279f69ba2c5a5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-04-04 08:55:02 +02:00
Allan Sandfeld Jensen
c080d1e64d Create any callable using QRunnable::create
The overhead of making new custom classes appears to be less than
constructing a generic std::function.

[ChangeLog][QtCore][QRunnable] QRunnable::create can now take
non-copyable functions as argument.

Task-number: QTBUG-112302
Change-Id: Ied870f13ca6c7eaa14ed6eff9c4e676c7b73881c
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-04-04 01:05:47 +02:00
Ilya Fedin
5c4a94ba85 Make flatpak check more backward compatible
Since 68de00e0d4, the check doesn't work
with flatpak versions lesser than 1.13.1. Checking the file in the root
directory works since flatpak 0.6.10.

Pick-to: 6.5 6.2
Change-Id: Icc83ea5de4a962b52a737c9842248df3b60b1331
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-04-04 01:21:51 +04:00
Paul Wicking
2f35879649 Doc: Add \examplecategory macro
Examples in Qt's codebase must be tagged with specific categories
such that Qt Creator can group them thematically. This can be done
by way of using the `\meta category` construct in QDoc.

At the same time, we want the generated documentation to group the
examples by the same logic as in Qt Creator. Hence, QDoc was modified
to implicitly add a group for each category that is used in a
`meta category` invocation.

By design, QDoc exposes ways to list groups to users, but no way to list
the \meta command invocations. Letting QDoc implicitly add a group for
categories passed to the \meta command as a side-effect, therefore breaks
with the principle of least surprise and the single responsibility
principle.

An alternative solution makes use of QDoc's existing support for code
generation through macros. This patch introduces the macro
`\examplecategory` as a global macro throughout Qt to achieve the same
effect as the aforementioned change to QDoc. The macro takes an argument
enclosed in curly braces. This argument is the example category name. It's
used as meta information in the manifest files consumed by Qt Creator, and
added as the category group name for the QDoc side at the same time.

The introduction of this macro allows reverting the change to QDoc
itself, while maintaining feature parity for both Qt Creator and the
generated content.

Task-number: QTBUG-111891
Pick-to: 6.5
Change-Id: I311b98168253b45ac456ff3c1824db3d835191a9
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
2023-04-03 21:37:12 +02:00
Christian Ehrlicher
5a334b3d2b SQL/tests: Add testcase for QODBC toSQLTCHAR()
Add a testcase for toSQLTCHAR() to make sure to pass the correct number
of encoded characters to the odbc functions.

Pick-to: 6.5
Task-number: QTBUG-112375
Change-Id: Ib67fab678fc3d0b098aedfc6fa9ec2139f2e75c7
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-04-03 17:52:32 +02:00