Commit Graph

48271 Commits

Author SHA1 Message Date
Tor Arne Vestbø
b40d3b0690 macOS: Remove dead widget attribute WA_MacNoShadow
Change-Id: If17acc230fc7669e46956ac2150a5a395694666c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-10-06 11:20:53 +02:00
Tor Arne Vestbø
5930a0ebc0 macOS: Update slider metrics by explicitly asking it to layout
Pick-to: 5.15
Pick-to: 5.12
Change-Id: I283771624b513f4e8844c6130898ddf2531df0f1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-10-06 11:20:51 +02:00
Tor Arne Vestbø
57d6f842ea Un-special-case macOS in handling of QKeyEvent::nativeScanCode()
In the porting from Qt 4 to Qt 5 an assumption was made in QKeyMapper
that the underlying platform implementation needed the native scan
code to be able to resolve the possible keymaps for an event.

As a result, the macOS platform plugin started sending key events
with a fake native scan code of 1, so that it would still be allowed
to map key events.

Which in turn led to the documentation of QKeyEvent::nativeScanCode()
getting an exception for macOS.

Let's clean up this by removing the original assumption, and leave it
up to the platforms to decide what information from the key event
is needed.

QKeyMapperPrivate::possibleKeys() will still call extractKeyFromEvent
as a fallback if the platform layer doesn't return any possible keys.

Change-Id: I122a45bcec658c45ccc0b2c0671eb264d85d7be6
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-10-06 11:20:49 +02:00
Tor Arne Vestbø
7aac974c78 macOS: Prevent mapping non-keydown events to characters
The [NSEvent charactersByApplyingModifiers:] API only supports key
down events, but we might get into QCocoaKeyMapper::keyMapForKey for
modifier key presses as well (even if QShortcutMap::nextState tries
to filter out modifier keys).

Change-Id: I02f163edac2baa9052f34b4d5d31b6a627d3d85c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-10-06 11:20:48 +02:00
Lars Knoll
fa8d021fa6 Convert a couple of APIs to use views
Try to get rid of APIs that use raw 'const {char, QChar} *, length'
pairs. Instead, use QByteArrayView or QStringView.

As QStringConverter is a new class, simply change the API to what we'd like
to have. Also adjust hidden API in QStringBuilder and friends.

Change-Id: I897d47f63a7b965f5574a1e51da64147f9e981f6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-06 11:16:36 +02:00
Andreas Klots
40874625f9 Fix a bug in the initialization (and debug-output) of BSP trees
On a horizontal split the current rectangle is split along the y-axis,
creating two children with the dimensions [x, y, width, height / 2]
and [x, y + height / 2, width, height / 2] respectively. When the
BSP tree is initialized, the type of the root node is set to
"Horizontal". However, the offset of the root node is wrongly
initialized with a split along the x-axis instead of the y-axis.
This leads to wrong behavior on QGraphicsScenes with a non square
aspect ratio. E.g on a QGraphicsScene with an apsect ratio favoring
the y-axis, every item between yItem = sceneWidth/2 and
yItem = sceneHeight/2 will be added to the wrong leaf.

[ChangeLog][QWidgets][QGraphicsScene] Fixed a bug in the initialization
of BSP trees to increase the performance of QGraphicsScenes with non
quadratic scene rectangles.

Fixes: QTBUG-87174
Pick-to: 5.15
Change-Id: I360033e94e22eb961f820278993754d10bfc1e45
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-06 08:26:57 +00:00
David Skoland
62fed23fef Improve QWizard visuals for macOS dark mode
This did not account for macOS dark mode, with hardcoded white,
but now it correctly updates the colors from palette whenever
the theme is changed.

Additionally changed some bool checks to make sure the code
runs on macOS theme updates.

Do note that this change affects Qt Maintenance Tool (in a
good way).

Pick-to: 5.12 5.15
Change-Id: I6fb92d3f6c15a7ff83d0d8a30cf82477b6aba126
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
2020-10-06 08:17:31 +00:00
Edward Welbourne
48cc034c3f Break out calendar backend-from-enum as a static function
This lets the registry's populate() avoid recursing into constructors
that are typically what (indirectly) called it. This, in turn, makes
it possible to assert the constructor from enum gets what it expects.

Pick-to: 5.15
Change-Id: I190f9dcfe405e3ee1c6a3f0926fa33cf9ddf64e0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-06 10:09:58 +02:00
Giuseppe D'Angelo
f0162415f1 QCalendar: fixup includes
Remove an unused one, and add a used one.

Pick-to: 5.15
Change-Id: Ic8b2fc7d0fa1e703b7cbbc622b98a626dd0f6ced
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-06 10:09:51 +02:00
Alexandru Croitor
2354274f39 CMake: Allow embedding debug info in object files with MSVC
Introduce a new feature called 'FEATURE_msvc_obj_debug_info' which
should allow usage of sccache for Windows MSVC configs.

Enabling the feature will replace the default '/Zi' compile flag
that CMake sets in Windows-MSVC.cmake with '/Z7'.

This ensures that the debug info is placed into the compiled object
file instead of placing it in the compilation .pdb file via
mspdbsrv.exe.
The final pdb file will still be created for shared libraries and
executables due to the linker '/debug' flag.
Static libraries will not have a .pdb file, instead the debug info
being embeeded in the .lib file.

The downsides of using '/Z7' are more disk space usage, slower
link times, more memory used for linking because the linker needs
to deal with more symbols.

The upside is that caching each indepedent cl.exe call is possible.
This is what Chromium uses with goma, and Firefox with sccache.

We're not enabling the feature by default to allow easier
testing (and switching it off) in the CI if it proves not to be
feasible.
It will probably have to be disabled at least for building
qtwebengine due to high memory requirements.

Task-number: QTQAINFRA-3934
Change-Id: I89e0e57995e938a780be318d1faec700194aa93f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-06 10:07:10 +02:00
Alexandru Croitor
98bea5857a CMake: Introduce CMake-only optimize_full feature
Enabling it will force usage of '-O3' flag when building Qt.
If the platform has no '-O3' flag, use '-O2' as a fallback.

Task-number: QTBUG-86866
Change-Id: If13f7de954ba5c01dc9634f06a85529828fe90a9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-06 10:07:08 +02:00
Alexandru Croitor
07b6d3367d CMake: Refactor optimization flag handling and add optimize_full
Introduce a bunch of helper functions to manipulate compiler
flags and linker flags for the
CMAKE_<LANG>_FLAGS_<CONFIG>
and
CMAKE_<LINK_TYPE>_LINKER_FLAGS_<CONFIG>
CMake variables.
These variables can be assigned and modified either in the cache
or for a specific subdirectory scope, which will apply the flags
only to targets in that scope.

Add qt_internal_add_optimize_full_flags() function which mimics
qmake's CONFIG += optimize_full behavior.

Calling it will force usage of the '-O3' optimization flag on supported
platforms (falling back '-O2' where not supported).

Use the function for the Core and Gui subdirectories, to enable full
optimization for the respective Qt modules as it is done in the qmake
projects.

To ensure that the global qmake-like compiler flags are assigned
eveywhere,
qt_internal_set_up_config_optimizations_like_in_qmake() needs
to be called after Qt global features like optimize_size and
optimize_full are available.

This means that qtbase and its standalone tests need some special
handling in regards to when to call that function.

Task-number: QTBUG-86866
Change-Id: Ic7ac23de0265561cb06a0ba55089b6c0d3347441
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-06 10:07:05 +02:00
Alexandru Croitor
e6fd92816d CMake: Install PDB debug info for MSVC builds
Supports installing linker generated debug info for shared libraries
and executables, as well as compiler generated debug info for static
libraries.

Works with Ninja Multi-Config as well, with the caveat that the files
are installed optionally, aka the install rule will not error out if
a pdb file is not present. This is necessary, because it's not
possible to create per-config install rules properly.

Fixes: QTBUG-87006
Change-Id: I95e91a6557eb0ee0f882103be54cd38795c349f7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-06 10:07:02 +02:00
Allan Sandfeld Jensen
00807f1fe5 Simplify QAction privates
List primary and alternative key sequences and ids together, making the
logic cleaner.

Change-Id: I4eb07f9828f2b15dc66c34ceb2c4f800df73e800
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-06 09:41:31 +02:00
Giuseppe D'Angelo
45a0c68c8c xdgdesktopportal: properly fix a dangling pointer
The previous fix didn't actually work, as it kept a reference
into a container which could have been muted by the time the
reference was going to be used.

Use an index instead.

Amends 32c09ea5b0.

Change-Id: Ib855b4a663c281467e46536b98a0ce2b961f19ee
Pick-to: 5.15
Task-number: QTBUG-87143
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-06 07:37:28 +00:00
Morten Johan Sørvig
227fa93c27 Give QPlatformPlaceholderScreen a DPR of 1
Use the default logicalDpi() implementation, which now
returns logicalBaseDpi() and ensures a default device
pixel ratio of 1.


Change-Id: Idd408261c90b112a093c82695ff9e0078e90ac41
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-10-06 09:22:03 +02:00
Morten Johan Sørvig
59498964c9 EGLFS: Don’t compute logical DPI from physical size
Remove code which computes logical DPI from the screen’s
physical size.

Return a DPI of 100 instead (this value was previously
returned if the physical size was not available), and
add a matching logicalBaseDpi() implementation which
gives a device pixel ratio of 1.

Task-number: QTBUG-87035
Change-Id: Ib20afbbd24fd6b57c8ffb2fd697f1becba283cba
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-10-06 07:21:22 +00:00
Giuseppe D'Angelo
b3637a7bfb QColorSpace: tidies
It doesn't actually need Q_DECLARE_PRIVATE (it never uses Q_D),
it just needs to give friendship to the private class.

Change-Id: I32ac128118a0c319a374e510a18ccf0edf323da7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-10-06 09:15:31 +02:00
Giuseppe D'Angelo
259b364da6 QColorSpace: remove a redundant declaration
The same function was declared, as friend, a few lines above.

Change-Id: I28368202c68242f2d30d25bd38f2f0e530a60082
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-10-06 09:15:29 +02:00
Giuseppe D'Angelo
733ab10961 QRegularExpression: add move constructor(s)
Change-Id: I599e4b7338172de5936b191f5e16383c1c31104c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-06 09:15:28 +02:00
Assam Boudjelthia
e60a337f4e Android: use shell path format when running qmake install step
On Windows shell, using unix path format might not work, since the shell
expects backslash paths only.

Pick-to: 5.15
Task-number: QTBUG-87066
Change-Id: I51741b475c1ede11336df63ee1c6092c792c16ef
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-06 06:51:14 +00:00
Joerg Bornemann
1f52f45836 CMake: Implement missing Android-related configure options
Implement the last remaining Android-related configure options for the
CMake build.

Print warnings for options that have no equivalent in the CMake build.

Let -android-ndk automatically deduce the CMake toolchain file, and
error out if that fails with a hint how to fix the situation.

Task-number: QTBUG-85373
Change-Id: I8399e5334ae0f1f6634e381775a308d34f7c482b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-06 06:31:18 +02:00
Joerg Bornemann
260a6e86c2 CMake: Extend message functions in QtProcessConfigureArgs.cmake
qtConfAddWarning was missing, despite being used.

All of the three qtConfAdd* functions take multiple parameters and pass
them to the CMake's message() function.

Change-Id: I1fad46c6fd00b2e733b32cda482bbf1341ffc63f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-06 06:31:18 +02:00
Joerg Bornemann
cc0c27c421 CMake: Fix typo in ANDROID_SDK_ROOT's help text
Change-Id: I1edc7e7ae443c306aca64b8f6a92c8b32fad6117
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-06 06:31:18 +02:00
Andreas Buhr
3c4e94d12c Fix build with g++ 10.2
g++ 10.2 complains here that a comparison of "Last" with
"std::numeric_limits<quint8>::max()" is always false when "Last" is
an int greater than 256. This is because
"std::numeric_limits<quint8>::max() returns an quint8. Since parts of
Qt are built with -Werror, the build fails.
Fixed by adding a unary plus (+).

Change-Id: I16a6b9f6952aeddf0a2a04d87746e433927122bf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-06 06:31:18 +02:00
Thiago Macieira
97de53ee8c QUrl::fromLocalFile: accept invalid hostnames
QUrl hostnames must be compliant with STD3, but we must somehow accept
file paths that begin with double slash but aren't valid hostnames.
Because the file URI spec requires us to start with "file://" anyway, we
can represent those with four slashes. Note that on Unix "//X/y" is a
valid but local file path. If given to QUrl::fromLocalFile(), if the
path at the root does parse as a hostname, we will still try to
normalize (the above becomes "file://x/y").

[ChangeLog][QtCore][QUrl] Changed QUrl::fromLocalFile() to accept
Windows UNC paths whose hostname component is not a valid Internet
hostname. This makes QUrl able to accept extended-length paths (\\?\),
device namespace (\\.\),  WSL (\\wsl$), etc.

Pick-to: 5.15
Fixes: QTBUG-86277
Change-Id: I3eb349b832c14610895efffd1635759348214a3b
Reviewed-by: David Faure <david.faure@kdab.com>
2020-10-05 21:31:18 -07:00
Thiago Macieira
dfa35ee6c8 tst_QUrl/Win: test QUrl::fromLocalFile with backslashes
Pick-to: 5.15
Change-Id: I3eb349b832c14610895efffd1635752ccc82889a
Reviewed-by: David Faure <david.faure@kdab.com>
2020-10-05 21:31:18 -07:00
Thiago Macieira
4e00288957 tst_QUrl: give the to/fromLocalFile test rows proper names
No change in testing, juts changed names and order.

Pick-to: 5.15
Change-Id: I3eb349b832c14610895efffd16357498454bcd52
Reviewed-by: David Faure <david.faure@kdab.com>
2020-10-05 21:31:18 -07:00
Karsten Heimrich
bd225ef95e Make QAnyStringView comparison operators hidden friends
Also add the very same operators to the QBasicUtf8StringView
class to overcome the compiler issues seen on gcc.

Fixes: QTBUG-86481
Change-Id: I12484455ebd3b7b38d4ad67c38977d76f9b3ddfa
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-06 06:31:18 +02:00
Edward Welbourne
d6aa7c338d Prefer QStringView's operator[] over its at()
Change-Id: Ibe2c450aa69ac7ea6db1e6a2174e17f31b4be9a3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-10-06 06:31:18 +02:00
Edward Welbourne
978039651e Test end-date, not just its string representation, in QDTE test
In tst_QDateTimeEdit::dateEditCorrectSectionSize(), only the final
displayed date was tested; many of the tests checked day of week (by
name), which might well match despite actually selecting a different
date than the one intended. So test the date is as expected, too.

In the process, tidy up the code, give values more informative names,
turn a trivial static function into a lambda.

Change-Id: I0491159e9ee2f3cfdcf8a194c723be92c190c2a8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-10-06 06:31:18 +02:00
Ulf Hermann
f0068e7b03 CMake: Add library mapping for QmlCompiler
This is necessary for pro2cmake.py to work on qmlcompiler.pro.

Change-Id: I356a6333d3bcc15daf6f2692a2b7ca82c9f37c85
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-05 16:03:56 +02:00
Laszlo Agocs
20eb40bce9 rhi: vk: Reduce memcopies with full dynamic buffer updates
Change-Id: Ifc754a639fcdb45a1b1b8721393de9356504342f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-10-05 12:08:59 +02:00
Morten Johan Sørvig
f84ba3108c Remove QPlatformScreen::pixelDensity()
This function is no longer in use - Qt Gui now computes
scale factors based on logicalDpi() and logicalBaseDpi()
instead.

Change-Id: Ieb4b75ef4e1563694a8e12b7cdd1f60c419d5bf2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-10-05 10:58:00 +02:00
Morten Johan Sørvig
9103d82d01 Make the logicalDpi() default implementation return 96
Remove the code which calculates physical DPI and
call logicalBaseDpi() instead.

This will make sure that Qt gets a device pixel ratio
of 1.0 by default, for the cases where the platform
plugin does not implement logicalDpi() itself.

Task-number: QTBUG-87035
Change-Id: I08433c9465be03d27b3decccb0e2e7e5e6aff0ae
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-10-05 08:57:54 +00:00
Giuseppe D'Angelo
54232d6ea9 Streamline the template specialization of QESDP's dtor
Declaring and implementing out of line a specialization for
QESDP's destructor is needed if we have an implicitly shared
type and we want to provide an inline move constructor for it.

The code is however a bit heavy on the eyes, and the full
implementation for the destructor must be provided (read:
copy and pasted) -- the specialization destructor cannot
just "reuse" the one from the primary template.

This patch adds a few macros to streamline the above, so
that we can start using the same pattern in more places.
These macros are completely private for the moment being;
we don't want to push this solution for our users.

Port QPixmap to the new macros.

Change-Id: Ia6a51ad988483e44c9d97c0eca2fb003b6bd21e3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-05 10:16:52 +02:00
Martin Storsjö
099f756ed5 Windows QPA: Fix building with OpenGL disabled after "QFlags: remove deprecated constructor"
Change-Id: Icf07bc475ba8f8f9cbe76169dc3dede9ba703292
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-10-05 11:16:28 +03:00
Lars Knoll
6abdbb65e5 Change QString::fromLatin1 and friends to use QByteArrayView
Also adjust the QString constructor from QByteArray to ignore
\0 characters in the string (and not terminate conversion there).

[ChangeLog][QtCore][QString] Constructing a QString from a QByteArray
will not stop at intermediate '\0' (null) characters in the string as
in Qt 5, but will convert all characters in the byte array.

Change-Id: I1f6bfefe76dfa9072b165903fec7aa4af1abd882
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-05 10:12:04 +02:00
Joerg Bornemann
c09df7b57c CMake: Implement configure -reduce-exports
This option maps to FEATURE_reduce_exports. The feature is on by
default, except for MSVC. The reduce_exports configure test is not used
in the CMake build.

The <LANG>_VISIBILITY_PRESET and VISIBILITY_INLINES_HIDDEN target
properties are now explicitly initialized in the
qt_set_common_target_properties function, because we don't have access
to the feature in QtSetup.cmake where the CMAKE_<LANG>_VISIBILITY_PRESET
variables were set before.

Task-number: QTBUG-85373
Change-Id: I378453f0e0665731970016170302871e20ceb4e2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-05 10:05:20 +02:00
Lars Knoll
313ed3d19a Use QStringTokenizer instead of QStringView::split
This nicely optimizes a hot spot when our HTML parser was loading
Qt documentation. This change improves the loading time of the
Qt Concurrent overview page by 30%, both over the previous commit
and 5.15.

Fixes: QTBUG-86354
Change-Id: I4f401c2e6048096444e482c7724e3e3a6c71516e
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-10-05 09:57:13 +02:00
Lars Knoll
1b06c07115 Don't store QTextHtmlParserNode by value in a QList
This is a performance bottleneck as the parse nodes are huge and
we don't want to reallocate them all the time.

Fixes: QTBUG-86354
Change-Id: Ia437acbb5b2c8af1723932d2cd96ba2ae48a871b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-10-05 09:57:08 +02:00
Edward Welbourne
0ad96eac38 Implement date-time fromString(QStringView...) methods
Inline the QString versions. One const QString & variant remains in
each case: the date-time parser keeps a copy of the string it's been
given, so the methods calling it have a hybrid method taking the
string as the text to parse along with a view as the format. This
avoids copying the string when the caller has an actual QString to
pass in; the version with QStringView for both parameters has to
toString() the text to be parsed, at some point on the way into the
parser, but we can avoid that in the QString-accepting ones.

Fixes: QTBUG-86172
Change-Id: I6a4390df90945af74a5eac2f0a752febd925ad62
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-05 09:46:58 +02:00
Andrei Golubev
3929fd3c56 Do not use QHash's aeshash() under Clang's sanitizer
aeshash() has a heap-buffer-overflow when the passed in buffer length is
less than 16 bytes (and I expect there's a similar issue when we process
the tail when length is not divisible by 16). Despite being a real issue,
the code has guarding mechanisms to make sure that:
1) no crash happens
2) out-of-range bits are not used in the computation

Disabled the usage of aeshash() under Clang's sanitizer similarly to how
it was done for GCC (apparently it uses its own preprocessor mechanism).
Likely, this will pop up again with MSVC, but I have no clue which
defines it uses

Task-number: QTBUG-87112
Task-number: QTBUG-86051
Change-Id: I614d7b3082e91c9d16e0441649d6a153b222bd2e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-05 09:33:07 +02:00
Samuli Piippo
623e866d5c CMake: set default eglfs device integration plugin
Use QT_QPA_DEFAULT_EGLFS_INTEGRATION for setting the default eglfs
device integration plugin, which can be overwritten at runtime using
QT_QPA_EGLFS_INTEGRATION environment variable.

Change-Id: I1c3ac0c58cdbbb7bb08c2f0ea5abe4d04eb8d61a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-05 10:02:37 +03:00
Samuli Piippo
9692015d92 CMake: enable egl_viv plugins
Add needed define for egl_viv compile test and generate CMakeLists
for the egl_viv plugins.

Task-number: QTBUG-77809
Change-Id: I3b354faee36cbb85adcee895430eb5e8998108e1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-05 10:02:30 +03:00
Christian Heimlich
041868964d Group, cleanup, and consolidate QProgressDialogPrivate member variables
Members grouped and reordered for better alignment, all booleans
initialized in the constructor's member initialization list, and snake
case names changed to camel case for consistency.

Change-Id: Ib59ed770a3d4e307296722270cd991a9a53c72ce
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-05 01:46:28 +00:00
Allan Sandfeld Jensen
c82f73666d Replace Q_DECL_UNUSED with [[maybe_unused]]
Use C++17 attribute directly

Change-Id: Id853e7a5117065e4adb549f81303c1820fe198ce
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-03 11:58:08 +02:00
Giuseppe D'Angelo
889d40ebe2 Centralize the implementation of move assignment operators
At the moment we have two main strategies for dealing with move
assignment in Qt:

1) move-and-swap, used by "containers" (in the broad sense): containers,
but also smart pointers and similar classes that can hold user-defined
types;

2) pure swap, used by containers that hold only memory (e.g. QString,
QByteArray, ...) as well as most implicitly shared datatypes.

Given the fact that a move assignment operator's code is just
boilerplate (whether it's move-and-swap or pure swap), provide two
_strictly internal_ macros to help write them, and apply the macros
across corelib and gui, porting away from the hand-rolled
implementations.

The rule of thumb when porting to the new macros is:

* Try to stick to the existing code behavior, unless broken

* if changing, then follow this checklist:

  * if the class does not have a move constructor => pure swap
    (but consider ADDING a move constructor, if possible!)

  * if the class does have a move constructor, try to follow the
     criteria above, namely:

    * if the class holds only memory, pure swap;

    * if the class may hold anything else but memory (file handles,
      etc.), then move and swap.

Noteworthy details:

* some operators planned to be removed in Qt 6 were not ported;

* as drive-by, some move constructors were simplified to be using
qExchange(); others were outright broken and got fixed;

* some contained some more interesting code and were not touched.

Change-Id: Idaab3489247dcbabb6df3fa1e5286b69e1d372e9
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-10-03 11:47:17 +02:00
Giuseppe D'Angelo
990e2e4fb8 QAppleLogActivity: add a swap() method
Change-Id: Id698d71fbadf5bd0301a346b3216847d0b2f0b54
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-10-03 11:47:15 +02:00
Giuseppe D'Angelo
c441e2cc47 QMacKeyValueObserver: code tidies
Fix the constructors and the signature of swap().

Change-Id: Ib294bb2c054510170b166b5c8bd3180d22177efc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-10-03 11:47:14 +02:00