Commit Graph

47018 Commits

Author SHA1 Message Date
Tor Arne Vestbø
a00ad95137 Remove last remaining bits of QtPlatformHeaders
Task-number: QTBUG-84220
Change-Id: I951e04bfe9358a99951d1d61ff47b675584b7f81
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-08-04 07:12:32 +02:00
Tor Arne Vestbø
4595fb2c1e Remove QWaylandWindowFunctions
The subsurface sync/desync functions were unimplemented on the
qtwayland side, so this is all dead code. We will introduce the
platform interfaces if an actual use-case with an implementation
comes up.

Task-number: QTBUG-84220
Change-Id: I921ee7262e5f0a7171058aaf0ff2102d9e6f438e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2020-08-04 07:12:32 +02:00
Tor Arne Vestbø
561da776c9 Remove const volatile qualifier on return type in test
Fixes warning by Clang:

   warning: 'const volatile' type qualifiers on return type have no effect
      [-Wignored-qualifiers]
    const volatile unsigned long long * const volatile func_KVPKVull() {...}
                                        ^~~~~~~~~~~~~~~

Change-Id: Ia4aae6521c84f4a18d92ad5035af5b247d283140
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-04 05:12:31 +00:00
Shawn Rutledge
d1d4ea5ddf Add qHash implementations for QRect and QSize
We need them to implement qHash for QQuickPixmapKey.

Change-Id: Ia67de25ec0068b9e1b889bc9c6ee077e24eb71a8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-08-04 07:12:31 +02:00
Andrei Golubev
b3c1093751 Introduce swap functions for QPromise/QFutureInterface
Made QPromise::swap public, added free standing swap() for
QFutureInterface and QPromise. Updated QPromise special member
functions. Extended tests

Task-number: QTBUG-84977
Change-Id: I5daf6876df306d082441dbcdf5ae4dee3bfc0ead
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-08-03 16:47:31 +02:00
Topi Reinio
fddb0c895f Doc: Document QGradient::Preset enum values
Pick-to: 5.15
Fixes: QTBUG-85749
Change-Id: Ie77145e851ff64d4c88fce7211135d66e9b94a84
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-08-03 16:47:31 +02:00
Andy Shaw
7d4baabdae Android: Install the qmldir files when configuring for a single abi
This amends 0ef46b41d8 to ensure the
new configuration is styled correctly for qmake.

Task-number: QTBUG-80938
Change-Id: Iebfff3ff0570d2e92d01d4eb1178c0d6261468f9
Pick-to: 5.15
Reviewed-by: Lars Schmertmann <lars.schmertmann@governikus.de>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-03 16:47:31 +02:00
Laszlo Agocs
3f2251994d Fix doc signature in QOpenGLContext
Just T makes qdoc's clang parsing fail, it needs template<typename T>.

Also, the return type is T*, not T.

Change-Id: I210676aff3122b432888c3d79d9967e249ac88e1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-03 09:41:33 +02:00
Laszlo Agocs
f0c5802a5c Add more doc fixes for Vulkan types
Add dummy typedefs just for qdoc, this way the types show up in
the generated docs.

Change-Id: I408eeb5c4c1cbbb8cd7df8ca3c9c6b7c64b0ca88
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-08-03 09:41:22 +02:00
Laszlo Agocs
61bd046b58 eglfs_kms: Do not skip the initial SetCrtc
Trying to be clever seems to cause issues on some systems, for example
AMD (RADV) on Ubuntu 20.04 gives totally garbled output by default.

Remove the undocumented ALWAYS_SET_MODE env.var. as well, it won't have
much of a purpose since we'll in effect hit the SetCrtc path always now
once on startup.

Change-Id: Ibaa463ff913eb0c1251d6d3435aa4799fe5c8a29
Fixes: QTBUG-85797
Pick-to: 5.15
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-08-03 09:41:14 +02:00
Laszlo Agocs
a0db31ee52 eglfs: Prevent printing a warning in every widget-based app
Attempting to reflect reality with the value of AA_ShareOpenGLContexts
was a valiant attempt, but it is not possible to do setAttribute without
getting a warning now once QGuiApplication is constructed. So just leave
the attribute as is, changing its value is not strictly required.

Fixes: QTBUG-85796
Pick-to: 5.15
Change-Id: I0f0f981bb4883856b216b2a9aad3b5bf2d7da01a
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-08-03 09:41:10 +02:00
Mårten Nordheim
246e712548 Move-enable QByteDataBuffer::{append,prepend}
Change-Id: I2fd342465475e3a694c8459a54957149f8b418a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-01 10:51:21 +02:00
Mårten Nordheim
5d7be66fd7 QList: Add a append(QList &&) overload
We already had append(const QList &) and now there's an overload
taking an rvalue reference.

Change-Id: Id2fbc6c57badebebeee7b80d15bb333270fa4e19
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-01 00:01:52 +02:00
Allan Sandfeld Jensen
0c53f8ba98 Fix undefined use of memcpy and memcmp
Don't call them on a nullptr, even with a length of 0.

Change-Id: I7fee23303562e5771697a16365cae12e3e87af6f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-31 20:08:50 +02:00
Thiago Macieira
797e18118b Remove no-longer-applicable -Wno-error for GCC
We don't appear to have implicit fallthroughs in our code anymore. The
last deprecated copies and redundant moves are also gone.

The other warning never had an explanation and doesn't show up when
building full Qt anyway.

Change-Id: Iad959315ad374ef288f5fffd15d683599a1a11b9
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-07-31 09:58:05 -08:00
Thiago Macieira
e3a6ede895 Try again to fix Clang's -Wconstant-logical-operand warning
Commit daaa557259 changed the enum to
bool, but the warning is still happening.

Pick-To: 5.15
Change-Id: Ibdc95e9af7bd456a94ecfffd1603f332a356c788
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-31 10:44:52 -07:00
Thiago Macieira
95afe6b244 QSharedPointer: do allow calling deleters on null pointers
I don't know why std::shared_ptr allows this, but why not.

[ChangeLog][Important Behavior Changes] QSharedPointer objects will now
call custom deleters even when the pointer being tracked was null. This
behavior is the same as std::shared_ptr.

Fixes: QTBUG-85285
Pick-to: 5.15
Change-Id: I24006db8360041f598c5fffd161c260df0313b55
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2020-07-31 10:40:25 -07:00
Thiago Macieira
fe9e6b2ceb QString::vasprintf: fix 't' modifier for integers on 64-bit
‘t’
     Specifies that the argument is a ‘ptrdiff_t’.
     This modifier was introduced in ISO C99.

We use qsizetype, which is the same width as ptrdiff_t, so it makes no
difference in va_arg().

Change-Id: Iea47e0f8fc8b40378df7fffd16255730109413a5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-31 10:36:33 -07:00
Edward Welbourne
a6b3a1e459 Remove deprecated binary json feature
Deprecated in 5.15 in favor of CBOR.

Fixes: QTBUG-81239
Change-Id: I711d4bd7dd1247f58e77ac9fa53304cbe5028918
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-31 17:12:48 +02:00
Mitch Curtis
13c90a0a75 Document that keys() and values() run in linear time
keys() and values() can be slower for large containers.
I ran into this recently when profiling, and was surprised that keys()
had to build the list of keys (by appending in a loop).

Pick-to: 5.15 5.12
Change-Id: I73215f5a917790236704ad7ef78cefc4a049cd89
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-31 16:54:23 +02:00
Mitch Curtis
46ec92dad0 Fix build with MSVC2019
The error was:

src\virtualkeyboard\qvirtualkeyboardinputcontext_p.cpp(305): error C2678:
binary '!=': no operator found which takes a left-hand operand of type
'QList<QInputMethodEvent::Attribute>' (or there is no acceptable conversion)

This patch fixes the issue by manually defining an operator== for
QInputMethodEvent::Attribute.

Change-Id: Idb283cf7b6ff4388a38ea7780c3d5c1c5f77038d
Fixes: QTBUG-85789
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-31 16:54:10 +02:00
Allan Sandfeld Jensen
0792188440 Add float->qfloat16 rounding and fix the tests
Our hardware optimized conversions of float to qfloat16 rounds to even
where our table based conversion truncated to zero.

The rounding is not in this patch exactly round to even like the
hardware implementation but much closer.

Change-Id: I4c5e72c15fef9079d3660680b2727ff7ba4e768a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-31 16:50:30 +02:00
Paul Lemire
c95fc0f662 rhi: QRhiGLes2::gatherUniforms fix gathering in struct
In the case we don't have an array of structs, structPrefix needs to be
suffixed with a dot to get the proper uniform names.

Change-Id: I50ed54c2f7c3cc4556ed1854419bc4fe3a2989f7
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-07-31 15:43:20 +02:00
Linus Jahn
c19bafc60c QtCore: Use system-wide libb2 if present
This adds the option to build Qt with libb2, which is especially
recommended, if you care about the performance of the BLAKE2 hashing
algorithms. The bundled version is the pure reference C implementation
of BLAKE2, while libb2 has many additional hardware optimizations.
However, the API of both is the same, so no changes to the code were
necessary here.

Change-Id: I3563982f4e07be300291fe103c38b16a404b3ebb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-31 15:05:24 +02:00
Linus Jahn
5d69aa3ee1 QCryptographicHash: Add BLAKE2b and BLAKE2s hashing algorithms
BLAKE2 does not specify requirements about specific hash sizes and
since QCryptographicHash does not support dynamic hash sizes, only the
most common hash sizes could be covered by this.

The supported hash sizes were chosen to match the ones supported by the
Linux kernel.

The new hashing algorithms for QCryptographicHash are:
 * BLAKE2b (160 bit, 256 bit, 384 bit, 512 bit)
 * BLAKE2s (128 bit, 160 bit, 224 bit, 256 bit)

[ChangeLog][QtCore][QCryptographicHash] Added BLAKE2b and BLAKE2s
hashing algorithms.

Fixes: QTBUG-78198
Change-Id: Id9e0180a974093982fdf1cdd6180988a2e5e9f4f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-31 15:05:18 +02:00
Linus Jahn
06f7a24574 3rdparty: Add reference C implementation of BLAKE2
This is required for adding support of the BLAKE2 hashing algorithms in
QCryptographicHash.

Change-Id: Icc981c3a99a2713fdd1c18766b05619254650622
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-31 15:05:08 +02:00
Thorbjørn Lund Martsum
24d60cb64d Make initStyleOption virtual for various classes
Often a simple change in the styleoptions is needed in e.g a paintEvent,
but it was impossible without copying the whole paint-function which
is not always trivial and also wouldn't be kept up-to-date if it was
changed in Qt.
The initStyleOption is similar to viewOptions in QAbstractTableView
and it is handy that this function is virtual. Furthermore
QStyledItemDelegate::initStyleOption is already virtual.

This change only makes initStyleOption virtual for public classes.

[ChangeLog][QtWidgets] InitStyleOption has been made virtual in
public Qt classes to make override of stylebehavior more simple.

Change-Id: I38974c6d4dd0793ca5976ecf3aa28892215a1579
Task-number: QTBUG-77642
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
2020-07-31 14:58:54 +02:00
Alexandru Croitor
9c0f448f5a CMake: Fix generated content of prl files (again)
Apply the same kind of transformations to the contents of the prl
files as we do for pri files. Mainly, transform system library paths
that are absolute, into link flags to make them relocatable across
systems.

Also change the Qt frameworks to be linked via the -framework flags
instead of via absolute paths.

Implementation notes

Move the common required functions for both QtFinishPrlFile and
QtGenerateLibPri into a common QtGenerateLibHelpers.cmake file.

Make sure it's listed as a dependency for the custom commands.
Also make sure to pass the necessary input values like possible
library prefixes and suffixes, as well as the link flag.

Task-number: QTBUG-85240
Task-number: QTBUG-85801
Change-Id: I36f24207f92a1d2ed3ed2d81bb96e4e62d927b6e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-07-31 14:29:45 +02:00
Volker Hilsheimer
26c742c1e1 QFileSystemModel: make sure files are stat'ed in the worker thread
QFileInfoGatherer creates QFileInfo objects in the worker thread to
offload the work from the UI thread, but it never calls any methods on
the QFileInfo objects that would trigger a stat'ing of the files. For
large directories on remote file system, that easily results in the
UI thread being blocked for a very long time.

Add a private 'stat' method to QFileInfo which allows forcing it to
stat all attributes from the worker thread, and make
QFileInfoGatherer a friend so that it can call the function from the
worker thread. This way, QFileSystemModel can access the cached data
for each QFileInfo object, without having to touch the file system
from the UI thread.

Also reduce the amount of signal emissions for drive information,
batch all drives (which can safely be assumed to be at most a two
digit figure) into a single emission instead.

Change-Id: Ifdcae150406187db9984d0fec9add93597b5f85b
Fixes: QTBUG-41373
Pick-to: 5.15
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-07-31 10:59:58 +00:00
Laszlo Agocs
c5da2e6f06 Remove old qsb versions from qshader autotest
Only keep 3, 4, and 5 because 3 is the lowest version where binary JSON
is not used anymore.

Change-Id: Id0319e8eceb845017ed493d0ef6902b53050d5a6
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-07-31 12:57:06 +02:00
Allan Sandfeld Jensen
5747f31392 Another round of 0->nullptr cleanup
Change-Id: Ic8db7dc252f8fea46eb5a4f334726d6c7f4645a6
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-07-31 12:56:50 +02:00
Alexandru Croitor
4ed483b0e2 CMake: pro2cmake: Fix errors reported by flake8 and mypy
Change-Id: I842c0f8d7ec1d173fa1dbd74e769e2c370e70518
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-07-31 12:55:33 +02:00
Alexandru Croitor
ca103f357c CMake: pro2cmake: Reformat files using black
Change-Id: Ic06840f9877d6b863f48a5eb97fcd6735ab9bde8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-07-31 12:55:33 +02:00
Alexandru Croitor
e755ce99d9 CMake: Regenerate load(qt_app) projects
To use the new qt_internal_add_app function.

Change-Id: I9776ce18c3a8b01f1a42e8da346cfd0a98374ef8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-07-31 12:55:33 +02:00
Alexandru Croitor
d65283ebd0 CMake: Teach pro2cmake to convert load(qt_app)
Changes pro2cmake to handle load(qt_app) projects and write out
qt_internal_add_app calls.

Also adds handling of macOS and Windows specific resource files for Qt
apps only.

Task-number: QTBUG-85757
Change-Id: I994d8d19ab2ae366a985cab7894b97d6a278a56f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-07-31 12:55:32 +02:00
Alexandru Croitor
b3b1e47378 CMake: Introduce qt_internal_add_app
This new function is meant to be used where load(qt_app) is used.

It delegates functionality to qt_add_executable, while handling
some additional behavior via a finalization function (mostly handling
of macOS Info.plist files and icons, as well as Windows icons and
resource files)

It uses a new PlatformAppInternal interface target.

Task-number: QTBUG-85757
Change-Id: I1a2d5851b137fcd4a6323e0e06fb154f91619800
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-07-31 12:55:32 +02:00
Alexandru Croitor
704e215295 CMake: Regenerate projects
Change-Id: Iac12acd07513e790e531ae93366fdae70c1c61a5
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-07-31 12:55:32 +02:00
Fabian Kosmale
cb80720287 Expose QMetaTypeInterface::alignof in QMetaType
We already have the information in the QMetaTypeInterface, and provide
functions to access sizeof. Adding alignof support seems natural, and
should make it easier to handle over-aligned types.
This should also be helpful in QVariant.

Change-Id: I166be76f4b7d2d2e524a3a1e513bd2f361e887c1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-31 09:46:54 +02:00
Thiago Macieira
61ccfefb25 Fix warning in QStringView::compare(QChar) on qsizetype->int
size() - 1 is converted to int as the result, but size() is a qsizetype
and could be bigger than INT_MAX. So rewrite to not depend on the cast.
This was introduced on b2f79cceb1.

I could have replaced size() - 1 with int(size() > 1) - 1, but that's
even more complex. To simplify, I split the function in two while
retaining the C++11 constexpr requirements.

Bonus: removes the use of the ambiguously-named "empty()" function that
looks like a verb.

Fixes: QTBUG-85665
Pick-to: 5.15
Change-Id: Ieffc3453b88c4517a1dbfffd162338fdb084a376
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-30 20:29:23 -07:00
Thiago Macieira
caa40f57d4 QLocale: update qt_asciiToDouble to use qsizetype
No need to change the output variable from int to qsizetype. That would
complicate the use of libdouble-conversion, which uses ints.

Change-Id: Iea47e0f8fc8b40378df7fffd1624bfdba1189d81
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-07-31 03:29:11 +00:00
Edward Welbourne
2ab4fe2ac8 Be clearer about the locale-aware comparison QString supports
The docs didn't make clear that there's a case where a rather poor
locale-aware compare may be in use - which turns out to be in use on
Android.

In the process, stop duplicating (in two slightly different variants)
the same paragraph in many places when we can use a \sa to refer to a
sub-section of the class doc.

Pick-to: 5.15
Task-number: QTBUG-63518
Change-Id: I5a41b0a269e477e74236131310992e70462734d7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2020-07-30 13:15:42 +02:00
Allan Sandfeld Jensen
a57419b10d Document run-time acceleration of using the conversions functions
Pick-to: 5.15
Change-Id: I985b93135b9d8fdfdd64e9183b23cbf8a7b4e3eb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-30 09:52:24 +02:00
Tor Arne Vestbø
7940851863 Fix no-PCH build on Apple platforms
Change-Id: I5257af8079e6b2f26893d1bc44adb48ad4a1684b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-29 20:34:17 +02:00
Tor Arne Vestbø
47cb6ad698 Don't capture this explicitly in tests
Some compilers implicitly captures, and will warn about the unused capture.

Change-Id: Ib5e1cc3956c7eb0dc87cee834cce8a2b3dd0d30b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-29 18:34:16 +00:00
Tor Arne Vestbø
3d03f4e989 Register QPlatformBackingStoreOpenGLSupport when needed
Static builds can not rely on a constructor function in the QtOpenGL
library, as that will be linked out unless something in the application
pulls it in.

Instead we export a helper function that clients that depend on
OpenGL support in QPlatformBackingStore can use to bring it it.

Change-Id: Ic54058bf413a476287884c78df5624b862f97695
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-07-29 20:34:15 +02:00
Volker Hilsheimer
d14cf6d3d9 QFileInfo: Fail faster when stat'ing filepath on a disconnected drive
The Windows implementation of QFileSystemEngine tries hard to fill the
metadata for a file, even if GetFileAttributesEx returns with error.
This is good in many situations, but when the error code indicates that
the drive on which the file resides has been disconnected, then we
should fail quickly.

Task-number: QTBUG-6039
Pick-to: 5.15
Change-Id: I7574c5a2e524e913306d0b470b4f227416442c13
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-07-29 20:03:50 +02:00
Alex Trotsenko
8969070cfd QEventDispatcherWin32: redesign event notifiers activation
The previous implementation multiplexed callback-based event
notification into a single proxy event (cf. 85403d0af), which was
in turn object-waited for (this was the case since the beginning
of public qt history). It makes more sense to multiplex into a
posted message, because that also works with foreign event loops
that do not know anything about our event objects.

Task-number: QTBUG-64443
Change-Id: I97945ac8b5d7c8582701077134c0aef4f3b5a18f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-07-29 18:34:34 +03:00
Alexandru Croitor
9d55d6b45b CMake: Fix building debug apps with qmake on Windows
Our CMake build system only generated working .prl files for
the Release configuration in debug_and_release.

This caused a linking failure when building a Widgets example that
links against qtmain, specifically

qtmaind.lib(qtmain_win.cpp.obj) : error LNK2019: unresolved external
symbol __imp_CommandLineToArgvW referenced in function WinMain

The symbol is located in shell32.dll, which was not linked in, because
there was no qtmaind.prl file.

The fix to generate per config prl files is a bit complicated, because
add_custom_command does not support generator expressions in OUTPUT
and DEPENDS.

Instead we pre-generate 2 files per config, one with the preliminary
prl file content and another file that contains the final prl file
path (via generator expression).

Then we iterate over all configurations and create custom commands
with well known paths, and the final prl file is created by the script
called by the command.

Amends 06557312d2

Task-number: QTBUG-85240
Change-Id: I413b705bc69732b0cbe1ee8cd089a1aef19365db
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-07-29 17:33:15 +02:00
Alexandru Croitor
7b9904849f CMake: Fix _nolink targets to be optional on the consumer side
On Windows, if Qt is built with Vulkan support but the user's machine
does not have Vulkan, it should still be possible to configure and
build an application (if the application does not use Vulkan of
course).

When Qt is built with qmake, the special windows_vulkan_sdk.prf file
makes sure not to export build time Vulkan include headers into the
generated .pri files. The same file also tries to find the include
headers via an environment variable. If it isn't set, it just adds a
bogus "/include" include path, which doesn't fail a user's application
build.

This wasn't the case for an application built with CMake, because the
exported Vulkan_nolink target uncodinitionally referenced Vulkan's
target properties. Which means that if the Vulkan package was not
found, the application failed to configure.

To mimic qmake's behavior, make sure to query the target properties
only if the Vulkan target exists, via the TARGET_EXISTS generator
expression.

Apply the same logic to all _nolink targets. This might not be
entirely correct in all cases, but we can revise this behavior later
after more feedback. At the very least it allows building non-Vulkan
based applications.

Task-number: QTBUG-85240
Change-Id: Iffbb03a84e8637ed54d0811433e66fe6de43d71f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-07-29 17:33:14 +02:00
Laszlo Agocs
071fc289c4 Re-enable tst_qrhi on Linux
Not sure why this was disabled in the first place.

Change-Id: I66329b55fd46d03fd96818c6c7004718ddea5c79
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-29 15:04:19 +02:00