Commit Graph

46329 Commits

Author SHA1 Message Date
Alexandru Croitor
554d40da58 CMake: Skip building tst_qprocess test when cross compiling
tst_qprocess hangs on the qemu armv7 configuration.

Task-number: QTBUG-85287
Change-Id: I5a77a81a24bb1bd315edfcf14f3bcbfd5b925e4d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-26 14:54:32 +02:00
Friedemann Kleint
7789c0dc86 SSL configure test: Fix confusing warning
Remove quote character, fixing:

Performing C++ SOURCE FILE Test HAVE_openssl_headers succeeded with the following output:
Run Build Command(s)
src.cxx 8 88: warning: missing terminating ' character
    8 | #  error OpenSSL was reported as >= 1.1.1 but is missing required features, possibly it's libressl which is unsupported

which makes one think the test failed.

Change-Id: I0ac02deee4282ef7c953186b820a31309e82b5e1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-06-26 14:49:08 +02:00
Laszlo Agocs
d8bf71026c Fix up QVulkanWindow docs
Pick-to: 5.15
Change-Id: I5a37a57245b8d859adf02810d3954e7532e4a475
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-06-26 14:42:47 +02:00
Jarek Kobus
0e6f6507d5 Use QList instead of QVector in network
Task-number: QTBUG-84469
Change-Id: I7827da68e73ca8ff1e599c836f2157894c452b63
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-06-26 14:42:43 +02:00
Laszlo Agocs
db61e43c81 rhi: Enable specifying just an adapter or phys dev
Required by OpenXR. A VkPhysicalDevice or an adapter LUID + feature
level pair should be adoptable while leaving the rest (device, queue,
etc. setup) to QRhi as normal.

Change-Id: Iada0972671b037b4efb03e7831b7c9b8c5f2393d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-06-26 14:42:42 +02:00
Laszlo Agocs
b60f516aca Fix qsizetype fallout in rhi manual tests
Change-Id: I574a2930b5eeb4b3e1f3c6fca6d70dbda64ec324
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-06-26 14:42:36 +02:00
Assam Boudjelthia
6f837d6f07 Android: fix QDesktopServices::openUrl() error for file scheme path
If the url is a "file:" scheme url don't check for permissions
which the file won't have, and then disable StrictMode for API >= 24
to be able to pass the "file:" path to the openUrl intent.

Pick-to: 5.15
Fixes: QTBUG-67877
Change-Id: Ia3fecc24a67069dc76f866455277bf8b929e7697
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-06-26 12:41:42 +00:00
Tor Arne Vestbø
c644dc9700 cmake: Match tense of other log output
Change-Id: Ied164c97bd54f6b37450d7a2cf8225ee5190ce17
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-26 14:41:42 +02:00
Lars Knoll
e81330d327 Add explicit encode()/decode() methods to QStringConverter
The functional style interface is nice, but does feel alien in some
contexts, so better also have explicit encode and decode methods.

Change-Id: Ic07ced15f65cdb3a7f1cf044041e341d2ef87f79
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-06-26 14:41:42 +02:00
Robert Loehning
873c099788 Fuzzing: Add fuzz target for QCryptographicHash::result
Pick-to: 5.15
Change-Id: Ifc12358dd8cb932fe62c13975554d753a4f1afd9
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-26 14:41:42 +02:00
Giuseppe D'Angelo
d4bce57340 Unexport QModelIndex
It is entirely inline.

Change-Id: I626d6e4f6338dabfcc1e34127c898ed13c5a513b
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2020-06-26 14:41:41 +02:00
Tor Arne Vestbø
28f6892717 macOS: Check that platform window is valid after delivering close event
Fixes: QTBUG-78814
Pick-to: 5.15
Change-Id: I551024c5d777999f7c79d21fd7b7de061c18f971
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-06-26 14:41:41 +02:00
Thiago Macieira
e7d76d79e8 QThread: Fix unnecessary stricter accesses to QThreadData::thread
Commit ec6556a2b9 changed the member from
a plain pointer to a QAtomicPointer. Not all accesses were caught.

Pick-to: 5.15
Change-Id: I3d4f433ff6e94fd390a9fffd161b4ff25508c48d
Reviewed-by: David Faure <david.faure@kdab.com>
2020-06-25 18:03:34 -07:00
Jarek Kobus
48c8322a61 Use QList instead of QVector in dbus
Omitted type replacement in qDBusParametersForMethod() for now.

Task-number: QTBUG-84469
Change-Id: Ieb9fbb30b431c5e4183ad57acd35640e9556bf6c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 22:31:13 +02:00
Jarek Kobus
0475460102 Use QList instead of QVector in corelib
Applied to headers only. Source file to be changed separately.
Omitted statemachine for now to avoid conflicts.
Omitted qmetatype.h for now - to be handled later.

Task-number: QTBUG-84469
Change-Id: I317376037a62467c313467d92955ad0b7473aa97
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-06-25 22:30:59 +02:00
Jarek Kobus
e114e580e7 Use QList instead of QVector in other tools
Task-number: QTBUG-84469
Change-Id: I90d0e2e723bb4d205d7bf333b21cdf583fdf4ea0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 22:30:54 +02:00
Jarek Kobus
5bb3d64682 Use QList instead of QVector in testlib
Task-number: QTBUG-84469
Change-Id: Icbc3c3130399296f6b5a7e9a313ad4737669de00
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 22:30:54 +02:00
Alexandru Croitor
d8f814cdb7 CMake: Add instructions for building and testing qemu configs
Before this change, tests were never built for cross-compiling
configurations.

Add instructions that build and run tests for qemu configurations.
This required a bit of abstraction / indirection to find out what's
the path to the correct qt-cmake call, as well as prepending the
correct env prefix to each call (either the host one or the target
one).

Also, the QEMU configuration requires a few environment variables
to pick up the correct runtime linker and which qpa plugin to use
for running tests.

Finally, make sure the tests are not built and run if the DisableTests
feature is set in the configuration.

Task-number: QTBUG-84423
Change-Id: I0cec28c801a657e67cfa48f3c61cfe487109946b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-25 14:11:56 +02:00
Fabian Kosmale
844e4f7b98 moc: Fix QProperty code generation
This addresses two issues:
1. The generated code for QNotifiedProperty<T, ...> was broken when T is
   a pointer. Notably, const S* &  is not a constant reference to S*.
   This is addressed by consistently using T const& instead of const T&.
2. The Q_PRIVATE_QPROPERTY approach assumed that the property name and
   the getter are equal. This does break when they are not, and we are
   unable to change either of them due to API compatibility concerns. An
   example of this would be QQuickItem's parent property with a
   parentItem getter. Therefore, we now allow the usage of NAME to
   override the name of the property.

Change-Id: Idf2e85576c74371b5b0f6db15dbe6f2d17c5e33d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-25 14:11:56 +02:00
Simon Hausmann
b20c7df63a Remove QPropertyMemberChangeHandler again
Adding support for a static notifier within QProperty itself - through a
QProperty "sister" class - is more efficient in terms of memory
consumption and run-time performance.

The MemberChangeHandler permanently takes up at least three pointers,
while the notified properties only cost one pointer in the binding.

Change-Id: Ia1a8c2b66f1f3c2fe13ae0ad9f12cdb6bdcc35ef
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-25 14:11:56 +02:00
Fabian Kosmale
e18a060c03 QNotifiedProperty: Add guard callback
A guard callback is a predicate which takes the new value set by
setValue or computed as the result of a binding expression. If it
returns false, the value is discarded and the old value is kept.
Note that due to lazyness, when setting a binding, we still notify
everyone as the binding is only evaluated on demand, and the guard can
thus only run when someone actually queries the value.
Note further that a guard is allowed to modify the value that is passed
to it (e.g. to clamp it to a certain range).

Task-number: QTBUG-85032
Change-Id: I3551e4357fe5780fb75da80bf8be208ec152dc2a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-25 14:11:56 +02:00
Fabian Kosmale
6a24ac7c4e QNotifiedProperty: pass old value to callback if requested
Check at compile time whether the static callback takes an argument
(which has to be of the same time as the type of the property). If so,
retrieve the old value and pass it to the callback.

Change-Id: Ib1c4c9e05b826b6be492b03f66fa72ad015963ee
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-06-25 14:11:56 +02:00
Fabian Kosmale
c2fb27f054 Fix QProperty
This fixes two issues with QPropery:
1. QPropertyBindingPrivate::evaluateIfDirtyAndReturnTrueIfValueChanged
   calls a user provided evaluaton function. That one might actually
   destroy the binding and delete the QPropertyBindingPrivate instance.
   We need however to keep it alive until the function returns.
2. There was an infinite loop between QPropertyObserverPointer::notify
   and QPropertyBindingPrivate::markDirtyAndNotifyObservers. This can be
   observed when running tst_palette in qqc2. By returning early in
   markDirtyAndNotifyObservers if dirty is already set, the issue is
   avoided.

Change-Id: I1f0df05a5a9fa98554183263a25e16747c4d2274
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
2020-06-25 14:11:56 +02:00
Paul Wicking
41ceb88fe1 Doc: Change docs from internal to reimp
Pick-to: 5.15
Fixes: QTBUG-82357
Change-Id: I415ee03dd9d1ac02a435a24fb5ab94bf60c07331
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-25 11:00:47 +02:00
Tor Arne Vestbø
6d376ea5f4 cmake: Apply symbol visibility settings to Objective-C/C++ sources
Otherwise the Objective-C++ sources will be built with the default
compiler visibility (visible), and then linked with moc-generated
C++ sources that have the Qt overridden hidden visibility, resulting
in linker warnings such as:

  ld: warning: direct access in function 'X' from file 'moc_foo.cpp.o'
  to global weak symbol 'Y' from file 'bar.mm.o' means the weak symbol
  cannot be overridden at runtime. This was likely caused by different
  translation units being compiled with different visibility setting

Change-Id: I22e15e7e181a74de8c0a22c73d06e600e582d7fd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-25 10:45:34 +02:00
Allan Sandfeld Jensen
a418fd5cbb Improve casting
Make a handful of narrowing casts explicit

Change-Id: I318e9778840f2437963377b6b97f269d569909dc
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-06-25 10:19:09 +02:00
Jarek Kobus
e721ec269e Use QList instead of QVector in other tests
Task-number: QTBUG-84469
Change-Id: I656c9f73bd2364be39ee67747524e7c4a25c0935
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 10:14:24 +02:00
Laszlo Agocs
b62f32a4dd Make qdoc generate usable docs for QVulkanInstance
It is not just that the unknown native types (e.g. VkInstance) lead to
showing the type as 'int' in some functions, the bigger problem was that
a number of functions were not present in the generated documentation at
all.

Pick-to: 5.15
Change-Id: Id71fe20c3a70a8d3b75bbc693a2a7ee94bb74642
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-06-25 10:14:16 +02:00
Jarek Kobus
88cfcd7f3f Use QList instead of QVector in sql tests
Task-number: QTBUG-84469
Change-Id: Id429ce85da027541b53d516045a78b739c2e9745
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 10:14:15 +02:00
Jarek Kobus
fe5b04346c Use QList instead of QVector in testlib tests
Task-number: QTBUG-84469
Change-Id: I36a69021c8d3491a4fd622f3ecb218e1be8a77bc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 10:13:58 +02:00
Jarek Kobus
5accfa1e68 Use QList instead of QVector in widgets tests
Task-number: QTBUG-84469
Change-Id: I490fdb237afad2d8a15954fe34d6b549a83fa4aa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 10:13:43 +02:00
Jarek Kobus
74dc89de3e Use QList instead of QVector in benchmarks tests
Task-number: QTBUG-84469
Change-Id: Id61d6036067da0bcd0811b1b97df5f1334007b7e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 10:13:31 +02:00
Jarek Kobus
d1612610e6 Use QList instead of QVector in gui tests
Task-number: QTBUG-84469
Change-Id: Ia86f39597de418dde6cd9ae3170ef919bd27416a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 10:13:12 +02:00
Paul Wicking
8cd3ec4ee4 Doc: Fix typo
Add missing quote in text.

Pick-to: 5.15
Change-Id: If3a3d28f50057040c5aff90c70803b85c8a475a9
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-06-25 09:56:46 +02:00
Sona Kurazyan
d7ccd8cb45 Remove QByteArray's methods taking QString and their uses
[ChangeLog][QtCore][QByteArray] Remove method overloads taking
QString as argument, all of which were equivalent to passing the
toUtf8() of the string instead.

Change-Id: I9251733a9b3711153b2faddbbc907672a7cba190
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 09:54:16 +02:00
Joerg Bornemann
2df4991cb1 CMake: Fix qmake mixing with static build and system_xcb_input
The .prl generation uses a very simple generator expression evaluator
that cannot cope with the $<TARGET_EXISTS> expression used in
src/plugins/platforms/xcb/CMakeLists.txt.

Replace this genex with a conditional qt_extend_target call.

Change-Id: Id17a230d66f701eb0938d10d6b6b7b680290b1c8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-25 09:23:14 +02:00
Alexandru Croitor
a0bd8c7893 CMake: Fix pcre2 compilation with intelcet part 2
I somehow forgot that we build the pcre2 sources not only as part of
the bootstrap library and qmake, but also as separate library as well.

Apply the flags to the bundled library.

Amends 976fa5134a
Amends fa98adbd04

Change-Id: Ia1db3a8bd731c7e3ee4d7109be8e2ef98c594070
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-25 09:07:51 +02:00
Alexandru Croitor
3cd614644a CMake: Place framework .prl files under Resources
Adapts to qmake's 74abe98320 change

Change-Id: If1d6ce063d53dda4835a224661a16219cf9a9476
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-25 09:07:39 +02:00
Allan Sandfeld Jensen
177c0ef204 Avoid converting supersized QRectF to QRect
Check that the sizes are even representable when checking if clipping is
necessary.

Fixes oss-fuzz 23630

Pick-to: 5.15 5.12
Change-Id: I95d6873d28b0e4f47aae7666f7ee96b745dc997b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-06-25 08:46:04 +02:00
Jarek Kobus
d13b6bd496 Use QList instead of QVector in network tests
Task-number: QTBUG-84469
Change-Id: Ic96dc8d29b5d720810ca636284f5fd37e4307acd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 07:54:44 +02:00
Jarek Kobus
273fcd0c05 Use QList instead of QVector in dbus tests
Task-number: QTBUG-84469
Change-Id: I37d169770f188837118b4e33aa3a3894bf7aed2c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 07:54:33 +02:00
Jarek Kobus
64c3ca0910 Use QList instead of QVector in sql
Task-number: QTBUG-84469
Change-Id: I942aec7d949331a52d7f12fa2725d8d9707f605f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 07:54:21 +02:00
Andy Shaw
33c24b9b9d Android: Don't pause when in multi window mode
When the application is in multi window mode then when pausing it should
not suspend the application as it can still be visible in the
background.

Change-Id: I03a561459b2aa04c808b7d4220cd3e558671dd17
Pick-to: 5.15
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-06-25 07:32:04 +02:00
Volker Hilsheimer
66c9033f7d Fix compile warnings when passing short ints into printf formatting
Use %hd instead of %d.

Change-Id: I0062a507140d70263770cd7fe923efe94822d00e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-06-25 06:20:32 +02:00
Lars Knoll
95e84c0ea9 Allow qMin, qMax and qBound for types that can be losslessly converted
Add overloads for qMin and friends where the arguments are of different
type, but one can be easily promoted to the other. Return the promoted
type. Promotions are only allowed if both types are either signed,
unsigned or floating point numbers.

This should simplify writing code in many case (as for example
qMin(myint64, 1)) and also help reduce source incompatibilities between
Qt 5 and Qt 6, where the return types for sizes of our containers changes
from int to qsizetype.

Change-Id: Ia6bcf16bef0469ea568063e7c32f532da610d1cd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-25 06:20:18 +02:00
Volker Hilsheimer
0dbd2dd863 Skip proxy widgets that can't take focus when (back)tabbing
Fixes regression introduced in b4981f9d4c,
due to which it was possible to back-tab into a widget even though it or
its focusProxy had a NoFocus policy.

As a drive-by, split the complicated if-statement up a bit for improved
readability.

Change-Id: Ib0ac2604076e812e340b11534c23ae8ae958d082
Fixes: QTBUG-76924
Pick-to: 5.15 5.12
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-06-25 06:20:03 +02:00
Volker Hilsheimer
75638e258f Don't pollute global namespace with #define P
Breaks the build if any global header has

using P = SomeType;

statement, and unnecessary to do so before the headers are included.

Change-Id: I3b8cc705bf662f768b8895e4b3ec1428ab39ef27
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-25 06:19:50 +02:00
Mike Achtelik
907027ab80 QMetaObject: Compare threadIds when checking receiver thread
Comparing threadIds is faster, especially if invoked from a non qt thread,
where QThread::currentThread() needs to create a QAdoptedThread/QThreadData first.

Pick-to: 5.15
Change-Id: I44b3013283754f1a5ac9d62debcf4c82be77c554
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-25 06:11:57 +02:00
Thiago Macieira
cb1c66bd20 Fix conversion of QVariant() in QJsonArrays and Objects (through CBOR)
When I wrote the QCborValue to QJsonValue conversion, I used
QJsonValue::Undefined because it allowed to keep some level of
compatibility in CBOR, despite the function documentation saying that
CBOR undefineds became JSON nulls. Which they did.

But when we converted QJson{Array,Object} to be backed by CBOR classes,
that Undefined meant the insertion into the array/object actually
deleted the entry.

[ChangeLog][JSON] Fixed a regression from 5.14 that caused values of
default-constructed QVariants in QVariantLists, QVariantMaps and
QVariantHashes to disappear when converting to JSON via
fromVariant{,List,Map,Hash}.

Fixes: QTBUG-84610
Pick-to: 5.15
Change-Id: Ic0987177fe463f352db9bd84993f116e2bdacc75
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-24 22:43:57 +02:00
Ulf Hermann
bdc2493096 QPointingDevice: Parent the default mouse to QCoreApplication
Otherwise it will leak.

Change-Id: I1c522dace0139dac3e626399963f58c56f052aba
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-06-24 22:42:36 +02:00