Commit Graph

47338 Commits

Author SHA1 Message Date
Alexandru Croitor
b45533161e Android: Fix building apps when Qt is configured with one ABI
When configuring with Qt only with one ABI, certain code paths were
not triggered, which led to a few issues:
- The deployment json file generated by androiddeployqt listed
  no architectures.
- The compiled shared library did not have a lib prefix and arch suffix,
  which androiddeployqt during the deployment / make apk step.

To fix the architectures missing in the json file, ANDROID_ABIS needs
to be set in android/resolve_config.prf also in the single abi case.

To get the correct file names, android.prf needs to apply the prefixes
and suffixes not only in the build_pass case (multi-abi) but also in
the single abi case (except for config.tests).

The application-binary entry in the json file needs to be without the
extra prefixes and suffixes though, so make a copy of the TARGET value
to be used in the json file, before the name manipulations are
applied.

Pick-to: 5.15
Task-number: QTBUG-85399
Change-Id: Idde92ab7fe883636ccc65a87b91c8a3fc72eefbb
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-08-26 01:13:32 +02:00
Alexandru Croitor
d5dc0b6145 Android: Fix make check to work for single ABI Qt for Android builds
Task-number: QTBUG-85399
Change-Id: I049d430c0883a9bff43f7012b1274bbd48b25859
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-26 01:13:27 +02:00
Volker Hilsheimer
872e37b2ff Implement QAbstractFileIconProvider to use theme and mime databases
This doesn't give useful defaults on all platforms; icon themes are not
provided on platforms other than Linux, and the mime database doesn't
always return user-friendly names based on file names.

However, both icon themes and the mime database can be customized by
application developers by shipping a data file side-by-side with the
application, without the need for reimplementing the provider class.

Change-Id: Ie4b18ac1b861e2da64f01d1f209986b27fbe6bd5
Task-number: QTBUG-66177
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-26 01:13:19 +02:00
Steffen Kieß
2cb8568ab2 Properly free m_mtdev when mtdev_open() returns an error
Pick-to: 5.15
Change-Id: I57813da1eafe9fbc9d60b865e867558791e34528
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2020-08-26 01:12:59 +02:00
Andrei Golubev
afd34d74b8 Fix QPromise snippets: use QScopePointer instead of QPointer
Change-Id: I2b863e43eb227a80ded3422ca57bd5f5d4209858
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-08-26 01:12:50 +02:00
Volker Hilsheimer
967f2fbfad Fix warning from unused parameter
Change-Id: I2e31d43492f94edf4030fdbd88c1000396bdf250
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-26 01:12:39 +02:00
Alexandru Croitor
f3eb9aa257 Android: Fix currentThreadId to work on Android emulator
Apparently the Linux asm assumptions are not correct for the
x86 Android emulator and this caused Android apps not to work
properly: signal connections being queued instead of being direct,
crashes in QPropertyAnimation, etc.

Using currentThreadIdImpl on the Android emulator works fine though.
Optimizing the code for the Android emulator case can be done in
another change.

Amends 5e9b2ade67

Fixes: QTBUG-85640
Change-Id: I3b3ba76ea143aed949a6e50678c850b6ba231476
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-26 01:11:48 +02:00
Giuseppe D'Angelo
75cd9c13c2 QRegularExpression: code tidies
Given QList-is-QVector, remove an historical piece of code.

Change-Id: I7a8876be8ade6dbaa1822d773b092ddb3c4182d4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-26 01:09:14 +02:00
Giuseppe D'Angelo
049d8892ea QRegularExpression: do not assume QStringViews are NUL terminated
The convenience API used to look up the index of a named capturing
group expects NUL terminated strings. Therefore, we can't just
use it together with QStringViews, which may be not. Use the
non-convenience API instead.

Pick-to: 5.15
Change-Id: I25ca14de49b13ee1764525f8b19f2550c30c1afa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-25 23:09:09 +00:00
Lars Knoll
acbf9a858b Cleanup QTypeInfo
Remove QTypeInfo::isStatic, as that's not used anymore in Qt 6.
Also remove sizeOf, it's unused, and we have QMetaType for that if
required.
Remove all typeinfo declaractions for trivial types, as the default
template covers them correctly nowadays.

Finally set up a better default for isPointer, and do some smaller
cleanups all over the place.

Change-Id: I6758ed37dfc701feaaf0ff105cc95e32da9f9c33
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-26 01:03:22 +02:00
Kai Koehne
db21bad936 Port headersclean check to CMake
Configure Qt with -DQT_FEATURE_headersclean=ON to enable the
check. There will be separate target for each module include
(e.g. QtCore_header_check), but the check will also be done
when the module is built for the first time.

There are notable differences to the qmake version:
- the build does not pick up anymore default defines or flags from
  the module, or Qt. Instead options like -fPIC they have to be listed
  explicitly. Also for this reason, we have to skip the vulkan-related
  headers from the check, since vulkan/vulkan.h is not necessarily
  in the compiler's default search path.
- some checks for nowadays unsupported compiler versions are
  removed.
- -Wdouble-promotion -Wshorten-64-to-32 is not added for clang
  builds; the qmake code path did never enforce that on CI
  machines (it was non-Apple clang only), and the check currently
  fails on these configurations.

Fixes: QTBUG-82615
Change-Id: I1cd303677b1472116910b6c27748f96436feb35e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-25 21:13:08 +02:00
Assam Boudjelthia
24af3ebef3 Android: split arguments passed to the main app
Keep the same behavior as desktop platforms with
QApplication::arguments() should return a string list of args
not a string of args together.

Task-number: QTCREATORBUG-23712
Change-Id: I1874655427f5c902ca81a3fcf6183d0eeccbfef7
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-08-25 18:59:10 +03:00
Ulf Hermann
561e38f799 Port QSet to qsizetype
Change-Id: I70ad8fb6908ce3837a723e9a095bee5c166739e4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-25 17:59:10 +02:00
Volker Hilsheimer
869ab57c99 Document the QAbstractFileIconProvider::IconType enum
Follow language from the icon naming specification on freedesktop.org at

https://specifications.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html

Change-Id: I740842a39a9cd56152a799698a648ad6a6e274e5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-08-25 17:59:10 +02:00
Volker Hilsheimer
b77a3f47c9 Rename confusingly named QFont/QPalette::resolve overloads
Having three methods with the same name doing different things is
unnecessarily confusing, so follow the standard naming convention in
Qt and call the getter of the resolve mask resolveMask, and the setter
setResolveMask. These methods were all documented as internal.

The publicly documented resolve() method that merges two fonts and
palettes based on the respective masks remains as it is, even though
'merge' would perhaps be a better name.

Change-Id: If90b1ad800834baccd1dbc38fc6b861540d6df6e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-25 17:59:10 +02:00
Robert Loehning
c0d0949448 QLineF: Don't try calculating a unit vector when length is null
It's undefined and causes a division by zero.

Fixes: oss-fuzz-24561
Pick-to: 5.12 5.15
Change-Id: Idebaba4b286e3ab0ecb74825d203244958ce6aec
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-25 17:59:10 +02:00
Nie Cheng
e1d7df5ce9 Code style fix
Change-Id: I0174293421d866f3b124a9ff4344052749e8a1b9
Reviewed-by: Nie Cheng <niecheng@uniontech.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-08-25 23:59:10 +08:00
Topi Reinio
1ff82d1eba Doc: Improve documentation of ANDROID_EXTRA_PLUGINS qmake variable
Clarify that the variable must point to a directory with a specific
structure, and how the name mangling is applied to the deployed
plugins.

Pick-to: 5.15
Fixes: QTBUG-60022
Change-Id: I949cd73f65f86d4902eeab41fa7e5c6e6ffe44c3
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-08-25 07:25:24 +00:00
Fabian Kosmale
f325bac02e tst_qobject: Enable build with CMake
Change-Id: Ia2b324d0e5aa88ea9a71bb040a740f359e11f2ac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-25 09:13:46 +02:00
Mårten Nordheim
0871a7b5a2 tst_QNetworkDiskCache: fix setCookieHeader
It wouldn't grab the cached entry since it was not deemed
"fresh" (and would never be fresh because we didn't know when it
originated from or when it expired). But the test still passed because
the reply produced a "finished" signal which ended the loop, but the
"finished" signal was due to an error which was unchecked.

Change-Id: I6ad271aa621bdb4a48b74bc8fd64c7e2caa8f179
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-08-25 09:09:42 +02:00
Assam Boudjelthia
862ac16ab1 Android: add the option to set package signing information from env vars
Use the following env vars to help conceal private signing information:
- QT_ANDROID_KEYSTORE_PATH
- QT_ANDROID_KEYSTORE_ALIAS
- QT_ANDROID_KEYSTORE_STORE_PASS
- QT_ANDROID_KEYSTORE_KEY_PASS

[ChangeLog][Platform Specific Changes][Android] Added the option to
conceal package
signing information using environment variables.

Task-number: QTBUG-84922
Change-Id: I1fac51ed9e88ef42c761bc916ba1c3bf439806e8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-08-25 10:07:16 +03:00
Samuli Piippo
3a4153766e CMake: use definitions when testing EGL
Use any definition from pkgconfig for the EGL compilation test.

Change-Id: I95c659b87ab7b0de81f000e3f52195161a493ef5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-25 08:04:39 +03:00
Marcel Krems
fcc25b11bb QPrinterInfo: Remove deprecated methods
Change-Id: I5089bc23308a4348dc21122dfa000d5ca6e3938d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-25 06:48:28 +02:00
Marcel Krems
311d7a609c QTextLayout: Remove deprecated methods
Change-Id: I7991428fb3526e48c0ceda0dcc46ea8a0918cb95
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2020-08-25 06:48:03 +02:00
Shawn Rutledge
c7f7279969 Introduce QEvent::isPointerEvent()
This makes high-level event dispatching easier: for example in Qt Quick,
all pointer events should eventually be delivered to items in a similar way.

Implemented in a similar way as d1111632e2.

Change-Id: I2f0c4914bab228162f3b932dda8a88051ec2a4d7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-25 06:34:01 +02:00
Volker Hilsheimer
fb9ec8ad44 Move QFileSystemModel into QtGui
This requires a QAbstractFileIconProvider in QtGui, as the standard
QFileIconProvider depends on QStyle, and cannot be moved out of
QtWidgets.

QAbstractFileIconProvider returns strings for file types, but returns
no icons yet. Support for a default icon set might be added in a
follow-up commit.

Change-Id: Ib9d095cd612fdcf04db62f2e40709fcffe3dc2b7
Fixes: QTBUG-66177
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-25 06:33:44 +02:00
Volker Hilsheimer
e24bbc4871 Fix warning after QMetaType changes
Change-Id: Id0a8ac5cc516732e6bc03c4a7d153486003d0881
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-25 06:33:33 +02:00
Giuseppe D'Angelo
33218bac1b QStringList: inherit the constructors from QList
Otherwise it would be missing some, e.g. QStringList(qsizetype).

Change-Id: I5214672e62c98514b37b09d283e6035c799eda99
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-25 01:38:51 +02:00
Lorn Potter
aed0f34786 wasm: deregister event handlers
Pick-to: 5.15
Change-Id: I453b87497c7ed93b92bf9f4c59ab1c8bd1d7712e
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-08-25 06:50:55 +10:00
BogDan Vatra
86e90aa346 Be verbose
make apk takes a LOT of time, showing that it's not hanged it's useful.

Change-Id: I4fb11e0f535cf2311d71dff3710135b465ecc06b
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-08-24 21:10:25 +03:00
BogDan Vatra
b443775ee9 Add QML2_IMPORT_PATH import paths to qml-import-paths list
QML2_IMPORT_PATH it's usually set by CI to tell the QML apps where to
find the QML components

Change-Id: I57d1cbc3d0fce9be257648268da0a5f9d61d81e9
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-08-24 21:10:25 +03:00
Karsten Heimrich
a735038376 Move QStateMachine from QtCore to QtScxml
Task-number: QTBUG-80316
Change-Id: I2ee74110fd55e94d86321d3b3dc5bb8297424ed4
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2020-08-24 20:10:25 +02:00
Mårten Nordheim
43f01ec2e5 QByteDataBuffer: add readPointer functionality using QByteArrayView
While it could be done before it's nice to not have a custom "local"
struct or the size in an out-parameter.

Change-Id: Ie910f7060b1dadf037312d45e922f8e2deafe3ec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-24 17:44:08 +02:00
Mårten Nordheim
0011a45102 QAbstractSocket: Resolve remaining Qt6 TODOs
Change-Id: Id257f0721c1cd5fcbafa9297bae0251a2d68e366
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-08-24 17:43:56 +02:00
Mårten Nordheim
081207dc37 Make QNetworkAccessManager::supportedSchemes virtual
Change-Id: I6807e2133049551bbaa4c6f312b6a00ea752f81b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-08-24 17:43:50 +02:00
Mårten Nordheim
4573d29f64 QHostInfo: address a Qt 6 todo
Merged the two functions, required adding a friend declaration

Change-Id: I86265da19e4b5f53d9e2dc54de3e252f0364225b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-24 17:43:46 +02:00
Mårten Nordheim
467d215b32 Disable cipherstring-setting test for schannel
And put a note about it in the documentation

Change-Id: I29126e4a80f83c256190e03b8fe01f3c869fd46d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-08-24 17:43:39 +02:00
Mårten Nordheim
62d85389a4 http: When falling back to http/1 use the socket's ssl config
And not the ssl configuration we have on the reply since it's missing
e.g. the newly received session ticket.

Change-Id: Idfeb09012a847605a76d1fe4fb881c663d019b4a
Reviewed-by: Peter Hartmann <peter@edelhirsch.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-08-24 17:43:36 +02:00
Mårten Nordheim
a8ad1451bd QNetworkReply(http): Ignore ssl errors in all reserved channels
and not just the active one(s). When starting the connection with
HTTP/2 and calling QNetworkReply::ignoreSslErrors() it would previously
only ignore the errors in the single active channel that was used, but
if we then fall back to HTTP/1.1 then we'll use the 5 other channels as
well, and those would then fail due to the ignored ssl errors.

Change-Id: I7aeb5b59897dd3a53579f0d38bd255bc2d97c2bb
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-08-24 17:43:34 +02:00
Mårten Nordheim
5283be1f73 tst_qnetworkreply: Extend httpConnectionCount to test HTTP/2 and TLS
HTTP/2 is only used initially before it transitions to using HTTP/1.1,
and in this case the amount of connections established should also
reach 6.

Change-Id: I300e171e46c846df1730c07469ea85a51cecfb63
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-08-24 17:43:30 +02:00
BogDan Vatra
45b56d86bb Fix running qml tests on Android
First and foremost the condition was wrong ...
In order to help running qml test cases on Android without any android
specific hack on
user's .pro files we copy the entire project folder to assets. I copy the
entire folder
and not only the tst_*.qml files because it might contain data which is
needed by the tests to run.

Change-Id: I06323d9d52904317410dd2f440de65a0766a48b5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-08-24 14:50:56 +03:00
Alex Trotsenko
556a7e7318 QIODevicePrivate: rearrange class members
As this class is a subject of the library hook data, there must be a
solid understanding of the member's alignment and padding across
different architectures. By reordering the layout, this patch provides
a clearer way of adding new members to the class.

Bump the TypeInformationVersion field in qtHookData, to notify the
Qt Creator developers that the offset of QFilePrivate::fileName was
changed and dumpers should be adapted.

Change-Id: Ied8b69bdeb9da50ff05aba2107bc75509674b18e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-24 14:50:56 +03:00
Alex Trotsenko
b3310426b6 tst_QLocalSocket: fix wrong slot name
Suppress the warning:

QObject::connect: No such slot LocalSocket::slotError(QLocalSocket ...

Pick-to: 5.15
Change-Id: Ia08505ebc85d4070582c7ddaae8b581d394dbb80
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-08-24 14:50:56 +03:00
Andre Hartmann
6bd157c0f5 QLocale: Fix double conversion snippet
* QString("1234,56").toDouble(&ok); always operates
  in the "C" locale and therefore ok is always false
* Explicitly state that the return value is zero
  when ok is set to false
* Made snippet compileable by giving str a type

Pick-to: 5.15
Change-Id: I403eb39ca78a5f9ceb92ccd8ac3539581294796c
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-08-24 13:50:56 +02:00
Marcel Krems
41a716ebbf QSqlite: Don't crash after binding too many placeholders
When you bind more values than the query has placeholders,
indexes will be empty which causes an out-of-bounds access in indexes.first.

We can't check the parameter count because of multiple placeholders with the same name,
so we check if the name is null.

Tested with SQLite and PostgreSQL

Pick-to: 5.15
Change-Id: Id5d4bd15d7ed16603f47b87d6e0bf811a20157d8
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-08-24 13:50:55 +02:00
Giuseppe D'Angelo
fce9ec0543 Widgets: make indexOf take const QWidget *
As it's the right thing to do to preserve const correctness.

Fixes: QTBUG-85833
Change-Id: I0d45442c5e2b997998bba8dc894fee75da3e8e8c
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2020-08-24 13:50:55 +02:00
Shawn Rutledge
38806273e5 Remove QEventPoint::event() in favor of device()
event()->device() was the most common use case anyway.

The idea that the "parent" of a QEventPoint is the QPointerEvent
interferes with the ability to copy and move event objects: the parent
pointers are dangling unless we use the QPointerEvent subclass
destructors to set the points' parents to null.  Since there is no move
constructor, even returning a QEventPoint from a function by value
results in destroying the temporary instance and copying it to the
caller's space.  So the parent pointer is often useless, unless we do
even more work to maintain it when the event moves.

If we optimize to avoid copying QEventPoints too much (and perhaps
enable exposing _mutable_ points to QML) by storing reusable instances in
QPointingDevice (which is the current plan), then the actual parent will
no longer be the event.  Events are usually stack-allocated, thus
temporary and intended to be movable.

Change-Id: I24b648dcc046fc79d2401c781f1fda6cb00f47b0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-24 13:50:55 +02:00
Mitch Curtis
0c52e600b3 Doc: provide a code example of QDirIterator's nameFilters parameter
Change-Id: I56f9251f17bab0f835979a5feadec1fa896c9d69
Pick-to: 5.15
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2020-08-24 13:50:55 +02:00
Ulf Hermann
7127bf1d04 Rename QSequentialIterable::ref
Follow the naming convention and remove workarounds in ctors.

Change-Id: Ic7f9de074edab7db369803612a2a2a4ea3deaf57
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-24 09:37:42 +02:00
Ulf Hermann
3fdc08b422 Remove private QSequentialIterable begin/end methods
Those are only used by the only friend of the class. As that one can
already poke into QSequentialIteralble's privates, there is no point
in exposing further methods in the public API.

Change-Id: I368e7bcfc43c31f38a42a41a339ff3135d79417c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-24 09:37:36 +02:00