Commit Graph

53735 Commits

Author SHA1 Message Date
Ivan Solovev
2a72f0f15d Fix compilation with QT_NAMESPACE and tracing on Linux
The tracegen tool was not taking into account that Qt could be build
with a custom namespace. As a result, the combination of namespace
build and tracing enabled was not working, because tracegen generated
classes without the namespace.

This patch fixes it.
We cannot add QT_BEGIN_NAMESPACE/QT_END_NAMESPACE because of the
tricky logic that recursively includes the generated header file
multiple times, also including the code like

static const struct lttng_event_desc *_TP_COMBINE_TOKENS(__event_desc___, TRACEPOINT_PROVIDER)[] = {
(hash)include TRACEPOINT_INCLUDE
    NULL, /* Dummy, C99 forbids 0-len array. */
};

where TRACEPOINT_INCLUDE is the path to the generated header.

This patch is using QT_USE_NAMESPACE, wrapped into some #ifdefs.
This should be safe, considering that the generated trace headers
are only used as private API.

The windows tracing support seems to be broken even in a
non-namespace build, so it's not handled in this patch.

Task-number: QTBUG-97246
Pick-to: 6.2
Change-Id: I12db76e199a3aa3abde641fbf99a6e1a3d7de203
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2021-10-25 14:57:18 +02:00
Iikka Eklund
623e396e88 Change package_revision_mode() to recipe_revision_mode()
The package_revision_mode() is too strict for Qt CI.
This mode includes artifacts checksum in package_id which is
problematic in Qt CI re-runs (re-run flaky build) which contain
different build timestamps (cmake) which end up in library
files -> different package_id.

The effect was that Conan/Conan server is unable to re-use correct
binaries and re-builds (re-staged) dependencies.

Pick-to: 6.2 6.2.1
Change-Id: Id54af7455b948c8d68b7206d524f1d0fcfb7b568
Reviewed-by: Toni Saario <toni.saario@qt.io>
2021-10-25 15:47:46 +03:00
Assam Boudjelthia
cbc29dc16c Android: set EXTRA_TITLE to the initially selected file in save dialog
The extra data EXTRA_TITLE is only documented to be used to provide
the initially selected file name in the context of file dialog [1].
So, let's stick to setting it only in save mode. This also now allows
the save dialog to set an initial file name which wasn't possible
before.

[1] https://developer.android.com/reference/kotlin/android/content/
Intent#action_create_document

Pick-to: 6.2 5.15
Change-Id: Ib55191a7269bfad28af4928f4e74d87981bdd574
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-10-25 15:47:46 +03:00
Volker Hilsheimer
137ba2aba8 Initialize member variables before we check their values
Amends 51679efcf97dfea86431912eeb9489088c0804ed, which broke Ctrl+key
handling so that the key was not translated based on the alphanumerical
character anymore.

Fixes: QTBUG-97713
Pick-to: 6.2
Change-Id: I9835fd7af99693aae636ba3c4c114ef8e11621e9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-10-25 14:07:00 +02:00
Joerg Bornemann
1a44090df5 qmake/vcxproj: Fix malformed <Message> tags
Extra compilers and the command set to "\n" would result in malformed
<Message> tags in vcxproj files.  Those tags are used to display the
name of the extra compiler when building.  Setting the extra compiler's
command to "\n" is a common trick to force the creation of the rule.

Make sure to trim the command name that is created from the extra
compiler's command to avoid such new-line-only bogus message tags.

Pick-to: 6.2 5.15
Change-Id: I1bae28ed14c438d777f96280c6b2cf5ca315b51c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-10-25 10:10:08 +02:00
Ilya Fedin
6bf41058a6 Add a QNetworkInformation backend based on GNetworkMonitor
GNetworkMonitor can get information from 3 sources:
* org.freedesktop.portal.NetworkMonitor
* NetworkManager
* netlink

Change-Id: Icfafe6af42148f26360449f1262093ffc6b0613a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-10-24 18:22:46 +04:00
Ivan Tkachenko
8896ef999b Doc: Fix formatting: remove extra \c before \nullptr
Change-Id: Ie93cf7253bdc6b70fd187c208da636fc551491c2
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-10-24 13:15:51 +03:00
Mårten Nordheim
06d2a5cf61 Update windows version detection
Since the API still doesn't return 11.

Pick-to: 6.2 5.15
Change-Id: Ifd4f7f845915702fcbb0f857487358ae8e806273
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-10-24 07:50:02 +00:00
Thiago Macieira
4c50810a1a Remove old pre-6.0 hooks
Now only qt_startup_hook officially remains

Change-Id: Iac31783a62a040638d73fffd168aaaa7408c9be4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-10-22 19:12:07 -07:00
Venugopal Shivashankar
b6230421f1 Doc: Fix qdoc warnngs
qt5/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:75: (qdoc) warning: Cannot tie this documentation to anything [qdoc found a /*! ... */ comment, but there was no topic command (e.g., '\fn', '\page') in the comment and no function definition following the comment.]
qt5/qtbase/src/gui/text/qtextformat.cpp:1500: (qdoc) warning: Overrides a previous doc
qt5/qtbase/src/gui/text/qtextformat.cpp:1487: (qdoc) warning: (The previous doc is here)
qt5/qtbase/src/gui/text/qtextformat.cpp:1533: (qdoc) warning: Overrides a previous doc
qt5/qtbase/src/gui/text/qtextformat.cpp:1520: (qdoc) warning: (The previous doc is here)

Change-Id: I5a089bef1841d6d69bff4c780805d20e5926fe6f
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2021-10-23 03:08:58 +02:00
Venugopal Shivashankar
b50ee930c7 Doc: Fix qdoc warnings
src/corelib/kernel/qmetatype.cpp:1605: (qdoc) warning: Command '\snippet (//! [[implicit]])' failed at end of file 'qmetatyp>
src/corelib/kernel/qmetatype.cpp:1615: (qdoc) warning: Command '\snippet (//! [[member]])' failed at end of file 'qmetatype/>
src/corelib/kernel/qmetatype.cpp:1626: (qdoc) warning: Command '\snippet (//! [[memberOk]])' failed at end of file 'qmetatyp>
src/corelib/kernel/qmetatype.cpp:1639: (qdoc) warning: Command '\snippet (//! [[unaryfunc]])' failed at end of file 'qmetaty>
src/corelib/text/qbytearraymatcher.cpp:233: (qdoc) warning: No such parameter 'view' in QByteArrayMatcher::indexIn()
src/corelib/time/qdatetime.cpp:1854: (qdoc) warning: Can't link to 'QLocaleie:pmText()'
src/corelib/thread/qsemaphore.cpp:494: (qdoc) warning: Undocumented return value (hint: use 'return' or 'returns' in the text
src/corelib/thread/qsemaphore.cpp:505: (qdoc) warning: Undocumented parameter 'timeout' in QSemaphore::try_acquire_for()
src/corelib/thread/qsemaphore.cpp:505: (qdoc) warning: Undocumented return value (hint: use 'return' or 'returns' in the text
src/corelib/thread/qsemaphore.cpp:516: (qdoc) warning: Undocumented parameter 'tp' in QSemaphore::try_acquire_until()
src/corelib/thread/qsemaphore.cpp:516: (qdoc) warning: Undocumented return value (hint: use 'return' or 'returns' in the text

Change-Id: Ib612c69525ec7542f2ad3dd9a07e89f266718fd8
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2021-10-23 03:08:58 +02:00
Robert Löhning
a7d1c48ca3 QVarLengthArray: Reduce memory allocations in emplace()
Currently, we allocate memory for elements one by one which can get
pretty slow when adding many elements.

[ChangeLog][QtCore][QVarLengthArray] Reduced number of memory
allocations in emplace() by allocating more memory at once.

Fixes: QTBUG-97489
Pick-to: 6.2
Change-Id: Idfb5b5946b047d5215c8ed00770574249f9f5d40
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-10-23 01:22:15 +02:00
Gatis Paeglis
fdbf7cdd09 xcb: use QXcbConnection::selectionOwner() convenience API
Change-Id: I4fbae152829206b15bf0430d3fb2c9e2b6026566
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-10-22 23:30:07 +02:00
Gatis Paeglis
7f0e227d8a xcb: remove confusing indirections for qt selection owner
This makes it more obvious that clipboard and DnD use the
same selection owner (QXcbConnection::qtSelectionOwner()).

This way we can also drop some QT_NO_CLIPBOARD defines.
These defines actually are broken, but that is out-of-scope
for this patch.

And renamed the functions according to Qt guidelines:

getSelectionOwner()   -> selectionOwner()
getQtSelectionOwner() -> qtSelectionOwner()

The previous naming probably was influenced by underlying
C API - xcb_get_selection_owner().

Change-Id: I467f1a3dbe75b4e8fd41c7e66ca9b0e25ef1039c
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-10-22 23:30:07 +02:00
Liang Qi
e0938223c4 xcb: avoid to use invalid pointers
Pick-to: 6.2 5.15 5.12
Task-number: QTBUG-96399
Change-Id: I33909940b501cb13f78981c43f3aef9fc9d1d52d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-10-22 23:30:07 +02:00
Alexandru Croitor
606124c5cc CMake: Fix -rpath-link dependencies take two
The previous implementation would pick up static Qt deps of a
shared Qt library as packages to find, but packages are not
created for these static libraries in a shared Qt build.

For example Qt::BundledSpirv_Cross is a static helper lib
that is linked directly into ShaderTools shared lib and no CMake
package is created for it, so we shouldn't look for it.

Separate the code path to filter out private dependencies
of a shared library target that don't have packages.

Amends 87215c70c0

Pick-to: 6.2
Fixes: QTBUG-97673
Task-number: QTBUG-86533
Change-Id: I43490b4d20c150256ccfa8b511a6e0e6b0f4b313
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2021-10-22 22:57:46 +02:00
Mårten Nordheim
5ea712987b Update Gradle to 7.2.0 and Android Gradle Plugin to 7.0.2
The latest build-tools 31.0.0 requires AGP version 7.0+, and that
requires Gradle version 7.0+, so use the latest stable release for both.

[1] https://developer.android.com/studio/releases/gradle-plugin?
buildsystem=ndk-build#updating-gradle

Fixes: QTBUG-97002
Pick-to: 6.2
Change-Id: I8ff26819bdf1a00f484ecc194c4d4e7bca2b598a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-10-22 19:54:45 +02:00
Assam Boudjelthia
a81f24ada5 Rename deprecated ANDROID_SDK_HOME to ANDROID_SDK_ROOT
Pick-to: 6.2
Task-number: QTBUG-97002
Change-Id: I777491f542e5388e04ed4c1b7ff5d9db75f9e778
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
2021-10-22 17:21:10 +02:00
Joerg Bornemann
7c7184ad60 Remove superfluous qfuture.h includes from qcoreapplication[_p].h
This include is only needed on Android, and removing it improves build
times slightly.

Remove the include from qcoreapplication.h and guard the includes in
qcoreapplication_platform.h properly for Android.

Remove the include from qcoreapplication_p.h as well.  This was a
left-over from the app permissions API that was removed.

Pick-to: 6.2
Task-number: QTBUG-97601
Change-Id: I131baebe3e08e93ad5420d40908c2dceab89554c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-10-22 09:48:41 +02:00
Joerg Bornemann
c327cc60bf Remove unused qapplicationpermission.h
The app permission API was removed, and this file is a left-over.
This amends commit 72e5b36e2e.

Pick-to: 6.2
Change-Id: Ie1bf9465260594864464c4d4ee4dc99593c28cc1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-10-22 09:48:33 +02:00
Volker Hilsheimer
71aaf831d1 QAbstractItemView: auto-scroll with selection rectangle
Some item views, such as QListView in icon mode, implement a selection
rectangle with which the user can "lasso" items. So far, dragging that
rectangle did not trigger auto scroll, so unless an item near the edge
was selected, the user had to stop the lassoing and scroll manually to
reach more items.

Since QAbtractItemView implements auto scrolling for drag'n'drop, we can
use that mechanism also when the selection rectangle is dragged. This
requires some modifications:

We need to make sure that scrolling the view during a drag-selection
generates mouse move events so that the selection is extended and the
rectangle is updated in subclasses.
And we need to stop using QCursor::pos to get the position of the mouse
pointer, as this makes the auto-scrolling untestable. Instead, record
the mouse position last seen during a mouseMove or dragMoveEvent in
content-coordinates (identical to pressedPosition).

As a drive-by, fix some coding-style issues in nearby code.

Done-with: Zhang Hao <zhanghao@uniontech.com>
Fixes: QTBUG-96124
Change-Id: I426f786e5842ae9f9fb04e9d34dc6d3379a6207f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-10-22 09:43:53 +02:00
Volker Hilsheimer
7d133a5613 Consistently restore threadpool limit at end of tests
Fix warning about unused variable, and use qScopeGuard to make sure that
the limit of the global threadpool is restored even if one of the tests
fail.

Pick-to: 6.2
Change-Id: I36747cb451074cceea961561478210728ed6d313
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-10-22 09:43:42 +02:00
Mårten Nordheim
bfe579613a QNI: Add a convenience method for loading the default plugin
We have some official plugins, we may as well treat them as default
and give a convenient function which loads those.

Change-Id: I6251c77ac042b795bcf24b86e510e960ee4bab54
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-10-22 09:40:49 +02:00
Mårten Nordheim
5f8e9c194e QNI: Add supportedFeatures getter
Which just returns all the supported features

Change-Id: I8c3996b00a6ebb114bdbc9db3085a0e27fc8fa79
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-10-22 09:40:45 +02:00
Thiago Macieira
a43dd9a6b1 Doc: QString: formalize that we now include the QBA's nulls
We've been meaning to do this ever since the QByteArray overloads were
added some time prior to Qt 4.5.1[1], but had been wary of behavior
compatibility issues. Commit 6abdbb65e5
did it and even explained so in the ChangeLog. I'm just being more
explicit.

[1] https://code.qt.io/cgit/qt/qt.git/tree/src/corelib/tools/qstring.h?h=v4.5.1#n415

Fixes: QTBUG-97451
Change-Id: Icb2516126f674e7b8bb3fffd16ad55e46a9781c8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-10-21 21:31:00 -07:00
Thiago Macieira
f9139b19bf QLatin1String: harmonize null byte handling with the rest of QString
After the introduction of QByteArrayView, all the QString::fromXxx
overloads and the constructor will include the null bytes inside
QByteArrays and so will QLatin1Strings created from QByteArrayViews.
This was the lone stand-out that wasn't fixed in 6.0, so do it now.

[ChangeLog][Important Behavior Changes] Since Qt 6.0, all QString and
QLatin1String methods consuming QByteArray and QByteArrayView objects
will include any embedded null bytes and treat them as U+0000 Unicode
characters, whereas in Qt 4.x and 5.x, they would stop at the first null
byte like bare C strings. Qt 6.3 contains a fix for a couple of the
methods that mistakenly persisted the old behavior in 6.0-6.2, namely
the QLatin1String constructor from QByteArray and the equality and
inequality operators between QByteArray and QString.

Task-number: QTBUG-97451
Change-Id: Icb2516126f674e7b8bb3fffd16ad5621cf3e64ec
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-10-22 04:30:53 +00:00
Thiago Macieira
5bc315fbe2 tst_QVariant: suppress warning about memcpying over QVariant
tst_qvariant.cpp:3624:15: warning: ‘void* memcpy(void*, const void*, size_t)’ writing to an object of type ‘class QVariant’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Wclass-memaccess]

Change-Id: Ic17a33f599b844d8ab5dfffd16aafcbd74823696
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-10-21 23:40:40 +00:00
Allan Sandfeld Jensen
c1a5f08ba0 Add QFontMetricsF methods taking text options into account
This is needed by Qt Quick to be able to calculate font metrics using
design metrics matching Quick text rendering.

Task-number: QTBUG-85936
Task-number: QTBUG-94023
Change-Id: I67c74e2a912bd58df7a57349a858f20f04609f0f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-10-22 01:05:43 +02:00
Ulf Hermann
8a4f252644 Avoid warnings when compiling bootstrap library without zstd
Change-Id: Ic67cd2b582df0464a17f6181157ebbd47986114c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-10-21 23:34:11 +02:00
Fan RuiJie
ab1904363a Fix warnings due to enums in QSizePolicy
gcc 11 generates warnings as

"bitwise operation between different enumeration types
'QSizePolicy::Policy' and 'QSizePolicy::PolicyFlag' is deprecated"

in C++20.

Fixes: QTBUG-93810
Pick-to: 6.2 5.15
Change-Id: If8a796b33a772cc1a561eb0b6bc4def8f9f54bc0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-10-21 19:31:27 +00:00
Venugopal Shivashankar
347e74cafa Doc: Enable qdoc warning count limit
This should restrict changes that
introduce new warnings.

Change-Id: I7e4b5d9d5d84b7c336509c380bc7e6d86e360f4a
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2021-10-21 19:10:52 +02:00
Alexandru Croitor
8d1db12bba Revert "CMake: Fix rpath-link dependencies when cross-compiling"
This reverts commit 87215c70c0.

Reason for revert: Breaks configuration of standalone tests in
leaf modules

Pick-to: 6.2
Fixes: QTBUG-97673
Task-number: QTBUG-86533
Change-Id: Idd5014b57a8d10070108f5b235c822863dbac088
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2021-10-21 16:21:51 +00:00
Volker Hilsheimer
d42cfeb84f macOS: add default Edit menu items, if not added by AppKit
AppKit automatically appends "Start Dictation..." and "Emoji & Symbols"
menu items, after a separator, to a menu in the menu bar that has the
title "Edit" in the operating system language.

Qt applications might however be translated to some other language, in
which case the "Edit" menu is not recognized by AppKit, and the menu
items won't be added. This is bad for accessibility and for users
wanting to type emojis.

If we have a menu that has the title "Edit" as translated in Qt's i18n
system, then create those items manually. To prevent a duplication of
the system- provided menu items, don't add the items if there already
is one with the action being set to the relevant selector. Otherwise,
perform the selector or call the NSApplication method ourselves. This
then results in the relevant keyboard input through regular code paths.

Fixes: QTBUG-79565
Change-Id: Ifd06036211756277550d398034689aca8e770133
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-10-21 16:05:47 +02:00
Michal Klocek
e2fc3246d2 Make QOffscreenX11PlatformNativeInterface a QX11Application
Make it possible to use new native interface QX11Application with
offscreen plugin in case of x11, which technically is
x11 application without xcb connection.

This change is motivated by use of new native interface
in webengine, where offscreen plugin is used for
some tests.

Pick-to: 6.2
Change-Id: Ic2ed5b39573062feaa1e8985962d5d9327b371d7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-10-21 13:39:53 +02:00
Assam Boudjelthia
54576b3dd9 Android: set allowNativeHeapPointerTagging to false in the manifest
Android 11 enables pointer tagging by default on arm64 systems [1],
which can cause QML to get invalid data, which caused the color
issue (and most likely other issues).

[1] https://source.android.com/devices/tech/debug/tagged-pointers

Fixes: QTBUG-97009
Task-number: QTBUG-91150
Change-Id: Ic4f145bba3345b3bee5445685f03269e3785f514
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 9fa805f7f8dfe96d561e9ed3170770ad768baf93)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-10-21 11:39:53 +00:00
Sona Kurazyan
49f34a402a Remove the unnecessary compile-time check for recursive QSet
It doesn't make sense to have a recursive QSet with deleted operator==,
since it's not possible to add elements to it. Consequently declaring a
metatype for it also doesn't make sense. Remove the commented
compile-time check for it.

Task-number: QTBUG-96257
Change-Id: I74ebefb38adcbe36d5c2f317188743e1f37fe16d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-10-21 12:58:05 +02:00
Timur Pocheptsov
4b282e0602 TLS plugin (OpenSSL): don't use the deprecated functions
If we have OPENSSL_NO_DEPRECATED_3_0 defined. This includes RSA, DSA,
EC and DH-related APIs. As of now, we only make sure the code still
compiles.

Pick-to: 6.2 5.15
Fixes: QTBUG-83733
Change-Id: Id455b851421ce0dcdfb0229fa515ba2b2ed690b1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-10-21 12:58:05 +02:00
Allan Sandfeld Jensen
4748369eb2 Fix inconsistencies between advanceWidth and bounding rects
Unify the logic in QTextEngine

Ensure tightBoundingRect, and the FreeType boundingRect, calculates from
the shaped x offset when calculating the max x coordinate for a glyph.

Fixes: QTBUG-7768
Task-number: QTBUG-70184
Task-number: QTBUG-85936
Task-number: QTBUG-94023
Change-Id: I6daafb25c79158dc7e777529abb5e8d3a284dac0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2021-10-21 12:37:22 +02:00
Bartlomiej Moskal
6dd6342864 androidtestrunner: make sure that system-user is used
It happens on Android Automotive emulator, that output file is in other
directory.

According android spec [1]:
"If a default user isn't specified, each adb subcommand has a different
user. The best practice is to retrieve the user ID with am
get-current-user and then explicitly use --user <userId> for any
command that supports it."

That is the reason why output file can be found in
/data/user/USER_ID/PACKAGE_NAME directory.

Checking path related to current user was added as backup solution.

[1]https://source.android.com/devices/tech/admin/multi-user-testing

Pick-to: 6.2
Change-Id: Id7e6ddef74f4f20b7469a07bba6a71d3622c4e20
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-21 08:23:22 +00:00
Thiago Macieira
aa82d295c8 Move the ABI tag from minimum-linux.S to qlibraryinfo.cpp
We don't need the assembly file any more. According to a comment to
patchsets 2 in the Gerrit code review for commit
bb8a61866e, the section ended up as
SHT_PROGBITS instead of SHT_NOTE. I didn't know then that the section
type is not actually important, only whether it's present in the segment
pointed by a PT_NOTE is. That isn't recorded in the review.

Since we now depend on the linker properly placing the .note.* sections
for Qt plugins, we can rely on this working.

Change-Id: Icb2516126f674e7b8bb3fffd16ad659149e34a23
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-10-21 00:55:48 -07:00
Thiago Macieira
7362b321e5 Doc: QByteArrayMatcher: add note that the pattern must remain on scope
This issue bit me. The API is surprising and very un-Qt-like...

Pick-to: 6.2
Change-Id: I2bbf422288924c198645fffd16aa1c58d921bd7e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-10-21 07:55:48 +00:00
Thiago Macieira
a0d66b60b7 QFactoryLoader: continue the port from JSON to CBOR
This continues the effort from the previous commit, by not passing
through the JSON conversion at all, and simply using CBOR directly.

The port in qtbase is complete, but in order to support the conversion
in other modules without introducing breakages, there's a temporary
class used for converting to QPluginParsedMetaData from
QJsonObject. It'll be removed once all other modules have finished
converting.

Change-Id: I2de1b4dfacd443148279fffd16a3ed4ddaf34afc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-10-20 22:04:03 -07:00
Thiago Macieira
2bea9b74ba QPlugin: keep the CBOR data as CBOR
Since QJsonValue and QCborValue use the same backend, we may as well use
the CBOR frontend classes, which means we avoid an unnecessary
conversion until later.

Change-Id: I2de1b4dfacd443148279fffd16a3e2f56cd74c0b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-10-20 22:04:01 -07:00
Alexey Edelev
3c493b89df Remove WIN32 and MACOSX_BUNDLE arguments when building Android binary
This fixes the regression introduced in Android multiabi changes.

Amends 0a02d84555

Task-number: QTBUG-88841
Change-Id: I09e129361eb760cdc14c2302e821ce4fcbf117c3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-10-20 21:18:38 +02:00
Tor Arne Vestbø
4ea32eaad0 macOS: Wake up event dispatcher after running modal dialog helpers
The root event loop may have been exited, so we need to ensure the
event dispatcher is woken up so it can evaluate whether it should
continue or not. For most applications this happens automatically
when e.g. the user moves their mouse or press a key, but for tests
this may not be the case, and the test will stall and never exit
its event loop.

Pick-to: 6.2
Change-Id: Ic241e3f1045481c34150289ff711b921addb18e4
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-10-20 21:17:08 +02:00
Tor Arne Vestbø
132ed5eb51 Centralize maybeLastWindowClosed checking in QWindow
Instead of plumbing QWidgetWindow close events via handleCloseEvent,
we just implement closeEvent directly. This allows QWindow do save
the state of the window/widget before the close event, so that we
know whether we should trigger lastWindowClosed handling, even if
the window was deleted as a result of the close event.

This also relieves QGuiApplication and QApplication from dealing
with the close logic in their notify functions, so that these
functions can focus on the propagation of events -- not how the
event is handled.

Change-Id: I8b586b53a53b1df1d8630c1acb635c60f191bb4b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-10-20 21:17:08 +02:00
Volker Hilsheimer
a3c8518268 Make QMainWindow::restoreStateSizeChanged test less time sensitive
Amends 32edae5e26, which introduced a
timeout after which the restored state is discarded. If this timeout
hits during a CI run, then the test is expected to
fail.

Implement a lambda that watches for the restored state to disappear.

This happens primarily when restoring a fullscreen state, where some
desktop environments scroll in a new virtual desktop. It should not
happen for other data tags.

Change-Id: I5ff43a4e1857eca17a5d4fe2b47add1f70636e8d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2021-10-20 18:05:15 +02:00
Mårten Nordheim
c58a3a4aae QDateTime: Limit string processing to known boundaries
We were treating the input as if it was always reasonably good.
Since we know the max boundaries anyway lets just stop processing
when those are reached

Fixes: QTBUG-97489
Change-Id: Ibb78d6d51ad58454b2007ab46d54116ca0be5448
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-10-20 15:16:53 +00:00
Mårten Nordheim
faa4cfcae9 SSL: Update documentation wrt backends
Mention the platform-specific backends and add a section on packaging

Pick-to: 6.2
Fixes: QTBUG-97532
Change-Id: Ice78e32e81a719ccf237625e542d620662d3073e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2021-10-20 15:16:53 +00:00
Mårten Nordheim
3c5c13c639 QNI: Windows: support transportMedium
Brings support for transportMedium to NetworkListManager
backend. Which, with this patch, also uses winrt API because
there is no equivalent API available in NLM.

This API is so much nicer than NLM...

Task-number: QTBUG-91023
Change-Id: I360a3a197caa2aa4848c8f768aea6a09a68b0ed5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2021-10-20 17:16:53 +02:00