Commit Graph

45502 Commits

Author SHA1 Message Date
Tor Arne Vestbø
4618fa6f8d Fix pro2cmake help text
Change-Id: I84980dda981c50da159e4bb81b08190b882d6978
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-30 14:20:26 +02:00
Tor Arne Vestbø
3452874727 macOS: Remove copy of QT_IGNORE_DEPRECATIONS
It lives in qcompilerdetection.h now.

Change-Id: I7eb227b2a66997a7fd9e439a6dd21f398820f012
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-30 14:20:26 +02:00
Tor Arne Vestbø
c9d9ac5bb0 Don't reference build directory in helper lib pri
Otherwise the helper-lib pri file will be unusable when installed.

Change-Id: Id79a61e6ca9bb1b32c82ee158fd18f51319c484e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-04-30 12:20:26 +00:00
Mårten Nordheim
90012f12b0 QNAM: Don't check if a session is needed for a cache lookup
QNetworkAccessCacheBackend didn't override the virtual start() function
which then deferred to QNetworkAccessBackend::start() which conditions
its success on whether or not a network session is available.

Override the function and reimplement it without the network session
check.

Fixes: QTBUG-83205
Change-Id: I45d98a6f5da8ad04bb9da551a131f109e83074d7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-04-30 13:55:03 +02:00
Mårten Nordheim
8e4c32857d QAuthenticator: make sure we load the SSPI library
Change-Id: Iac371065dfc20ad5920889be66c8282a45c5805e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-04-30 13:45:55 +02:00
Edward Welbourne
c78a960198 QCOMPARE: treat values as equal if qFuzzyIsNull(each)
We hope this shall avoid some flaky failures noticed in quick tests,
e.g. tst_QQuickMenu::Material::subMenuPosition(cascading,flip) was
recently seen failing with 3.88e-11 != 0. This required some revision
to test data in the testlib selftest for floats; the resulting
expected output differs in details but not in which tests pass or
fail. QEMU, naturally, made life difficult, requiring special-case
code in the test-driver.

[ChangeLog][QtTestLib][QCOMPARE] QCOMPARE() now treats its values as
equal when qFuzzyIsNull() is true for both of them.

Change-Id: Icc6ad5164b609937eddbe39cc69120f0abf0f3b4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-04-30 13:44:08 +02:00
Thiago Macieira
821e71fded QCborValue: check parsing of invalid URL
QUrl will reject invalid URLs for us, so we don't get normalization. The
original junk should be retrievable, of course.

Change-Id: Ibdc95e9af7bd456a94ecfffd160610f5b2c8e1a2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-04-30 08:01:28 -03:00
Thiago Macieira
8366c06d46 QCborValue: add tests of parsing invalid ISO date-time strings
We rely on QDateTime::fromString being proper, so this is not extensive
testing.

Change-Id: Ibdc95e9af7bd456a94ecfffd160610cdac5d62e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-04-30 04:01:05 -07:00
Thiago Macieira
2a53017df4 QCborValue: add an extra check against producing invalid ISO dates
By QCborValue design, we store the textual representation in ISO format,
equivalent of CBOR tag 0, which isn't allowed to have negative years or
beyond year 10000.

Change-Id: Ibdc95e9af7bd456a94ecfffd16060ccff359c296
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-04-30 04:00:47 -07:00
Thiago Macieira
52a2505672 QCborValue: avoid signed integer oveflows when decoding time_t
QDateTime::fromSecsSinceEpoch() multiplies by 1000 but does not check
for overflow. That means we must do so in QCborValue validation. We
can't use mul_overflow<qint64> on 32-bit platforms, so we do a compare-
and-branch there. For 64-bit platforms, we prefer to do the
multiplication with checked overflow, as the common case is that it will
not overflow and we'll need the multiplication anyway.

Change-Id: Ibdc95e9af7bd456a94ecfffd16060cba6f1c86b8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-04-30 11:00:29 +00:00
Andy Shaw
1eeabc6652 Don't output a warning that can trigger before Qt has fully initialized
If a warning is outputted before Qt has had a chance to initialize the
logging rules then it will cause it to hang as it will be stuck trying
to initialize but can't continue because it needs to output the warning
which triggered during that initialization. Therefore the warning should
not be outputted to avoid this from happening.

Change-Id: I202752c377bf69def2f7fb76be71b78d00ad3fd5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-30 10:59:56 +00:00
Tor Arne Vestbø
91d18c6464 iOS: Pick up theme palette from system colors
For now we just fill out the system palette, and react to the system
changing theme from dark to light. A further improvement would be to
fill in the control-specific palettes.

Change-Id: I764db4415f5b55ccb193dae43e9f4386c765b30b
Fixes: QTBUG-42944
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-04-30 12:21:30 +02:00
Shawn Rutledge
f9d219b926 iOS: Teach edit menu popover to have a readonly mode
We should have foreseen the need for customizing this menu in 2014 when
Controls 1 needed it, but here we are: Qt 5 is "done", this still wasn't
done, and it's too late for new enum values in 5.15. So the workaround is
to add a property on the focus object that the iOS plugin can query, and
give us a menu that has Copy instead of Paste.

Task-number: QTBUG-83811
Change-Id: Id8d18260002952fe7aa77aa5608cf7d0e440dacb
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-04-30 12:21:30 +02:00
Venugopal Shivashankar
f3bfee0cb6 CMake: Fix the setup for html_docs and qch_docs
Traditionally, these make targets generated HTMLs
and QCH only. This change fixes the dependency for
these targets to ensure that behavior.

Fixes: QTBUG-83877
Change-Id: Ic7c8afe5853d33fc4cc4cfd996f87e5f65df31ed
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-04-30 08:15:36 +00:00
Volker Hilsheimer
c6c84c8855 Initialize data members of QJsonParseError
Instantiated objects are typically passed as an out-parameter to
QJsonDocument::fromJson, but that might only happen conditionally (as in
the jsonconverter example).

Change-Id: I8d4719958b79b656070f085c58559bd97ac4bda2
Fixes: QTBUG-83880
Coverity-Id: 263796
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-30 10:15:08 +02:00
Fabian Kosmale
14c713e759 pro2cmake: convert QMLTYPES_FILENAME to QT_QMLTYPES_FILENAME
Change-Id: I9afc6d4c0c9b3fd87ef28f15da0a984d778b83ac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-30 10:13:56 +02:00
Laszlo Agocs
1af7fb5ed8 rhi: Warn better in D3D/Vulkan for incompatible multisample resolve formats
Attempting to resolve a multisample image into a non-multisample one
is only valid when the formats are the same, as per Vulkan spec and D3D
docs.

With Vulkan, this is sometimes not fatal, some implementations can
apparently deal with some format combinations, so the problem may not be
trivial to catch, although with validation layer enabled a warning is
shown at least. To make it easier to discover, have our own warning.

Task-number: QTBUG-83707
Change-Id: I8fc87471de91cd65a445fbe8cedbf31a8295db53
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-04-30 10:13:40 +02:00
Alexandru Croitor
8ddd3ee60b Revert "CMake: qt_find_package() enable debug behavior by default"
It broke configuration of qtwayland standalone tests, due to qtwayland
doing 3 separate qt_find_package(Wayland) calls with the same package
but different arguments in 3 different directory scopes.

The top scope didn't have PROVIDED_TARGETS argument. The rest of the
scopes did have the arguments with either Server or Client, but because
of the debug behavior above being enabled by default the dependencies
weren't registered in the Qt6WaylandClientDependencies.cmake file (and
the server equivalent).

The registration didn't happen due to the skipping logic, when a package
is found and the targets already exist.

This led to standalone tests failing to configure because they tried
linking against non-existent Wayland::Client and Wayland::Server
targets.

This reverts commit dd7e40b108.

Change-Id: I60e358a4891b84ecec0e127d9de8ab9747a6ab24
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
2020-04-30 10:13:34 +02:00
Alexandru Croitor
49212cb55a CMake: Fix build of qlogging test on MinGW
The linker doesn't have a -rdynamic option. Otherwise the build
fails with
g++.exe error unrecognized command line option '-rdynamic'

Task-number: QTBUG-75578
Change-Id: Ie89a19fd25e90bef14e64d1d98fd973fa0315997
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-04-30 10:13:22 +02:00
Alexandru Croitor
39090ea15c CMake: Fix usage of correct install prefix for standalone tests
Previously configuration of standalone tests might have failed
due to CMake trying to create files in the /usr/local default
prefix.
Make sure to use a fake prefix in the binary dir instead,
unless another prefix is explicitly specified.

Change-Id: Icfcb32285aa5596abf1a918396b26673880a8d27
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-04-30 10:13:18 +02:00
Tor Arne Vestbø
042b118caf macOS: Avoid modifying hash while iterating it
QCocoaTouch sneakily updated the list of active touches in the
destructor, causing problems when we switched from Q_FOREACH
to ranged-for.

Fixes: QTBUG-83876
Change-Id: If7ec9e9116b7eb581580b461ae12ad70c739906d
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
2020-04-30 08:40:49 +02:00
Marc Mutz
d2bb14253c Extend qbswap to charNN_t
Change-Id: Iea35d27961060d7a4be0410de35e974b4deb4fdf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-04-30 07:49:46 +02:00
Marc Mutz
915e756a42 QtCore: fix a few more char/int/uint -> QChar conversions
They were masked by all QChar ctors being made explicit, except the
char16_t one, which was left as the only viable choice.

Change-Id: I5632795f3c7dd1de3830285d5446d9b994613466
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-30 07:49:43 +02:00
Marc Mutz
2e41a46690 QTextCodecs: fix a few more ushort/uint -> QChar conversions
They leaked through since QChar(char) was explicit and therefore
QChar(char16_t) was the only viable constructor left once we made
all non-character-type QChar ctors explicit, too.

Change-Id: I6d774fc4b0d3b7eb480bdb93afd17c2ee9260b1c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-30 07:49:40 +02:00
Marc Mutz
68a20d6941 QNetworkProxy: don't allocate when parsing [1/2]: loop body
Instead of manipulating a QByteArray, do it with a QLatin1String,
which is free.  Also, don't prepend a dot to force matches at label
boundaries, check that there's a dot where the match occurred. Saves
two allocations per iteration. Finally, pull the query's
peerHostName() initialization out of the loop - it doesn't depend on
the loop variable.

Change-Id: I6dfdae711f0bd8941af69bfbcfda7873a40e4b80
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-29 22:31:25 +00:00
Marc Mutz
0daed8dee8 QWidgetLineControl: replace raw memory handling with std::unique_ptr
Change-Id: I131175a9f7147783c4f4c0a1c4929e28677c159a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-30 00:31:12 +02:00
Marc Mutz
b40c8e3068 QXmlInputSource: change EndOf{Data,Document} ushort -> char16_t
Allows continuing seamless conversion to QChar, unlike ushort, which
is being made explicit or deprecated, or removed.

Change-Id: I95480b013b5fbc95a2b45f860a01f24e6a97e5c8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-30 00:31:08 +02:00
Marc Mutz
73f196644c QtWidgets: fix a few more int/char -> QChar conversions
They were masked by all QChar ctors being made explicit, except the
char16_t one, which was left as the only viable choice.

Change-Id: I210d50dc243391ad2c7dd353ba9ae40147585d04
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-30 00:31:04 +02:00
Marc Mutz
8c43aa777e QtNetwork: fix a few more char -> QChar conversions
They were masked by all QChar ctors being made explicit, except the char16_t one,
which was left as the only viable choice.

Change-Id: I7288e6ae32b2771859a61c0b99783209d47616bc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-30 00:31:01 +02:00
Marc Mutz
7a8b277d5b QtGui: fix a few more char/int/uint -> QChar conversions
They were masked by all QChar ctors being made explicit, except the
char16_t one, which was left as the only viable choice.

Change-Id: I343269b61d555c259b5780011e99f85f5375ef78
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-30 00:30:57 +02:00
Volker Hilsheimer
1337e8fe46 macOS/iOS: set focus reason when handling window deactivation
Otherwise, the focusOutEvent to e.g. a QQuickItem losting focus will
be OtherFocusReason when the window it's becomes inactive.

Task-number: QTBUG-70319
Change-Id: Ic3762e68d92a88becd2b35612b14f6af64ee934e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-04-29 22:28:56 +00:00
Joerg Bornemann
062b50abff CMake: Namespace all our IMPORTED targets
CMake IMPORTED targets should be namespaced so that CMake knows that
the name refers to a target and not a file.

Use the existing WrapXXX naming scheme where applicable.

Fixes: QTBUG-83773
Change-Id: I5b0b722c811200c56c260c69e76940a625228769
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-29 23:08:32 +02:00
Joerg Bornemann
317cfb6774 CMake: Fix CMP0100 warning for bundled harfbuzz
Add a SKIP_AUTOMOC argument to qt_add_3rdparty_library and use it in
BundledHarfbuzz.

Change-Id: Ie4aa61639a5ab64f286ac539989572a9ae6bc3d5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-29 23:08:28 +02:00
Jarek Kobus
a4071c18de Get rid of virtual inheritance from ThreadEngineBase
The virtual inheritance causes the issue, when adding
new, non-default constructor to the base ThreadEngineBase
class. It looks like classes derived from it can't
use the non-default constructor, even when it's called
explicilty from the subclass. Instead, the default constructor of the
ThreadEngineBase class is always required during compilation
and called on runtime.

In addition, the only sensible use of the virtual inheritance
is the multiple inheritance, but apparently it looks like
there is no single class in Qt which would multi inherit from
the ThreadEngineBase class, so this change shouldn't have any bad
side effects. This justifies the current lack of info on why it
was introduced originally ages ago.

Change-Id: I08266e6f6865d938d1b1e4243ef94d2c02c3a886
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-04-29 22:58:11 +02:00
Jarek Kobus
4a242963ec Clean up in QTransform
Remove some deprecated stuff.
Inline some methods.
Remove unneeded constructors.

Change-Id: Id646be021d2de02005ebc8e43328e77a36a6250b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-04-29 22:57:51 +02:00
Sona Kurazyan
3a34fdf72a Port more tests from tests/auto/corelib/tools to CMake
Also removed add_subdirectory calls for subdirs which no longer exist.

Change-Id: I759f408ca812e1721dde495b0e23feffdeeb9c60
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-29 22:48:45 +02:00
Sona Kurazyan
9b51d5f571 CMake: Regenerate examples/widgets/ projects
Also add the missing examples/widgets/gallery project.

Change-Id: Iec3d61881065cf93d90f9fd3da928ffcd4f0c0aa
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-29 22:48:38 +02:00
Friedemann Kleint
a19d743b2c uic tests: Update version in baseline
Change-Id: I74334587727097a59fdeccd2fc58d18096cfed0a
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-04-29 22:48:26 +02:00
Friedemann Kleint
fcbb8131ea Enable Qt 5 connection syntax for QAbstractButton::animateClick()
Slot QAbstractButton::animateClick() is commonly connected to
signal QLineEdit::returnPressed() in dialogs.

The function had a parameter with a default for specifying the delay
which requires a lambda when using Qt 5 connection syntax.

Since the default value is used practically everywhere, remove
the parameter.

[ChangeLog][QtWidgets][QAbstractButton] The interval parameter has been
removed from QAbstractButton::animateClick().

Task-number: QTBUG-81845
Change-Id: I4e399138b6aa3a9f0b31c1f10de97ffcbab6a337
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-29 22:48:00 +02:00
Friedemann Kleint
425560cc83 Mark widget gallery example as "gallery"
Add a metatag. Amends 4e93e3b574.

Pick-to: 5.15
Task-number: PYSIDE-1112
Change-Id: I5003f958559438cc83eb98e5eedfcefb21a243b7
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-04-29 22:47:34 +02:00
Laszlo Agocs
1c0a7a87e9 rhi: Add backing format hint to QRhiRenderBuffer
Task-number: QTBUG-83707
Change-Id: I63548f4ace70af614a2aa082663bb3ae9fbedc25
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-04-29 22:36:00 +02:00
Shawn Rutledge
f2347077f5 Always open a text control's context menu on the same screen
It's very disorienting when a context menu pops up on a different
screen from where the right mouse button was clicked.
QWidgetPrivate::setScreenForPoint() can give incorrect results in
multi-screen desktop configurations; but we can give the menu a hint
by setting initialScreenIndex, which was originally used only when
QDesktopScreen or QDesktopScreenWidget is the parent (see
b3fc5e1ea3 ).

Task-number: QTBUG-76162
Pick-to: 5.15
Pick-to: 5.12
Change-Id: Icd4abdc32564430147e6c63a8ea70d483d25cddd
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-29 20:31:52 +00:00
Simon Hausmann
e9b8837c31 Add support for building building against yocto
Using an environment prefix wrapper shell script that sources the SDK's
env setup. The script also ensure that we don't loose cmake on the way.

Change-Id: I9d08bc58f0efaf688512ab26a7ddb800309a5015
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-29 22:26:25 +02:00
Simon Hausmann
9c76047b07 Instruction selection fix for qemu cross-builds
When building for qemu, the target "os" is still set to Linux, so try to
detect qemu by looking at the version field.

Change-Id: I7c66cdb29a47a44d5b8a394977136139fc646155
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-29 22:26:20 +02:00
Friedemann Kleint
512be78e01 tst_QDialogButtonBox: Port away from QAbstractButton::animateClick()
Use QAbstractButton::click(). Refactor and polish the tests
to use QTRY_VERIFY() instead of qWait(), speeding them up.

Pick-to: 5.15
Task-number: QTBUG-81845
Change-Id: I119bede8143ec1db5f5250517dee38b576d5a8d2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-29 10:10:37 +02:00
Marc Mutz
05a38c05f7 tst_Gestures: fix -Wdangling-else GCC warning
... and do a local code cleanup:

- add override
- port from foreach to C++11 ranged for loop
- remove dead code (`gestureEvent` (née event) was already
  dereferenced when we check it for null'ness, so it cannot be
  nullptr, so the condition is always true).

Pick-to: 5.15
Change-Id: Ica5e34fbe65c95f6573630f188582b90be15c8f7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-04-29 08:10:36 +00:00
Marc Mutz
693c28b9fb examples: avoid int -> QChar conversions
They're being made explicit/deprecated/removed.

Change-Id: I61d8c40dc86035813b85724beb21a65b6f8dffef
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-04-29 10:10:36 +02:00
Liang Qi
b8e1321273 Merge "Merge remote-tracking branch 'origin/5.15.0' into 5.15" 2020-04-29 07:57:36 +02:00
Timur Pocheptsov
15026f309b QMacStyle - change the arrow type only for 'OnlyOneTab' option
It appears the hack was not needed when we have several
tabs (popup button works as expected). Otherwise, this button
suddenly has a different size: it's bigger when selected and
smaller if not (and the holes clipped under the tab shape are
becoming quite visible in the dark mode to the left and right
of a tabbar). For the single tab we need some adjustment in
the size not to have visible difference between inactive/selected
tab.

Fixes: QTBUG-83216
Change-Id: I52511e610ae7b36f261e0218b7e432e747bc9491
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-29 07:13:57 +02:00
Volker Hilsheimer
0fda43cf33 Remove deprecated members from QtGui/image classes
Cleaning up those that are trivial to remove because they have direct
replacements.

Change-Id: I4f5c25884a01474fa2db8b369f0d883bd21edd5b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-04-29 06:20:07 +02:00