Commit Graph

45291 Commits

Author SHA1 Message Date
Laszlo Agocs
d737db8734 Clarify ResetNotification in QSurfaceFormat a bit
Add some more details to make it a bit easier for advanced users
to grasp what this is about.

Task-number: QTBUG-80257
Pick-to: 5.15
Change-Id: I9969b5b62384a25d5e90b57ef25c83a8a2a6c9c7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-04-24 10:46:52 +02:00
Marc Mutz
b32fc18381 QUrlIdna: re-enable NRVO
Change-Id: Id4f9b14f4255c661a0313ca18b0c5af5c55880e7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-24 10:41:59 +02:00
Andy Shaw
dddd197d42 Deprecate QGuiApplication::fontChanged() signal
Rather than have a fontChanged() signal which can be connected to for
tracking when the application font has changed, then it is better to
use the event that is sent to all windows and the application itself.
That way it is easy for a window/widget or item that cares about the
change to the application font to catch it in the event() function.

[ChangeLog][QtGui][QGuiApplication] Deprecated fontChanged() signal in
favor of QEvent::ApplicationFontChanged.

Change-Id: Iae8e832238fc85e385a52305bc04f16e597454b0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-24 10:10:55 +02:00
Kai Koehne
44e8c90ad4 Do not mention Qt XML's SAX API anymore in examples/xml/README
The SAX API in in Qt XML got deprecated, and examples using it
removed in commit 82d02b7b95.

Pick-to: 5.15
Change-Id: I39b71378c0f797e82431c8a0e12255626ed145ed
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-04-24 09:47:41 +02:00
Kai Koehne
40001d4a53 Doc: Remove mentioning of QXmlSimpleReader from QXmlStreamReader
Pick-to: 5.15
Change-Id: Ieba073c21f666421ab519089e0976880e67ad0b1
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-04-24 09:47:26 +02:00
Lars Knoll
9260662cb1 Fix compilation of thee OCI driver
Amends change befd198c15

Change-Id: I11cc116d31fa1f71acd9579e60a6b265811def1e
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
2020-04-24 08:42:12 +02:00
Leander Beernaert
43031d98fc CMake: Allow sqldriver plugins to be built as standalone
This patch allows all the sqldrivers to be built as a standalone project.
It is not possible to build each plugin separately due to the configuration
features definition being located in the sqldriver's folder CMakeLists.txt.

In other words, the project needs to be generated from the
src/plugins/sqldrivers/CMakeLists.txt file.

Fixes: QTBUG-82962
Change-Id: If41c7e3827589391830a894a9c998d2e56239562
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-24 07:41:13 +02:00
Leander Beernaert
dd7e40b108 CMake: qt_find_package() enable debug behavior by default
Without this behavior enabled by default it is currently not possible to
build QtVirtualKeyboard as a static build. We run into the error where
cmake is trying to promote the targets to be global due the XCB library
already being found by one of the modules in QtBase.

In case we wish to disable this fix, any module can simply specify
QT_FIND_PACKAGE_DISABLE_DEBUG_BEHAVIOR=ON during configuration time.

Change-Id: Id7f2ad12ddea941dda754361660c7606439cd5a4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-24 07:41:11 +02:00
Marc Mutz
35848f2a32 QUrl: fix implicit int->QChar conversion
They're becoming explicit.

Change-Id: I1221ee8fb3b373a991ddedc66a50f5d3b501876f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-04-23 18:45:38 +02:00
Vitaly Fanaskov
9ba0715f08 QFuture: the result type doesn't have to be a default-constructible
Added asserts to insure the invariant declared in the documentation.
Canceled future object is not valid, hence we don't need to handle
this case separately.

Fixes: QTBUG-83389
Change-Id: Ib0653ef40cd3135574a91740e4ce2c6dc4da8a71
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-04-23 17:09:52 +02:00
Volker Hilsheimer
23b998fa45 QWidget: fix regression when changing focus proxy while it has focus
This follows up on commits 3e7463411e and
947883141d.

The changing of the pointer of QApplicationPrivate does not transfer
focus properly. It updates the pointer, but it doesn't deliver events
or update the widget hierarchy's focus chain. The result is that
multiple line edits might show a blinking cursor.

Instead, use QWidget::setFocus when the focus proxy has changed while
it had focus, and pass OtherFocusReason rather than NoFocusReason.

Add a basic test for QWidget::focusProxy, which exercises this code
path and verifies that pointers are consistent when focus changes as
a side effect of modifying the focusProxy.

Change-Id: I15a4d868bab2b590cfe4a1daa6a3c8cebc9c9ca2
Fixes: QTBUG-83720
Fixes: QTBUG-79707
Pick-to: 5.15
Reviewed-by: David Faure <david.faure@kdab.com>
2020-04-23 16:19:07 +02:00
Edward Welbourne
89dc1a1865 Make t specifier for time-zone only apply to date-time
It previously applied to dates and date-times, but was documented as
applying to times (and date-times then included it by reference).
It's only meaningful for a date-time.

Change-Id: Id9e8e8cb987b03e5ddc77b05c581b9b6944065fc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-23 12:11:35 +02:00
Marc Mutz
5c1446e3fa QImage: optimize convertWithPalette()
The old code got a QMap serialized as a QString and parsed it to
re-create the same map.

Just copy the map.

Change-Id: Ic71b9fa9d822eab53fe37dfb4d76223cd69ac057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-04-23 08:38:49 +00:00
Albert Astals Cid
871e2981dd QStringLiteral: Remove const temporary that may prevent optimization
clang-tidy 10 was complaining about
http://clang.llvm.org/extra/clang-tidy/checks/performance-no-automatic-move.html

Change-Id: Iea5276e401a10f3ead8599e135dec1f0fa63a0dc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-23 10:30:44 +02:00
Laszlo Agocs
574898c9eb vkmemalloc: make it compile with macOS 10.15 SDK
Simply rename the function in order to not clash with aligned_alloc()
that is marked as 10.15 only (and thus would need annotation etc.) in
the 10.15 SDK. (note that aligned_alloc is a C11 function which was
presumably not present in earlier SDKs, by renaming our own version
everyone will be happy, hopefully)

Change-Id: Iee400d81df6a0af4fa2129358ed27b049720685b
Pick-to: 5.15
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-04-23 10:20:00 +02:00
Laszlo Agocs
3ef7a760ff rhi: Take mip size into account for render target size
Also extend autotesting, both for rendering into a given mip level
and for rendering into a given cubemap face.

Change-Id: Ida94b71150477ceb50a3b5616d8b7be13174558b
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-04-23 10:19:53 +02:00
Joerg Bornemann
4545eadd3e CMake: Port the 'static_runtime' feature
This feature is Windows-only and must be turned on manually.
For MSVC it sets the MSVC_RUNTIME_LIBRARY target property.
For MinGW it adds the -static linker flag.

Change-Id: I9da3b88d545b34bc34a3a80301b2dd1b5986fa88
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-23 10:09:15 +02:00
Joerg Bornemann
1c7950081f Remove checks for glibc < 2 from qplatformdefs.h files
The last release of glibc 1 was 1995 and can be considered outdated.

Also, the current check prevented building with e.g. musl libc.

Every file that includes common/posix/qplatformdefs.h already has
QT_SOCKLEN_T defined to socklen_t, so remove the definition from those
completely.

This is a continuation of 813f468a and a421e409.

Change-Id: Icf2692a8e814286487662e290a8f844872eefe53
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-23 06:41:32 +02:00
Qt Forward Merge Bot
8058e11012 Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-04-23 01:38:52 +02:00
Gustavo Carneiro
09da7f470e Add .vscode in git ignore list
Add a .vscode line in the .gitignore file to ignore the Visual Studio Code auto generated files.

Add a .vscode line in the .gitignore file to ignore the Visual Studio Code auto generated files.

Change-Id: Ifbcf82a9c23b4ecf35ae9fd84787f7e1e29df47b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-04-22 20:38:52 -03:00
Qt Forward Merge Bot
7f895553ac Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Iaa439ba7dff19a17e3716b3d30f49f60fa6e38f8
2020-04-23 01:00:36 +02:00
Tor Arne Vestbø
0c6b4dd4ad macOS: Don't optimize out aggressive backingstore flushes when single-buffered
Comparing the layer contents to the backingstore surface doesn't make
sense when we're single buffered since we're always using the same
surface.

And once Core Animation has picked up on the surface it's not enough to
just keep drawing to it, we also need to tell Core Animation that the
contents has changed.

Change-Id: I517a0b7a3ba7e9d96033465c9bd5a192985643ac
Fixes: QTBUG-81071
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-04-22 23:46:44 +02:00
Friedemann Kleint
65636ed060 Documentation: Add examples for Q_NAMESPACE(_EXPORT)
It is not obvious how to use them.

Change-Id: I60fdfb95f4c29cbc310d149495ebb38964e5a9ac
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-04-22 22:03:46 +02:00
Qt Forward Merge Bot
c6128fc67c Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-04-22 19:17:52 +02:00
Eskil Abrahamsen Blomfeldt
f761ad3cd9 Use consistent vertical metrics on all platforms
Qt assumes that ascent+descent is the bounding height of the
text, but for historical reasons, the ascent for some fonts
will not contain the diacritics. On Windows, the preference
is to use data from the OS/2 table which were explicitly
invented to work around this, but on other platforms we
are not respecting this table. This causes a text layout
that looks fine on Windows to have overlapping characters
on e.g. macOS.

To make vertical metrics (ascent, descent, leading) consistent
across all platforms, we don't blindly trust the values we get
from the underlying font system, but apply in the following order:

1. If OS/2 table exists and USE_TYPO_METRICS flag is set, we
use the typo metrics from OS/2 table
2. If OS/2 table exists and USE_TYPO_METRICS flag is not set,
we use winAscent/winDescent from OS/2 and the line gap from
HHEA table.
3. If no OS/2 table exists, we try to get ascent, descent and
line gap from the HHEA table.
4. If the HHEA table does not exist (not an SFNT), we fall back
to the system-provided metrics. (on macOS, we know the
system-provided metrics will match the data in HHEA, so we
skip parsing that table and use the data from CoreText if
there is no OS/2 table).

Task-number: QTBUG-80554
Change-Id: I41e6561a99513698c8e42451b4ec98bd5eb6892f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-04-22 16:18:57 +02:00
Qt Forward Merge Bot
efd7757154 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/widgets/widgets/qabstractbutton.cpp
	src/widgets/widgets/qbuttongroup.cpp
	src/widgets/widgets/qbuttongroup.h
	src/widgets/widgets/qsplashscreen.cpp
	tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp
        tests/benchmarks/opengl/main.cpp

  Needed update:
	src/plugins/platforms/cocoa/CMakeLists.txt

Change-Id: I7be4baebb63844ec2b3e0de859ca9de1bc730bb5
2020-04-22 15:28:01 +02:00
Liang Qi
e0a78bf450 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-04-22 11:53:25 +00:00
Friedemann Kleint
7d8093df55 Windows QPA: Fix High DPI scaling not becoming active when changing scaling
When changing scaling from 100%, at which High DPI scaling is inactive,
to something larger,  High DPI scaling does not become active.

Update the factors when screens are refreshed.

Pick-to: 5.15
Task-number: QTBUG-77302
Task-number: QTBUG-77136
Task-number: QTBUG-82267
Change-Id: Iebbc29ced2f23af9db4d67839458848245e2db1d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-04-22 11:31:51 +00:00
Edward Welbourne
0be6a98ab6 Standardise language about quoted text in date/time format strings
Change-Id: Iaaeff8cd28a23b878ca07d716e67d4bd9fbb8176
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-04-22 13:14:46 +02:00
Andrei Golubev
7605451604 Handle specified time-spec in date-time parsing
When a date-time was parsed from a string, the result was equal (as a
date-time) to the correct value, but had (at least in some cases) the
wrong spec, where it should have had a spec reflecting the zone
specifier parsed.

The time-spec imposed for the benefit of QDateTimeEdit is now moved
from QDateTimeParser to QDateTimeEditPrivate, which takes over
responsibility for imposing it. QDateTimeParser assumes Qt::LocalTime
in member functions (where applicable) and uses the time-spec parsed
from the string when constructing the date-time.

QDateTime::fromString() and QLocale::toDateTime() are updated to
use the full QDateTime returned by QDateTimeParser.

Fixes: QTBUG-83075
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I8b79add2c7fc13a200e1252d48dbfa70b36757bf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-04-22 14:14:30 +03:00
Timur Pocheptsov
6c45b1817f SslSocketClient - fix example not to crash
Due to the bug related to the 'new syntax' signal/slot connections,
it's unfortunately possible to have a connection not deleted properly
by the moment children objects get deleted. Then, as a result,
in e.g. QSslSocket's destructor the socket will change its state,
triggering the (now deleted) UI elements' access.
Note - the original  bug was reported, the patch (only possible?) was
not accepted.

Fixes: QTBUG-83659
Change-Id: I2965532485bcd46f93f8449e4d0a30da92b572c5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-22 13:03:45 +02:00
Liang Qi
70a5ff0997 Merge remote-tracking branch 'origin/5.14' into 5.15
This reverts commit 3a6d8df521.

That change is only for 5.14.

 Conflicts:
	src/plugins/platforms/wasm/qwasmeventtranslator.cpp
	src/plugins/platforms/wasm/qwasmintegration.cpp
	src/plugins/platforms/wasm/qwasmopenglcontext.cpp
	src/plugins/platforms/wasm/qwasmscreen.cpp

Change-Id: Ib9151e199291fe6eb4151027b515393c05303d65
2020-04-22 10:10:23 +00:00
Leander Beernaert
6fbeef4c6b CMake: Add qt6_add_plugin public API
This patch adds a publicly callable qt6_add_plugin() API to create
plugins. This API is meant to cover cases such as the plugandpaint
example.

This patch also renames qt_add_plugin to qt_internal_add_plugin in order
to avoid clashes with the public API. To avoid breaking the existing
projects, a compatibility wrapper function is enabled by default unless
QT_DISABLE_QT_ADD_PLUGIN_COMPATIBILITY is specified.

Fixes: QTBUG-82961
Change-Id: If5b564a8406c90434f1bdad0b8df76d3e6626b5f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-22 09:51:12 +02:00
Friedemann Kleint
26a0a89421 Fix assigning int QFlag-type properties
Ensure they are handled as enumerations in QMetaType.

This is required for handling QFlag-type properties in Qt Designer

Fixes: QTBUG-83689
Change-Id: Ifbfb5c5b5cd34fce462e299505d063e22e725c2e
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-04-22 09:49:48 +02:00
Joerg Bornemann
1c80d056e4 Port QT_NO_TOOLTIP to QT_CONFIG(tooltip)
We remove the QT_NO_TOOLTIP check from qstandarditemmodel.h, because as
the 'tooltip' feature is in QtWidgets, we cannot use it properly in
QtGui. Also this affects just two non-virtual inline methods, i.e. it
has no effect on library size.

Task-number: QTBUG-82785
Change-Id: Ic166f14fb1cf3e9dd789573a6b9db6a87fb50e10
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@kdab.com>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2020-04-21 20:35:29 +02:00
Topi Reinio
e10e5318bc Doc: Fix documentation warnings for Qt Core
qsocketnotifier.h:113:69: error: cannot initialize return object of type
    'Qt::HANDLE' (aka 'void *') with an lvalue of type 'const
    QSocketDescriptor::DescriptorType' (aka 'const int')

qsortfilterproxymodel.cpp:2938: error: out-of-line definition of
    'recursiveFilteringEnabledChanged' does not match any declaration in
    'QSortFilterProxyModel'

qline.cpp:376: (qdoc) warning: Cannot find 'QLineF::IntersectionType'
    specified with '\enum' in any header file

Fixes: QTBUG-83676
Change-Id: I57b51f4ad15fdc50db88100ad5b1cb85ed394b7a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-04-21 17:50:02 +02:00
Lars Knoll
fbb7c98e91 Remove unused forward declaration
Change-Id: Ice9c83f5ef2f0178e999836dcb21140bb8ab8b64
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-04-21 15:46:52 +02:00
Lars Knoll
ff0d02eb2f Remove QTextCodec dependency from QClipboard
QClipboard used QTextCodec to convert the war clipboard data to
a QString. HTML is nowadays always encoded as utf8, and we were only
supporting utf based encodings for other text.

Add a qFromUtfEncoded() to our UTF helpers that auto detects utf16
and utf32 byte order marks, and assumes utf8 otherwise, to keep
this compatible with what we have been doing in Qt 5.

Change-Id: I5a9fccb67a88dff27cbbdecff9bd548d31aa1c6c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-04-21 15:46:43 +02:00
Lars Knoll
50916edd9d Always encode HTML as utf-8
When converting a text document to HTML, always convert it to utf-8,
as required by the HTML standard. This also means that we remove
the optional encoding parameter.

Change-Id: I0bd2fc9df2d06734e1c5b8053b964fbfbb6881e1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-04-21 15:46:36 +02:00
Lars Knoll
a23cb5cd06 Always save QTextDocuments encoded in utf-8
Get rid of the options to set another encoding. In 2020,
we should always write documents as utf-8.

Change-Id: If39dd3a876f85a70735169113bce9c25f2d981b3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-04-21 15:46:29 +02:00
Kai Koehne
29de3412ad Doc: Also fix qdoc signature of qHash(const QTypeRevision &key ...)
Amends c6cdf38e75

Change-Id: I1d14bb46d1cbe8568bb923e68b6423cb3ff7e8ed
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-04-21 15:29:24 +02:00
Laszlo Agocs
763752ded1 Avoid using qGuiApp in QOpenGLVao::destroy()
There are convoluted cases, based on the backtrace attached
to the associated bug report, where we attempt to destroy a
QOpenGLVertexArrayObject during the destruction of Q(Gui)Application.

Just avoid accessing qGuiApp in destroy(). Rather, store it in create().

Fixes: QTBUG-75138
Pick-to: 5.15
Change-Id: If8e67301c0843cbf3a409dcf427f44c42079de2f
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2020-04-21 14:30:10 +02:00
Laszlo Agocs
1d7965fc41 windows: Add QT_NO_OPENGL_BUGLIST environment variable
The typical approach of setting QT_OPENGL_BUGLIST to a non-existing file is neither
documented nor is very friendly. Instead, add a QT_NO_* style of variable that
skips reading the JSON config file altogether.

This can then be used in more exotic, possibly virtualized, environments to disable
the driver and adapter discovery, and instead assume that OpenGL is available and
fully usable.

Task-number: QTBUG-82372
Pick-to: 5.15
Change-Id: I192baa83c5d9760ee27873385a246fef87421b16
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2020-04-21 13:49:47 +02:00
Laszlo Agocs
8524d29ce8 Prevent asserts in certain QWindow re-creation cases
Amends 402efef57b. The original patch
has a problem, namely that it directly calls QPlatformWindow::requestUpdate()
instead of going through QWindow::requestUpdate(). As there is a chance that
an update gets scheduled between the creation of the QPlatformWindow and this
extra, optional invocation of requestUpdate() at the end of QWindow::create(),
this becomes quite unsafe because QPlatformWindow, unlike QWindow, is not
graceful: it will just assert if there is a pending update still.

Solve the whole thing by storing the updateRequestPending flag of QWindowPrivate,
then resetting it, and then going through the safe, public
QWindow::requestUpdate() when our copy of the flag says so.

Task-number: QTBUG-81400
Task-number: QTBUG-70957
Pick-to: 5.15
Change-Id: I99aedfae3928b75301b46a4666c169e657ff8079
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-04-21 13:03:39 +02:00
Edward Welbourne
06d431e37f Rework country setting to match how we return the script setting
Change-Id: I753673ef79b4ad208fa6e0c6a4eb8139cd2ee253
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-04-21 11:46:37 +02:00
Edward Welbourne
4c3ec0caa8 Revert "Revert "QLocale: Actually get the language script for the system locale""
This reverts commit 449390c3a5.
QLocale::system() should behave consistently.
If UI widgets are consulting the system locale where they should be
consulting their configured UI locale, that is a bug in the UI widget
and should not be "fixed" by breaking QLocale.

Change-Id: Ib31cf7882a28b26f9a018fba3adabba94a8c43bf
Pick-to: 5.15
Fixes: QTBUG-49031
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-04-21 11:46:26 +02:00
Edward Welbourne
589e34eb32 Don't fall back to QGuiApplication for line control's layoutDirection
If the widget whose line control we are has its own locale setting,
then we should use that rather than the default UI layout direction.
Instead, the client of the QWidgetLineControl needs to handle the case
where auto-detection of the text direction can't be done based on the
content of the line control.

Fortunately, QWidget's handling of text direction handles setting to
auto gracefully as unsetting, on which it consults the parent widget
to set a sensible default.

Change-Id: Id0d247f1e6e7219b6d0ece5856ca93ee87778c74
Pick-to: 5.15
Fixes: QTBUG-53110
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-04-21 09:46:14 +00:00
Jarek Kobus
df234035d0 Squash again some tests in concurrentmap
After adding new tests, the source code of tst_concurrentmap
grows rapidly with copy/paste/replace pattern.
This intoduce the issue with maintaining the test.
Get rid of separate functions for testing blocking versions
of mapped/mappedReduced and test blocking versions in parallel
with non-blocking flavors. So again, get rid of duplicated code.

Task-number: QTBUG-83258
Change-Id: I4cac6f4e1bfd1b50363dc094610717674aebf2af
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-04-21 10:28:06 +02:00
Jarek Kobus
d998a467ac Add more tests for QtConcurrent::mappedReduced()
Test the case where reduce function of the form:
V function(T &result, const U &intermediate)
has T and U types different. Make use of
numberSumReduce function and corresponding functor
that reduce Number class object to the result of int type.

Fixes: QTBUG-83258
Change-Id: I194d290988b48e7bca91228c0cd5d39efd1b4712
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-04-21 10:22:26 +02:00
Jarek Kobus
82729ddb2a Get rid of code repetition in concurrentmap test
Move tests with initial value next to their original version.
Join new lambda tests into a common functions
testing all possible 16 combinations of
functor / function / member / lambda, as they
test in fact the same function. There is no need
to distinguish lambda case over other cases.
This helps in test readability and maintenance.
Add missing tests for lambdas with a combination
of initial value.

Task-number: QTBUG-83258
Change-Id: I7a3d2bf87384d7feecffaaf39281cd626955b0a4
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-04-21 10:03:49 +02:00