Commit Graph

47320 Commits

Author SHA1 Message Date
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
Eskil Abrahamsen Blomfeldt
f70b955ce8 Remove the QPF2 font engine
The QPF2 font engine has been kept around for compatibility
reasons in Qt 5.x, and it is time for it to retire for now. If
we want something like this in the future, we can revive it with
hardware acceleration / Qt Quick as one of the primary use cases,
but for now, it seems that Freetype and our existing caching is
sufficient also for low-end use cases.

[ChangeLog][QtGui][Text] Removed support for the legacy QPF2 font
format as well as the makeqpf tool used to generate those files.

Change-Id: Id43039c92fe5bd95b628cd769e045c029f39a350
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-24 07:08:45 +02:00
Lars Knoll
75097c7782 Make the canConvertMetaObject method safe
This triggered a crash in QtQml, where an manually created
metattype interface set the PointerToQObject flag to true while
not providing a metaobject.

Change-Id: I206fb9655058a1e8a2d04e44186b05db33358338
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-24 00:19:48 +02:00
Lars Knoll
02dfec9209 Remove QVariant(QDataStream) constructor
The constructor wasn't constructing a QVariant holding a
QDataStream, bug loading the variant from the datastream.

This is opposed to how QDataStream works in all other places,
and also not in line with all other constructors for QVariant.

[ChangeLog][QtCore][QVariant] Removed the QVariant(QDataStream)
constructor. Use QVariant().load(datastream) instead.

Change-Id: I6ac54e12166b9383c09c3940eef2516f896fd359
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-24 00:19:42 +02:00
Lars Knoll
0161f00e50 Use QMetaType in QMetaCallEvent
And don't use int based type mapping anymore.

Change-Id: I456e76d1933ef646a7bd39ce565886b89e938a44
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-24 00:19:36 +02:00
Lars Knoll
700e6341e5 Pass QMetaType by value
Now that QMetaType is not refcounted anymore, we can and should
pass it by value.

Change-Id: I848db65070713762f548ca949097c27783aacad4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-24 00:19:30 +02:00
Lars Knoll
369cb1470d Clean up int based convert() API
Pass QMetaType instances instead.

Change-Id: I07366cea566fdebf5bb793aa8087f8109216ec0c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-24 00:19:24 +02:00
Lars Knoll
e7e7540aec Deprecate int based convert/canConvert
Better to provide the correct meta type to convert to.

Change-Id: I8e0d46e4ba482186201c157e302c03874bd38e7b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-24 00:19:18 +02:00
Lars Knoll
92a31781bb Return a qsizetype from QMetaType::sizeOf()/alignOf()
Object sizes in Qt 6 should use qsizetype.

Change-Id: I76ceb5faf361d7f6be88d88c772358ad6d701d54
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-24 00:19:11 +02:00
Lars Knoll
1697fbdf05 Deprecate the static int based API in QMetaType
And remove one of the type id to name mapping that still
existed in QMetaType. QMetaTypeInterface can provide that,
so there's no need to have a second copy of the data.

qMetaTypeTypeInternal() can still map all the names of all
builtin types to ids. That functionality is for now still
required by moc and can't be removed yet.

Change-Id: Ib4f8e9c71e1e7d99d52da9e44477c9a1f1805e57
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-24 00:19:05 +02:00
Lars Knoll
92b3767632 Remove refcounting of QMetaTypeInterface
It's only used for dynamic types in DBUS and QML, where we control
things good enough to be able to handle the lifetime of those
interfaces there.

Change-Id: Ia7f8970d17a85b195db85fcdc2d8f1febd8753f4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-24 00:18:58 +02:00
Lars Knoll
d0ccb3aaf9 Cleanup the qRegisterMetaType function
Remove the arguments that are nowadays unused.

Change-Id: I97ed983b158aba57653f35e7e2f91f5c79dace8c
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2020-08-24 00:18:52 +02:00
Lars Knoll
9c501b0670 Remove an unused enum value and document another one
Change-Id: If9fed4f20242d789c1251b8798d7378d2d6911a6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-24 00:18:45 +02:00
Lars Knoll
13c1e3f434 Cleanup qvariant_cast<>
Move the last functionality it had (casting between QObject
derived types) over to QMetaType. Now qvariant_cast<> is
nothing but a wrapper around QMetaType::convert().

Change-Id: Iab02b6b97c141d64052823646e18227d1eb403dd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-24 00:18:37 +02:00
Lars Knoll
c7ce1bc05c Move conversions to and from *Iterables into QMetaType
Those were not yet supported by QMetaType.

Change-Id: I9f85476049f200e35939ac58ef7e8b4e7cbe0b77
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-24 00:18:31 +02:00
Lars Knoll
9d36032370 Implement QMetaType::canConvert() and use it in QVariant
Use the fact that we return the conversion function as a lambda
to find out reliably whether a conversion between two types
can be done.

This requires some minor adjustments to our tests:

* Nothing can convert to an unknown type and vice versa
* Adjust results to the fact that we don't convert from char
  to QString anymore (where the old method was incorrect)
* QStringList->QString requires some adjustments, as we only
  convert if the string list has exactly one element. For now
  we return true in canConvert(), but the conversion behavior
  in this case is something we should rethink, as it is very
  surprising.

Change-Id: I3f5f87ee9cb99d690f5a7d13b13d6a6313d8038e
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2020-08-24 00:18:24 +02:00
Lars Knoll
2d3b31171d Get rid of the old QVariant conversion codepath
All conversions do now happen through QMetaType::convert().

Change-Id: I70f7a883262087768acccf8361d34c0490ff2b43
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-24 00:18:17 +02:00
Lars Knoll
53047c3623 Move QJsonValue and QCborValue conversions to QMetaType
Change-Id: Id4796e0913c0c5b0abce0ea27bed0f7b41bc0cca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-24 00:18:10 +02:00
Lars Knoll
b69a1d8eed Remove some unused code
Change-Id: I184c0e00562b9cc61e628457629633f8157333ad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-24 00:18:04 +02:00