Commit Graph

40600 Commits

Author SHA1 Message Date
Marc Mutz
aadf64f084 QtGui: port from QMutex::Recursive to QRecursiveMutex
Change-Id: I1ce4fcfa1bfb9a89fe3ebe61d049b9b3100fd700
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-07-06 17:14:31 +02:00
Marc Mutz
5de9dedbc7 QtNetwork: bearer: port from QMutex::Recursive to QRecursiveMutex
Change-Id: I691ecbaf9ea0796decbb48fd62b25d0a2941d979
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-07-06 17:14:28 +02:00
Marc Mutz
f574560948 Fix compilation with C++20
Implicit capture of 'this' in [=] is deprecated in C++20.

Fix by using explicit captures.

Change-Id: I1633446f4670202b0d1aca938d8c27dbc0c1411e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-07-06 11:57:31 +00:00
Marc Mutz
cd113d0dcb Port some trivial cases from QMutex to QRecursiveMutex
In all of these cases, the effect of the change is local to one file.

Change-Id: I3bda3aadee3b42e7797183c2330183390b92d1f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-07-06 11:22:37 +02:00
Marc Mutz
95310aac6d Short live QRecursiveMutex!
Move the recursive mutex use case out of QMutex into a separate class,
unsurprisingly called QRecursiveMutex. As an immediate benefit, 90% of
the QMutex users now enjoy a constexpr QMutex ctor.

This change prepares for a real split in Qt 6, so that both use-cases
are no longer bundled up in one class.

[ChangeLog][QtCore][QMutex] Added QRecursiveMutex as a replacement of
QMutex(QMutex::Recursive).

Change-Id: I79b8724e8a8ee65e4bd0f06acd76103fe4197b8c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-06 11:22:16 +02:00
Tasuku Suzuki
a393ea0729 Fix build without features.itemmodel
Change-Id: I1235bed395a47438bc18571e2331a3432e274dec
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-07-06 17:54:13 +09:00
Tasuku Suzuki
e36247754e Fix build without features.mimetype
Change-Id: I8c5521c5cfbc6c13c78d2bc8805fa5a021675b6c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-06 17:41:02 +09:00
Nicolas Fella
5ca2b081fe [androidcontentfileengine] Catch SecurityException during file opening
resolver.openFileDescriptor throws a SecurityException when the caller doesn't have sufficient permissions to access the URL. This will make an application crash.

We should handle this case gracefully and report it to the user. I'm unsure if there is a better way to do this than simply logging the exception.

Change-Id: I36bfbd3e398c8176e57042a27740aa15bce63a7c
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-07-05 21:46:06 +02:00
Marc Mutz
90a29a73f8 QHostInfo: fix a race condition on wasDeleted
The plain bool variable wasDeleted is set to true in the
QHostLookupManager dtor before the call to clear(), which calls
waitForDone() on the thread pool performing the lookups. All tasks on
the thread pool start by checking this variable so as to return early
when destruction is in progress. But the check was outside the
mutex-protected area, so as a non-atomic load, without a
happens-before relation to the write, this is a Data Race, thus UB.

Fix by moving the check past the mutex locking into the critical
section. This way, tasks that were waiting for the mutex after seeing
no wasDeleted before get the message reliably.

This does not introduce a dead-lock, since the call to waitForDone()
is outside any mutex protection leaving a window for the tasks to
obtain the mutex and react on wasDeleted.

Change-Id: Ied4b9daa7dc78295b0d36a536839845c4db2fb78
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2019-07-05 18:50:12 +00:00
Christian Ehrlicher
298f750cdb QComboBox: revert deprecation of currentIndexChanged(QString)
QComboBox::currentIndexChanged(QString) was deprecated due to the fact
that there is a currentTextChanged(QString) signal but this signal is
not equivalent to the other since it's also emitted when the lineedit
text changes.
Therefore revert the deprecation of this signal.

Fixes: QTBUG-76890
Change-Id: Ia314116a5ac4e43e60383da9e729e24ffb3e8b30
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-07-05 20:00:41 +02:00
Liang Qi
9bc92cdcfd Merge "Merge remote-tracking branch 'origin/5.13' into dev" 2019-07-05 19:36:41 +02:00
Tasuku Suzuki
5d79f38370 Fix build without features.library
Change-Id: I3ce4a8e4c6488737115f2f16bfd8f0e1fc5fc4fa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-06 02:33:41 +09:00
Tasuku Suzuki
6b26b2ee03 Fix build without features.action
Change-Id: Ia776cdcb36d07bb89f39c631029458adf2187d90
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-06 02:25:16 +09:00
Martin Smith
0a37378e7a doc: Remove erroneous double left brace
A double left brace in a link command was causing qdoc to fail for
the remainder of the qdoc comment. This update just removes one of
the left braces.

Change-Id: Ie4fc0122e0799955b7804c2b6f61393af01747c7
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2019-07-05 18:40:23 +02:00
Gatis Paeglis
b55fac3f37 xcb: reduce focus-in delay
This patch amends fe63900dc9

The previous value of 400ms was a random and seemingly harmless choice.
It turns out that 400ms is a bit too long and interferes with x11 async
behavior tweaks in the VirtualBox source code.

The original aim of specifying a concrete delay was to fix the
nondeterministic behavior of the pre-existing code and to avoid flickering
on KWin caused by waiting too little. This patch changes 400ms -> 100ms,
which seems to work better in practice.

Fixes: QTBUG-76742
Change-Id: Ia8168216819ac41d0124622c9472a98a1877262f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-07-05 14:29:08 +00:00
Alexandru Croitor
44602224bf CMake: Put the static dependencies into the relevant configuration
When adding the static dependencies for a module, they should be
added to the debug|release configuration as appropriate, otherwise
it ends up adding the debug version of the libraries to the release
configuration as well as the release version of the libraries.

Implementation wise, that means we have to use generator expressions
of the form $<$<CONFIG:Configuration>:${dependencies}>, because
INTERFACE_LINK_LIBRARIES does not have a
INTERFACE_LINK_LIBRARIES_<CONFIG> equivalent that can be set per
configuration.

Note that the condition part of the generator expression can not
explicitly check for Debug or for Release, because a user can
configure their application without specifying CMAKE_BUILD_TYPE,
which means that both Debug and Relase conditions would fail.
So the actual condition has to be isDebug or isNotDebug.

The same approach is used for INTERFACE_LINK_OPTIONS.

For debug_and_release builds we use the isDebug and isNotDebug
conditions for the generator expressions.

For singular builds (only release or only debug), we set the
generator expression condition to "1" aka always true.
This means that the Qt libraries and link options will always be used
regardless of the configuration with which the CMake application
is configured with.

Fixes: QTBUG-76337
Task-number: QTBUG-38913
Change-Id: I5369d8ba083359a4a92253dbd1dabe9d1efa34db
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-07-05 15:59:13 +02:00
Friedemann Kleint
85dc392135 QWidget::restoreGeometry(): Fix Windows being restored out of screen area
Factor out the screen area check to a separate helper and apply to
restoredGeometry, too, fixing an oversight of
2f2bfc4e59.

Change-Id: I795d8d5e3cddb5e986c96c08a342d69063d04970
Fixes: QTBUG-76900
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-07-05 15:39:22 +02:00
Friedemann Kleint
f66c22ff5b QWidget::restoreGeometry(): Remove code related to restoredFrameGeometry
restoredFrameGeometry is only used for a sanity check in format
version 0, add a comment and remove code.

Task-number: QTBUG-76900
Change-Id: I797b07d069f8568cb39541bcbe9009935a4a79f7
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-07-05 15:39:09 +02:00
Eskil Abrahamsen Blomfeldt
94570dc49a Support pen color in QOpenGLTextureGlyphCache
This is an enabler for supporting pen color for color fonts in
Qt Quick.

Task-number: QTBUG-74761
Change-Id: I3e605f939e6677cbbd4a650ae7998dea8fd2d7a9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-07-05 13:38:14 +00:00
Liang Qi
deee7b7ece Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	.qmake.conf
	qmake/generators/makefile.cpp

Change-Id: Ifb2633a69d0bf8cdf12d799c6259beefc279c49e
2019-07-05 15:37:50 +02:00
Andre de la Rocha
a4718f1274 Fix the appearance of QSpinBox arrows on high-DPI displays
A previous change to QLineEdit::sizeHint() has caused the QSpinBox
arrows to break the widget frame on a high-DPI display with some
particular scale values like 150 or 175%. This change updates
QLineEdit::sizeHint() so that it has a minimum height, using the same
values used in 5.11.

Fixes: QTBUG-76047
Change-Id: I21f3e736da473b10fdf52e5a60e5fc5d07f270a1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-07-05 11:56:34 +02:00
Mårten Nordheim
4cb0749250 tst_QTcpSocket::hostNotFound Only expect failure for the http proxy
When I added the QEXPECT_FAIL the http proxy was the only one.
That's no longer true after fixing the SOCKS proxy, so let's make the
condition more specific.

Change-Id: I1eaa5117d5d0219e04cbd091ec54e522fe7b5509
Reviewed-by: Dimitrios Apostolou <dimitrios.apostolou@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-07-05 11:27:02 +02:00
Sona Kurazyan
b0cd007335 Remove usages of QSysInfo's deprecated APIs
- Replaced QOperatingSystemVersion::WindowsVersion,
  QSysInfo::windowsVersion(), QSysInfo::macVersion(),
  QSysInfo::MacintoshVersion with QOperatingSystemVersion::current().

- Added QOperatingSystemVersion::WindowsVista for convenience, as it
  is used in lots of places.

Change-Id: If9c4ac496005b2e70b5c70be160747afa74b98c1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-07-05 09:26:17 +00:00
Sona Kurazyan
9b3e8b32f2 Remove usages of deprecated APIs of corelib
- Replaced the usages of deprecated APIs of corelib by corresponding
  alternatives in the library code and documentation.

- Modified the tests to make them build when deprecated APIs disabled:
    * Made the the parts of the tests testing the deprecated APIs to
      be compiled conditionally, only when the corresponding methods are
      enabled.
    * If the test-case tests only the deprecated API, but not the
      corresponding replacement, added tests for the replacement.

Task-number: QTBUG-76491
Task-number: QTBUG-76539
Task-number: QTBUG-76541
Change-Id: I62ed4a5b530a965ec3f6502c6480808f938921aa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-05 11:25:46 +02:00
Alexandru Croitor
6ad08b9cad CMake: Fix handling of static dependencies that have spaces in path
The absolute paths of certain static dependencies can have spaces in
them. The _qt5_$${CMAKE_MODULE_NAME}_process_prl_file fails to handle
this, and simply replaces all spaces with semicolons, which obviously
breaks the list of dependencies, and a consuming application fails to
link with a message like:

LINK : fatal error LNK1181: cannot open input file 'C:\Program.obj'

This change partially restores the functionality that was added in
102e1822ff specifically the part
that changes qmake to export an additional variable
QMAKE_PRL_LIBS_FOR_CMAKE. This variable has the same content as
QMAKE_PRL_LIBS except it uses a semicolon as a separator, so that
CMake can correctly parse the separate lib entries.

This is much cleaner than trying to parse the original QMAKE_PRL_LIBS
variable with a complicated regular expression.

Amends eda28621f6.

Task-number: QTBUG-38913
Change-Id: I1d18fb779606505bc92320d8ce13232c7022e212
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-07-05 10:18:56 +02:00
Alexandru Croitor
78d67d17a6 CMake: Fix prl and library names on macOS for debug configurations
The paths to the libraries and prl files should have the "_debug"
suffix for the debug configuration. This prefix is added to the TARGET
when by qt_module.prf when doing a debug build, but not during a
debug_and_release build.
Make sure to strip the _debug suffix if it's there, and re-add it later
always, to be consistent in both debug_and_release builds and in
debug builds.

Amends a12b6e7bf6.

Task-number: QTBUG-38913
Task-number: QTBUG-75520
Change-Id: I29e88f2b991e2be06b23652d64edc768fa35a5ae
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-07-05 10:18:47 +02:00
Lars Knoll
6061e6820b Initialize variables to make coverity happy
Change-Id: Id574a114cbed04927ae380c6d97027cf4b351032
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-07-05 09:33:50 +02:00
Jan Arve Sæther
bcd4b14026 Fix qFindTestData() to work with relative resource paths
If the resource path 'base' was relative it would enter condition 3) in
qFindTestData() and it would actually find the nonsensical "://data" as a
viable candidate.  We don't want to enter that case, but rather enter the
subsequent ('Try resources') case

Change-Id: I1928ba02c941e23fee4fec9052a1981e46fa59b7
Task-number: QTBUG-73512
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-07-05 09:11:35 +02:00
Jan Arve Sæther
c4932f93d5 Do not access invalid QAccessibleInterface
Noticed this when running Qt Creator against dev

Change-Id: Ie75b2e0f2a77033ce0455d7ee3304193aa6e511c
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
2019-07-05 09:11:31 +02:00
Tasuku Suzuki
be1e682572 Fix build without feature.xmlstreamreader
This commit introduces a new feature called vkgen for the tool which
depends on xmlstreamreader.

Note that when features.vkgen is disabled, vulkan.pri will generate
dummy qvulkanfunctions.h and qvulkanfunctions_p.h because buildsystem
needs them.

Task-number: QTBUG-76159
Change-Id: I03d526a0fd76a2d8b531940f37538cead109d9d3
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-07-05 16:11:28 +09:00
Eskil Abrahamsen Blomfeldt
78caba7ae6 Support pen color with color fonts
Color fonts may also contain regular alphabet characters that
should be rendered with the current pen. In Qt, however, these
characters were drawn into the cache with a default pen color
of black.

Since all characters in a font is currently backed by the same cache,
and it would require a lot of plumbing to get around this, a step
in the right direction is to include the current pen color in the
cache as long as it is an RGB cache. This means that drawing
text with the color font with different pen colors will create
different caches.

There is no API to select font color on Freetype currently, but
this problem has also not been observed there, as the fonts
in question, with both regular and color glyphs, are not being
detected as color fonts (so the text color will be correct).
So Freetype will be left out for now.

[ChangeLog][QtGui][Text] Fixed bug where regular text rendered
with a color font would always display in black.

Task-number: QTBUG-55096
Task-number: QTBUG-74761
Change-Id: Icc7dbf73241db1e7cc6a0de18c2de927aeecf713
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-07-05 06:02:55 +00:00
Tasuku Suzuki
7b17113e49 Fix build without features.inotify
-no-feature-inotify was ignored on Linux

Change-Id: I65bab5b31740f10eacea6735119702a79df5c263
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-05 04:47:35 +09:00
Joerg Bornemann
72ebc7458d Enable ccache for non-Unix target platforms
Remove the config.unix condition from the ccache feature. This enables
us to use ccache for non-Unix cross-builds like MinGW on Linux.

Change-Id: I3b108c2288754ad5dd05834e3d5a487c2da4ac00
Fixes: QTBUG-76681
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-07-04 21:45:31 +02:00
Jörg Bornemann
adaa997ce6 Revert "Fix determination of source and build roots"
This reverts commit 224a60989e.

Turns out that we cannot just untangle the determination of
source root and build root, because this breaks the assumption
that every .qmake.conf results in a separate .qmake.cache in the
build tree. QTBUG-76140 must be fixed differently.

Fixes: QTBUG-76907
Change-Id: I5c0a3719d5e00a0f1cacad51651b47c1f284d22d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-07-04 19:44:52 +00:00
Ulf Hermann
ff561baabd Testlib: Reset the global benchmark data only if it matches
You can create multiple instances of QBenchmarkGlobalData as the ctor
is public.

The qmltest plugin does create a static one, but only conditionally
assigns it to the singleton pointer. On shutdown the plugin is removed
and the QBenchmarkGlobalData::current should only be reset by the dtor
if it's actually pointing to the same object.

Change-Id: I616c1ccf6f7a00abf1de342094da88481510bc7b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-07-04 15:39:09 +02:00
Joerg Bornemann
11d9af5d95 Unbreak the -silent build
The header clean command must not be prefixed by "@echo ...", because it
now starts with "$(CXX)" which already is prefixed.

This amends commit 6fa5dfdd.

Change-Id: I5c2e0d2c2ed91c7232fce0a4a49db0fccfdc005d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-07-04 13:16:52 +02:00
Andre de la Rocha
cc873ec23a Windows QPA: Fix blinking dot on Windows 7/8/8.1
A blinking white dot could appear on dark backgrounds on Windows 7/8/8.1.
It was caused by a workaround added to trigger the on-screen keyboard
on the Microsoft Surface. This change effectively restricts that
workaround to Windows 10, where the blinking dot was not an issue.
And anyway, impact over the Surface functionality should be minimal,
as all models produced since 2015 only support Windows 10 (and it's
unknown if the workaround was ever necessary for early models running
Windows 8.1).

Fixes: QTBUG-74492
Change-Id: Ic9b9c0f71f23b75212054c56a29796cf0efa109a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-07-04 10:05:19 +02:00
Giuseppe D'Angelo
656117100b QSet docs: don't use std::find for lookups
That code would normally call for QSet::find instead
(Uniform Container Find cannot come soon enough).

Since the code is showcasing a STL algorithm usage,
port it to std::find_if to showcase a real use case.

As a drive-by: fix the usage of endl with std::cout.
(Ok, it's just a variable called "cout", and I'd argue
that in example code "cout" is not the name of a
QTextStream).

Change-Id: I8686178b33c31552eb4d909a4089453d60994b79
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-07-04 09:22:19 +02:00
Friedemann Kleint
1bddb4ad7d QApplication::topLevelWidgets(): Avoid allocation of list
Use the QSet QWidgetPrivate::allWidgets directly instead of
calling QApplication::allWidgets(), which allocates a QList.

Change-Id: I16d289030cecefae7811d4b2c94f865f46f700d5
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-07-04 08:23:00 +02:00
Tasuku Suzuki
c50362597a Fix build without features.cursor
Change-Id: Id7617e03f86a4dd7d1ada37c91cf792bca7f1d6d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-04 09:59:52 +09:00
Lars Knoll
1e4a973b7e Use QRegularExpression for filtering in QDirIterator
Reduce our usage of QRegExp in preparation towards deprecating
it. This also brings it in line with QDir that already uses
QRegularExpression for filtering.

Keep the old QRegExp based code around in bootstrapped mode,
since qmake uses this functionality.

Change-Id: I98b9d2875c30e17e406b6711dfe3265ba37624ac
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2019-07-03 22:15:48 +01:00
Andy Shaw
faf742b05d dumpcpp: Run dumpcpp if the generated files do not exist at qmake time
By running dumpcpp if the files do not exist at qmake time we enable
the dependency finder to find these files and set up the dependencies
as appropriate. Since other changes ensure that dumpcpp will be called
at the right time when building if the typelib changes, we no longer
need to have the generated files dependent on the objects. As a
result, we are able to prevent it from unnecessarily rebuilding
everything if certain files are updated.

Change-Id: I334f48c7a980aa8b893c14cb2a4687d3b2b7a4b9
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-07-03 22:15:44 +01:00
Mikhail Svetkin
f883f8409f qtlite: Fix build with -no-feature-commandlineparser
Change-Id: Ie7b7b119073691c0d3b6358f876298fc86cfe9e9
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qbc.io>
Reviewed-by: Timo Aarnipuro <timo.aarnipuro@qt.io>
Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
2019-07-03 23:15:40 +02:00
Qt Forward Merge Bot
e72e60b107 Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" 2019-07-03 15:19:38 +02:00
Qt Forward Merge Bot
a2b221e595 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	.qmake.conf

Change-Id: I936be3c0df2b9845ff6a85eb3d4442cdabe63d37
2019-07-03 15:19:26 +02:00
Marc Mutz
f70905448f Add QT_NO_JAVA_STYLE_ITERATORS and mark QtBase free of it
... except for tests, which manually undefine the macro.

Like QT_NO_FOREACH, this is a technical way to keep JSI-free
modules JSI-free going forward.

Change-Id: Icf1342da00a700f42f9e32a253d1cdb94c38dd7e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-03 14:48:37 +02:00
Marc Mutz
f99bbfb9ea QFseventsFileSystemWatcherEngine: port some Java-style iterators to ranged-for
Amends b03385f9cf.

Java-style iterators are scheduled to be deprecated.

The general pattern used in the patch is that instead of copying an
input list, then iterating over the copy with some calls to
it.remove() (which leads to quadratic-complexity loops), we simply
copy conditionally (a la remove_copy_if instead of remove_if).

To make clearer what's going on, rename the outgoing list to
'unhandled'.

To avoid having to touch too much of the loops' structure, which
sometimes is quite convoluted, use qScopeGuard to do the append to
'unhandled', unless the original code removed the element.

Change-Id: I808a939b9c816b329ee87620e0a3461fee6e3e40
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-07-03 14:48:33 +02:00
Timur Pocheptsov
33fdd5c833 Fix a warning treated as error - 'importDevice not used'
Change-Id: Id48ff52d6532cf3585648addd498cdddccbcb994
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-07-03 14:48:28 +02:00
Marc Mutz
e1c9276c77 Optimize QSet set operations
Replace the identity check with a check for the underlying QHash
objects being shared and replace backwards iteration, which is really
forwards iteration with wrapping at bucket boundaries, with forward
iteration. QSet cannot contain duplicates, so the order in which the
RHS elements are presented to the algorithms does not matter.

Change-Id: Iad8528e3a9501b14cb85601b221a848aad91480c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-07-03 14:48:24 +02:00
Friedemann Kleint
e40a139abf QtWidgets: Fix wrong screen returned by newly added QWidgetPrivate::associatedScreen()
QWidgetPrivate::windowHandle() should not return nullptr from the
WindowHandleMode::Direct branch in case WindowHandleMode::Closest was
passed.

Ameds eed9a8fbd3.

Task-number: QTBUG-62094
Task-number: QTBUG-73231
Change-Id: Ia55fff15f0a499cef9525e53111ddd55b2e012d0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-07-03 14:48:20 +02:00