Commit Graph

47166 Commits

Author SHA1 Message Date
Laszlo Agocs
81159cf3f7 rhi: Enable msaatexture manual test on OpenGL
...now that a recent path enables MultisampleTextures for ES >= 3.1 and
GL 3.x and up.

Just need to make sure the .qsb contains something for OpenGL as well.

While we are at it, make updated .qsb files for all the commonly used
shaders since what we had before was version 4. Bump them to version 5.

Change-Id: If2040f4894e6360d1ebd5daf7e698508e5e6e42e
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-08-17 18:20:36 +02:00
Joerg Bornemann
80862621cd CMake: Link Boostrap against PlatformCommonInternal
...to pull in extra defines, includes, libdirs and framework paths.

Change-Id: I7c252f5edbcf15f7e2ad69ace4e15fbacf6cca8a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-17 18:19:26 +02:00
Joerg Bornemann
d6e41abd62 CMake: Handle -D, -I, -F and -L configure arguments
Introduce new CMake variables and map
-D to QT_EXTRA_DEFINES,
-I to QT_EXTRA_INCLUDEPATHS,
-L to QT_EXTRA_LIBDIRS,
and -F to QT_EXTRA_FRAMEWORKPATHS.

Those variables only affect the Qt build, not user projects.

Fixes: QTBUG-85878
Change-Id: I229df2eed1505a2619068d0d32975962b052569a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-17 18:19:24 +02:00
Alexandru Croitor
a930e657ed CMake: Fix what Android plugin suffix should be passed as a define
CMAKE_SYSTEM_PROCESSOR has the value i686 when targeting the x86
Android ABI, which is set by the Android CMake toolchain.
This is not the value that Qt expects, and potentially
breaks loading of Qt plugins. The same with aarch64 instead of
arm64-v8a.

In qmake the proper values for QT_ARCH variable are the equivalent of
the ANDROID_ABI variable set by the CMake toolchain file, so use
ANDROID_ABI.

Task-number: QTBUG-85399
Change-Id: Ia2eaceb75168cddb2d28414f1f4bf481ec76f29e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-17 18:19:22 +02:00
Alexandru Croitor
96dd73c5fe CMake: Fix typo in README about how to build Android for arm64
Task-number: QTBUG-85399
Change-Id: I764f5d5155d6548ca61d3217fb5bb10f5b15908f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-17 18:19:21 +02:00
Volker Hilsheimer
b39685d4c2 Make QCursor constructor explicit to prevent comparison of QPixmap
QPixmap doesn't implement operator==, but QCursor had a non-explicit
constructor from a QPixmap, which the compiler would use if two pixmaps
get compared.

Making that QCursor constructor explicit prevents that implicit
conversion, at the cost of potential (but trivially resolved) source
incompatibility.

Also, make QCursor's comparison operators into hidden friends to avoid
any other implicit conversions, and allow only QCursor object to be
compared.

In addition, delete operator== and operator!= in QPixmap so that the
compiler generates a useful error message, rather than a screen full
of global operator== candidates.

Delete these operators in QIcon as well for consistency.

Change-Id: I9b3f770da5718360ecc41c35cf327ef4f60d169b
Fixes: QTBUG-85993
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-17 15:08:39 +02:00
Volker Hilsheimer
90436e54cc Move QDesktopWidget API used by QApplication into QDesktopWidget
QDesktopWidget is not a public class anymore and only exists for
compatibility reasons. So we might just as well move the only method
used by other classes out of QDesktopWidgetPrivate, and get rid of the
friend declarations and the access-to-private code in QApplication.

Change-Id: I74ff14233e59912e0930f98995f8af60dbadfdb6
Task-number: QTBUG-62094
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-17 15:08:39 +02:00
Volker Hilsheimer
c54a5b8380 Introduce QWidget::setScreen
Follows the QWindow semantics, and is a replacement for creating
a QWidget with a QDesktopScreenWidget as the parent.

We can now remove much of the special handling of QDesktopWidget and
the Qt::Desktop window type, and get rid of QDesktopScreenWidget.

Add a manual test that allows local testing. Our CI environments
only have a single screen, and no multi-head display server setup
which is the primary case where QWidget::setScreen is interesting.
For the more common case of a virtual desktop, QWidget::setScreen
has no real impact (just as QWindow::setScreen doesn't).

Change-Id: Id0099e069d316741bacd8c795c396ccad37be297
Fixes: QTBUG-85483
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-17 15:08:39 +02:00
Volker Hilsheimer
c4366ff018 Remove call to static QGuiApplication::keyboardModifiers method
The event handler listens to the relevant input events already to
read the state of the modifiers. The implementation doesn't care about
touch, wheel, or tablet events either way.

The call was introduced in 28a21d98ef,
with no explanation why it would be necessary, and no test cases to
exercise that case.

Task-number: QTBUG-73829
Change-Id: Ibe408e86f697ac5acae5944b941f0d935ca2e408
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-17 15:08:39 +02:00
Mårten Nordheim
c2bc4467f7 QDecompressHelper: Fix warnings in zstd code
One warning about unused variable (dataLeftover), which was at some
point replaced by the class variable 'decoderHasData'.

The second warning was a fault of logic: checking that the unsigned
value retValue was greater than or equal to zero. Which only came about
because they initially did different things but the branches got merged
and the logic became flawed.

Change-Id: Ia3a04516c1b7b5f962226998bf3f4d101dd38148
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-17 12:22:55 +02:00
Kai Koehne
8c9482cd30 Add missing 'We mean it' header to qwindowsmime_p.h
Change-Id: Ia0085b75b9127d99b10518768cecbb79a4286c8e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-08-17 12:21:37 +02:00
Jonas Karlsson
f095dc7af1 Remove 'less than' comparison method
Change-Id: Ief52da4f9176216ba45d4dc9df5bb341987cb585
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-08-17 10:05:01 +02:00
Lars Knoll
150a6c691f Fix a valgrind warning about accessing uninitialized memory
Amends change bbfecdee1e.

Change-Id: Iba4ad5101b46f07ce0b3e3397d723e1a681bcbc5
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-17 09:33:59 +02:00
Volker Hilsheimer
81896304dc Remove dead code in qrandom
After 9ee554ac1d, the various static
inline versions of randTLS are no longer used, which clang warns
about.

Change-Id: I6dc21c0aab35fb6a8ca9e8d43ee4960ee844ef47
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-17 07:27:50 +00:00
Andy Shaw
135b16900e macOS: Check if the base of the style as well if it is a QProxyStyle
Since a QProxyStyle could be easily used for just a style hint or
similar we should account for the baseStyle() too to see if it is
effectively a QMacStyle too.

Pick-to: 5.15
Change-Id: I5d1df31f594cac2a7f5f5d1384cb7c278633b29d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-08-17 08:11:18 +02:00
Paul Lemire
77a985a876 rhi: QRhiGles2 use proper texture target for multisampled textures
Change-Id: I6e92a66f2758599626e7bdfbb2e149bb69192479
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-08-17 08:10:33 +02:00
Joerg Bornemann
f107713452 CMake: De-duplicate list input handling code in QtProcessConfigureArgs
Change-Id: I9fd77dd81f67fcc9a0306ab0d627257f209cdb08
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-17 08:08:26 +02:00
Joerg Bornemann
584d4be174 CMake: Re-implement configure/qmake's command line handling in CMake
We extend configurejson2cmake to read the "commandline"
information from configure.json. This data is then translated to CMake function
calls and written it into commandline.cmake files.

We extend QtProcessConfigureArgs.cmake to pick up those commandline.cmake
files to feed our command line handling code, which is a
re-implementation of the command line handling in qt_configure.prf.

The command line handler sets INPUT_xxx variables, similar to
configure/qmake's config.input.xxx variables. The INPUT_xxx values are
translated
- to -DFEATURE_xxx=ON/OFF arguments if the input represents a feature,
- to corresponding CMake variables if such a variable is known,
- or to -DINPUT_xxx=yyy CMake arguments.

Configure arguments that have an entry in
cmake/configure-cmake-mapping.md are actually implemented. Other
arguments are likely to need more work.

Task-number: QTBUG-85373
Change-Id: Ia96baa673fc1fb88e73ba05a1afb473aa074b37d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-17 08:08:20 +02:00
Volker Hilsheimer
2f9a294252 Reset version of QStyleOption types to 1 for Qt 6
Amends 7ff26c7762 and
729f1ab9a0.

Change-Id: I7d3cea42318faffc9dee48d51ae9f890bb1e7a56
Fixes: QTBUG-84221
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2020-08-16 15:03:53 +02:00
Volker Hilsheimer
e1536e3a86 Purge versioned style options from UIC
For Qt 6.0, all versioned style option types have been merged into the base
class, and version number has been reset to 1.

Task-number: QTBUG-84221
Change-Id: If729720813c0cf284271a9084311ed6eb820ecca
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2020-08-16 15:03:46 +02:00
Lars Knoll
5076ce54be Fix compiler warning about implict cast to double
Change-Id: I80497efedebed9579882d31d3eda13bd88c80c94
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2020-08-16 14:54:17 +02:00
Lars Knoll
9fb2db1ccc Fix test with cmake build
Change-Id: I9153296dbd687abb65464638fd519d466f600e84
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2020-08-16 11:53:29 +02:00
Lars Knoll
f741a12de1 Disentangle QIODevice dependencies
Move the QIODevice::OpenMode enum into a base class, so that
we can remove the full QIODevice (and thus QObject) dependency
from qdatastream.h and qtextstream.h.

This is required so that we can include QDataStream in qmetatype.h
without getting circular dependencies.

As a nice side effect, QDataStream and QTextStream can now inherit
QIODeviceBase and provide the OpenMode enum directly in their
class scope.

Change-Id: Ifa68b7b1d8d95687ed032f6c9206f92e63bfacdf
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2020-08-15 20:55:31 +02:00
Lars Knoll
5e3b7effbd Add overload for char to QDataStream
This is a distinct types in C++, and should be supported out of the
box in QDataStream. This is also required so we do find a data stream
operator for the types when searching for it using template magic.

Change-Id: Iea57780621e2aab7ed253f1cc896bebada43b9f0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-15 14:43:56 +02:00
Lars Knoll
4376c4d9d8 Some work to handle enums that are larger than 32bit
This will require some more work in QFlags and the metaobject
system for Q_ENUM.

Change-Id: I3687c7d2529dc18e7bc1abfc326e56ff7a365bc5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-15 14:43:50 +02:00
Lars Knoll
0e6a327f14 Remove friend declarations that aren't required
Those are problematic as they are also interpreted as
forward declarations of methods that are defined inline in
qdatastream.h and might never get instantiated. This can
lead to problems if template code checks for the existence
of the method.

Change-Id: I4550a6bc70ebd7edc57fe0420b89b453195971d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-15 14:43:43 +02:00
Lars Knoll
df289c822d Small cleanup
Change-Id: I3badb73bee8cb88992254c6f11ae292e21d4a6d7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-15 14:43:36 +02:00
Lars Knoll
3ef8ec2ee1 Constrain the data stream operators for containers
Check that we can successfully instantiate the data
stream operator for a container before we actually try.

This is required so we can automate registration of debug
stream operators with QMetaType.

Change-Id: Ib100a5242470d7fc8067058cc4d81af2fa9354b0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-15 14:43:30 +02:00
Lars Knoll
8ad9e81694 Constrain the debug stream operators for containers
Check that we can successfully instantiate the debug
stream operator for a container before we actually try.

This is required so we can automate registration of debug
stream operators with QMetaType.

Change-Id: I3943e7a443751d250c33b2ca1b9cf29207cfe6c4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-08-15 14:43:23 +02:00
Lars Knoll
6c36fd8af7 Make QVariant(Type) and QVariant(QDataStream) explicit
We should probably deprecate both constructors in addition.

Change-Id: Id62448b2abe14248c134feae899fa053ef373e58
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-08-15 10:56:41 +02:00
Lars Knoll
67f04fa060 Deprecate QVariant::Type uses in QSqlField
Add metaType()/setMetaType() methods to be used instead
of the type() methods taking a QVariant::Type.

Change-Id: Ieaba35b73f8061cd83288dd6b50d58322db3c7ed
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2020-08-15 10:56:33 +02:00
Lars Knoll
8929c0a355 Remove QVariant(int type, void *data, ...) constructor
It was marked internal anyway. Use the constructor taking a
QMetaType instead.

Change-Id: I15b9cd0911aac063a0f0fe0352fa2c84b7f7c691
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-15 10:56:29 +02:00
Alexandru Croitor
af263b003b Android: Be more verbose about which binary is not found
It's unclear that the actual file searched for is different from the
error output. Make it clearer.

Task-number: QTBUG-85399
Change-Id: Ia5eb6d03c42b399604ce452b88408e0e5071d17c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-08-15 08:13:24 +02:00
Lars Knoll
5f552e7b96 Allow constructing a null variant from a meta type
Add a default argument for the data pointer, so one can
construct a null variant of a certain metatype. This
is meant to help replace the QVariant(Type) constructor
that will get deprecated.

Change-Id: If75a1491ffcaa82d28eb5a7efb547da0ef1f2a87
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-14 23:41:42 +02:00
Cristian Adam
ad80d57635 GitHub Actions: Fix actions build
configure script has started to fail on presence of unknown parameters.

Change-Id: I7a18730e0579a36aadd8e92881886e2cc397594a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-08-14 21:40:28 +02:00
Alexandru Croitor
32121e9882 CMake: Split out some Android functions into a public API file
To fix CMake Qt For Android projects to configure, we need to move
some functions from a private CMake API file only, to a public one.

Add Qt6AndroidMacros.cmake which will be loaded by Qt6Core package.

We'll have to decide how we proceed with Qt5AndroidSupport.cmake,
because that file automatically runs code when included in Qt5, and we
usually don't want to do it.

We'll also have to decide how to handle the define_property() calls
that are still left in the private QtPlatformAndroid.cmake file.

With this fix, Qt example CMake projects that use
add_qt_gui_executable should now be buildable. An APK can be created
with 'ninja apk'.

Unfortunately Qt Creator 4.13 does not currently seem to support
opening and building CMake Qt For Android projects properly.
While the build succeeds after fiddling with the Kit settings, the APK
deploy step fails to run (at least on my machine).

So the simplest way to run the built APK is to open the android-build
dir with Android Studio and launch the example application from there.

Task-number: QTBUG-85399
Change-Id: I77f246331de7a6e9e6d4ba7d973730190138f136
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-08-14 21:40:28 +02:00
Alexandru Croitor
c1038019fc CMake: Fix various issues with building CMake Android projects
Fix detection of qt android platform plugin by globbing inside
the install qt6 prefix location. This is just a sanity check.

Fix platform plugin detection for CMake standalone tests configured
using qt-cmake-standalone-test, which used to look into the fake
standalone prefix location instead of the real Qt location.

Fix detection of stdlib path using CMAKE_SYSROOT.

Add a global apk target that allows easier building of all apk targets
defined in the project. Creation of this target can be opted out by
setting QT_NO_GLOBAL_APK_TARGET to TRUE.

Amends b1f8ca8032.

Task-number: QTBUG-85399
Change-Id: Ic9c1646b4f00e0084fe3f4397df471b8f925afd8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-08-14 21:40:28 +02:00
Alexandru Croitor
3b3029f959 CMake: Move QtPostProcess functions into QtPostProcessHelpers.cmake
The helpers can now be included manually in a project to call any
required function. There was a use case for that in qttools, which was
not possible because including QtPostProcess early would produce side
effects.

Task-number: QTBUG-86035
Change-Id: I05d5576bbac45d4b9e298b23aa2a33088d64968e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-08-14 21:40:28 +02:00
Alexandru Croitor
2e6ca4bbc3 CMake: Fix copying of gradle resources in non-prefix builds
Amends b1f8ca8032.

Task-number: QTBUG-85399
Change-Id: Ibf0d721a7735dabd48e069a6098d1d9338cde660
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-14 18:13:38 +02:00
Allan Sandfeld Jensen
6f0df02d00 Replace Qt CONSTEXPR defines with constexpr
Both normal and relaxed constexpr are required by our new minimum of
C++17.

Change-Id: Ic028b88a2e7a6cb7d5925f3133b9d54859a81744
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-08-14 15:52:58 +02:00
Alexandru Croitor
44cce1a2ea CMake: Split QtBuild.cmake into smaller files
QtBuild.cmake is huge. Split it.

Move module, plugin, tools, executables and test related functions out
of QtBuild.cmake into separate files.
Do the same for many other things too.

An additional requirement is that all the new Helpers files only
define functions and macros.
No global variable definitions are allowed, nor execution of commands
with side effects.

Some notes:
qt_install_qml_files is removed because it's dead code.

Some functions still need to be figured out, because they are
interspersed and depend on various global state assignments.

Task-number: QTBUG-86035
Change-Id: I21d79ff02eef923c202eb1000422888727cb0e2c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-08-14 13:17:11 +02:00
Andy Shaw
9d3a908e9e Doc: Change QPixmap::grabWindow with QScreen::grabWindow
Change-Id: I68df86314cb8c3602d7ddbcf1e4527cf247d5fa1
Pick-to: 5.15
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-08-14 13:17:11 +02:00
Giuseppe D'Angelo
06ffb912ca Drop qunicodechar
It's unused except in the definition of QStringLiteral, where
we can just use char16_t. The static_assert can also go as it's
already checked in qglobal.cpp.

Change-Id: I06e8a87b4dea1582cd84957efca1b8ad0d2e0266
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-14 13:17:11 +02:00
Mårten Nordheim
d40f88e8d2 QDecompressHelper: Introduce zstd support
Also take this opportunity to reshuffle the content-encodings in the
intended ordering since the ordering is used to signify priority.

Task-number: QTBUG-83269
Change-Id: I022eecf1ba03b54dbd9c98a9d63d05fb05fd2124
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-14 13:17:11 +02:00
Edward Welbourne
94b7a4f9b8 QAtomic*: purge deprecated load() and save() methods
Deprecated in 5.14 in favor of loadRelaxed() and storeRelaxed().
Caught one surviving use of load() in the ios platform plugin.

Change-Id: I9518064a948e5d26ccb956490cbb0561bed5d8b5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-14 10:00:02 +02:00
Edward Welbourne
9ee554ac1d qglobal.h: remove deprecated global functions
Since 5.0 - qMalloc(), qFree(), qRealloc(), qMemCopy(), qMemSet()
Since 5.15 - qsrand(), qrand()

Change-Id: I74fa3d17b05521271c3dc563fc85a5b133289ce3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-14 09:59:36 +02:00
Edward Welbourne
ff555d8965 QVariant: remove docs for non-existent deprecated methods
This follows up on commit 3898c022a6
which removed the code but not the methods themselves.

Change-Id: Ia2311921365fdc5fee1104dd3162d6f26e5bb091
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-14 09:59:11 +02:00
Edward Welbourne
67ba2a5db8 QObject/Q_OBJECT: remove deprecated old API
Since 5.0, trUtf8(), qFindChild()

Change-Id: I7bc0d125f92faebf24a422c1aac528a3f4687434
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-14 09:58:51 +02:00
Edward Welbourne
80602ce2b3 QCoreApplication: purge deprecated API
Since 5.9 flush()
Since 5.6 notifyInternal()
Since 5.0 trUtf8()

Change-Id: I1cc0fc5ebc3d7f2f4809c4494ab2a7486a481b10
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-14 09:58:20 +02:00
Edward Welbourne
72205c829b QQueue: purge deprecated API, swap(i, j)
Was deprecated in 5.14 although the relevant annotations won't show up
until 5.15.1.

Change-Id: I5b88bd109b9785d8170c616c619d478969536bbf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-14 09:57:21 +02:00