Commit Graph

11162 Commits

Author SHA1 Message Date
Edward Welbourne
5f8c6f1760 Rework testing of qstr*cmp() functions
Previously only qstr*icmp() were tested and the test data was sent via
QString and {en,de}coding. Use a local data-type to package pointers
to actual string literals for passing to these functions that take
them.  Fold the various tests involving null pointers and empty
strings into the general testing, removing from "singularity" tests,
and combine the remainders of those tests into a single test of
singular cases for QByteArray::ompare.  Move all these tests to
alongside the existing tests for QByteArray::compare.  Use nullptr
rather than 0 as the null string.

Change-Id: Ie6d01e839c330c2f960af4bcc95e5633539337d6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-05 12:13:05 +02:00
Liang Qi
ee8ba0e0ca Revert "Disable tests with qemu-arm & developer-build configurations in the CI"
We don't want to have untested qtbase.

This reverts commit 3598ffcc26.

This change also skips two network tests on b2qt.

Change-Id: I5c6f5e19487775f0a1c0feafa5e085208cbf7e9a
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-06-05 12:10:07 +02:00
Jarek Kobus
79fd1cb2c6 Reuse the non blocking implementation for blocking one
Replace the implementation of blockingMappedReduced():
after calling non-blocking version of mappedReduced() we are getting
the future object, so we may call in sequence result(), which
will block and return the result when the all tasks are done.

The same is done with blockigMapped(), which calls blockingMappedReduced()
with a custom reduce function.

Looks like with this pattern we can reuse the non-blocking version
for implementing blocking version of mapped / filtered methods.

Task-number: QTBUG-83918
Change-Id: I7f240cfbd04834d551ff79d717b72194a26996d7
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-06-05 12:09:59 +02:00
Lars Knoll
c49728eb27 Port qmake from QStringRef to QStringView
Change-Id: Ie07a976cd3c634e04c8b9b1e0a6cacd4c2d94939
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-05 09:07:14 +02:00
Alexandru Croitor
6f8ecc2497 CMake: Fix tst_qclipboard test on macOS
The helper processes were not in the correct location.

Change-Id: I0a80a22a931625ea0c9370db38ff29c881b964cb
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-04 23:21:13 +02:00
Alexandru Croitor
4ada40c08d CMake: Fix tst_quuid to pass on macOS
The helper executable needs to be a bundle, because that's
what the test expects.

Change-Id: I7c3f72f12b7a744478b4832685d032abfc679e5b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-04 23:21:09 +02:00
Alexandru Croitor
0cbd307d6a CMake: Regenerate tests/auto/other project
Change-Id: I0dbcef3c918b9502528bf2fe0907a7582dcde0ea
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-04 23:21:00 +02:00
Alexandru Croitor
9b1190fd68 CMake: disable macnativeevents tests
It's disabled in qmake too, due to being almost all blacklisted
and flaky. Plus locally when i tested, i had to give accessibility
permissions manually, otherwise it failed.

Change-Id: I55ce7a81c46ac28f41c43f5c159fecc22d489966
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-04 23:20:55 +02:00
Alexandru Croitor
f52a48d963 CMake: Fix tst_qregexp test
It was missing the resource files.

Change-Id: Iaa97922eaedc8ba55ef4e568a6abfcffd19509fa
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-04 23:20:49 +02:00
Fabian Kosmale
1a3c9df90a tst_qobject: fix build when exceptions are disabled
Change-Id: Id98d39b4cc14608661a53df7e5c5bba5fb875022
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-04 22:43:59 +02:00
Sona Kurazyan
37cfc3c6d2 Deprecate the pause-related APIs of QFuture* classes
Deprecated the pause-related APIs of QFuture* classes and
added alternatives having "suspend" in the name instead.

With 2f15927f01 new
isSuspended()/suspended() APIs have been added to QFuture* classes for
checking if pause/suspension is still in progress or it already took
effect. To keep the naming more consistent, renamed:

 - setPaused() -> setSuspended()
 - pause() -> suspend()
 - togglePaused() -> toggleSuspended()
 - QFutureWatcher::paused() -> QFutureWatcher::suspending()

Note that QFuture*::isPaused() now corresponds to (isSuspending() ||
isSuspended()).

[ChangeLog][Deprecation Notice] Deprecated pause-related APIs of
QFuture and QFutureWatcher. Added alternatives having "suspend" in
the name instead.

Change-Id: Ibeb75017a118401d64d18b72fb95d78e28c4661c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-06-04 22:32:43 +02:00
Miika Pernu
036c3c19e7 Fix to crash in QWindow::event when delete this called on closeEvent
Starting from Qt 5.11 QWindow::event is called after QDialog::closeEvent
which would cause a crash if "delete this" was called on closeEvent.  The commit
that changed this was e0b5ff4ad5. Added
a check before QWindow::event call utilizing QPointer to prevent the
function call in case object is destroyed by a user in close event handler.

Change-Id: I64a4a0f3271714e55bf7e806177f0d8b39b67fa3
Fixes: QTBUG-84222
Pick-to: 5.15 5.12
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-04 20:29:38 +00:00
Volker Hilsheimer
94dcb5454f Remove the deprecated QDirModel
QFileSystemModel is the documented replacement. It uses threads to
populate the model, which QDirModel doesn't.

Change-Id: I7818ecd8f849eb566ac176612f382e17a0471c47
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-06-04 19:11:19 +02:00
Timur Pocheptsov
6d6bfcb9ad QtNetwork remove deprecated signals
Use 'errorOccurred' instead of 'error' and 'sslHandshakeErrors'
instead of 'sslErrors'.

Fixes: QTBUG-82605
Change-Id: I19d4845b16c7b636af7b0658d4fbbba4eef9d029
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-04 15:58:02 +02:00
Giuseppe D'Angelo
77a8005dcb QStringBuilder: code tidies in the tests
Including other headers, while defining very questionable macro
names, can and will result in trouble. Stop doing that.

While at it, move from including <QtTest> to include-what-you-use,
and clean up the code a bit.

Change-Id: Idb02ef2b612c0805baecac3ce6edd435609aca4c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-04 15:58:02 +02:00
Edward Welbourne
9dd8e655cd Limit QByteArray's 8-bit support to ASCII
Previously it handled Latin-1, which made it incompatible with UTF-8,
which is now our preferred 8-bit encoding. For Qt6 it is limited to
ASCII. Adjusted tests to match. QLatin1String::compare() turned out
to be relying on qstrnicmp()'s Latin-1 handling.

Removed some spurious Q_UNLIKELY()s and tidied up code a little in the
process.

[ChangeLog][QtCore][Important Behavior Changes] Encoding-dependent
features of QByteArrray are now limited to ASCII, where previously
they worked for the whole of Latin-1. This affects case-insensitive
comparison, notably including qstricmp() and qstrnicmp(), and
case-transforming functions.

Fixes: QTBUG-84323
Change-Id: I2925d9908f8654599195a2860847b17083911b41
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-06-04 10:39:53 +02:00
Marc Mutz
6a3c6f939f Long live QStringTokenizer!
This class is designed as C++20-style generator / lazy sequence, and
the new return value of QString{,View}::tokenize().

It thus is more similar to a hand-coded loop around indexOf() than
QString::split(), which returns a container (the filling of which
allocates memory).

The template arguments of QStringTokenizer intricately depend on the
arguments with which it is constructed, so QStringTokenizer cannot be used
directly without C++17 CTAD. To work around this issue, add a factory
function, qTokenize().

LATER:
- ~Optimize QLatin1String needles (avoid repeated L1->UTF16 conversion)~
  (out of scope for QStringTokenizer, should be solved in the respective
  indexOf())
- Keep per-instantiation state:
  * Boyer-Moore table

[ChangeLog][QtCore][QStringTokenizer] New class.

[ChangeLog][QtCore][qTokenize] New function.

Change-Id: I7a7a02e9175cdd3887778f29f2f91933329be759
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-06-03 19:13:54 +02:00
Jonas Karlsson
1b33ee95e5 Use QByteArray instead of QString
Since the variable names in QShaderDescription are later compared to
QByteArrays we can gain some performance from not having to convert them
to QByteArrays later.

Task-Id: QTBUG-83706
Change-Id: Iaf80d0966f45cbb09e7c1000b7854bc488e57bb3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-03 18:56:21 +02:00
Ulf Hermann
07ded4912f Fix and compactify QNotifiedProperty
The static observer can live in a union with the inline observers. We
only need to take care of calling the ctors and dtors manually then.

In order for any observers to be called in the presence of a static
observer, the static observer has to be called after the other
observers.

Change-Id: I2f56fa64f3fe6fcd7f06cc403929362da7d86f65
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-06-03 18:53:40 +02:00
Alex Trotsenko
33e6e5fac3 QEventDispatcherWin32: retrieve PM_REMOVE value as a bit flag
Windows unexpectedly passes PM_NOYIELD flag in wParam parameter to the
hook procedure, if ::PeekMessage(..., PM_REMOVE | PM_NOYIELD) is called
from the event loop. So, to ignore undocumented flag, we should
interpret wParam as a bit field.

Thanks to Robin Lobel for research.

Pick-to: 5.15
Fixes: QTBUG-84562
Change-Id: Ib16d7d747aebc9a3628e4ee67478c4d3edeb96f1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-06-03 19:36:34 +03:00
Tor Arne Vestbø
93a04332eb Move QtAccessibilitySupport into QtGui
Task-number: QTBUG-83255
Change-Id: Ibc1b38e77c3c90030a832c41f4de65c6c38bc91d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-06-02 23:32:36 +02:00
Fabian Kosmale
47c6466d0a QMetaType: create metatype for void
Create a QMetaTypeInterface for void. This allows us differentiate
QMetaType::Unknown from QMetaType::Void. In addition, this will enable
the usage of QMetaMethod::metaReturnType in QMetaMethod::returnType,
and will facilitate using metaReturnType in declarative, which needs to
distinguish between Unknown and Void.

Change-Id: I83296b49587f3deb7ec73e25a33f0d8c98cf8da0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-02 22:42:15 +02:00
Fabian Kosmale
649d834443 add unit test for QMetaMethod::revision
Change-Id: I724702d8ac9a75fefd848afccf4f4de9fc0ba4af
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2020-06-02 22:42:15 +02:00
Fabian Kosmale
fa987d4441 MetaObject: Store the QMetaType of the methods
This does the analog of 46f407126e for the
methods we care about (signals, slots, Q_INVOKABLEs). In addition to the
actual QMetaType, we store an array with offsets so that we later can do
a mapping from methodIndex to metatype.

The newly added QMetaMethod::{return,parameter}MetaType methods can then
be used to retrieve the metatypes.

This does however require that all involved types are complete. This is
unfortunately not a feasible requirement. Thus, we only populate the
metatype array on a best effort basis. For any incomplete type, we store
QMetaType::Unknown. Then, when accessing the metatype, we fall back to
the old string based code base if it's Unknown.

Squashes "moc: support incomplete types" and  "Fix compile failures
after QMetaMethod change"


Fixes: QTBUG-82932
Change-Id: I6b7a587cc364b7cad0c158d6de54e8a204289ad4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-02 22:42:15 +02:00
Lars Knoll
4c5f6eb74c Stabilize autotest
calling emplace() on a std::vector with a reference
pointing into the same vector is undefined behavior.
Fix this by using a temporary inbetween.

Change-Id: I47c28700dffa2107fb0cba302168c86b659eafb3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-01 20:57:55 +02:00
Lars Knoll
aac39167b7 Add QStringView::split() methods
Since QString::split() is not going away in Qt 6, we should aim
to provide API symmetry here, and ease porting existing code from
QString(Ref) to use QStringView.

This is easier than having to port everything to use tokenize() at
the same time. tokenize() will however lead to better performance
and thus should be preferred.

Change-Id: I1eb43300a90167c6e9389ab56f416f2bf7edf506
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-06-01 20:43:21 +02:00
David Faure
4f1ebf666e QMimeType::suffixForFileName shouldn't lowercase the file suffix
It was returning a lowercased suffix because it was extracting it from
the pattern (*.txt) rather than from the filename ("README.TXT").

This broke expectations on the application side, since this method is
documented to return a suffix from the given filename.

Ref: https://bugs.kde.org/show_bug.cgi?id=402388

Change-Id: I7dae13db31280249d3f592fa9592c4067804e22d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-06-01 13:36:05 +02:00
Giuseppe D'Angelo
529f052add Port QRegularExpression to QStringView, drop QStringRef
The idea is pretty simple -- add QRegularExpression matching over
QStringView. When matching over a QString, keep the string
alive (by taking a copy), and set the view onto that string.
Otherwise, just use the view provided by the user (who is then
responsible for ensuring the data stays valid while matching).

Do just minor refactorings to support this use case in a cleaner
fashion.

In QRegularExpressionMatch drop the QStringRef-returning methods, as
they cannot work any more -- in the general case there won't be a
QString to build a QStringRef from.

[ChangeLog][QtCore][QRegularExpression] All the APIs dealing
with QStringRef have been ported to QStringView, following
QStringRef deprecation in Qt 6.0.

Change-Id: Ic367991d9583cc108c045e4387c9b7288c8f1ffd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-31 21:46:32 +02:00
Lars Knoll
a1056096fc Add support for count() to QStringView
Make the API more symmetric with regards to both QString and QStringRef.

Change-Id: Ia67c53ba708f6c33874d1a127de8e2857ad9b5b8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-05-30 23:11:09 +02:00
Lars Knoll
beaef85b8d Add toInt() and friends to QStringView
Make the API more symmetric with regards to both QString and QStringRef.
Having this available helps making QStringView more of a drop-in
replacement for QStringRef. QStringRef is planned to get removed in Qt 6.

Change-Id: Ife036c0b55970078f42e1335442ff9ee5f4a2f0d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-05-29 19:01:58 +02:00
Sona Kurazyan
2f15927f01 Add a way of notifying QFutureWatcher when pause is in effect
Because setting QFutureInterface to paused state does not mean that
the computations that are already in progress will stop immediately,
it may be useful to get notified when pause actually takes effect.

Introduced the QFutureWatcher::suspended() signal, to be emitted when
there are no more computations in progress, and no more result ready
or progress reporting signals will be emitted, i.e. when pause took
effect. Added {QFuture, QFutureWatcher}::isSuspended() methods for
checking if pause took effect.

QtConcurrent will now to send QFutureCallOutEvent::Suspended event
when the state is paused and there are no more active threads.

[ChangeLog][QtCore][QFutureWatcher] Added a new QFutureWatcher::suspended()
signal, to be emitted when pause took effect, meaning that there are no
more computations in progress. Added {QFuture, QFutureWatcher}::isSuspended()
methods for checking if pause took effect.

Fixes: QTBUG-12152
Change-Id: I88f2ad24d800cd6293dec63977d45bd35f9a09f0
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-05-29 16:58:43 +02:00
Edward Welbourne
948511a143 Turn badly-named test into two data rows of another test
Since ancient times, tst_QDateTime::fromString_LOCALE_ILDATE() has
claimed to be Windows-only, although there is nothing MS-specific
about it; its name also purports to implicate locale, which it
doesn't. Turn it into two data rows for the more general
fromStringDateFormat() test, with no extra #if-ery about it.

Change-Id: I239c0f80f8f7fa42d498a0f801cc8edfb1db3d8c
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-05-29 16:58:43 +02:00
Eskil Abrahamsen Blomfeldt
4e5d686a87 Make tst_QTextLayout::textWidthVsWIdth() more robust
Some fonts misreport the minimum right bearing, and in those cases
we may not be able to do a perfect text layout inside the bounds
set. This is a limitation we have chosen to accept.

To avoid random failure when testing this, we detect the case and
skip the test if we see that it may fail.

Fixes: QTBUG-84415
Pick-to: 5.15
Change-Id: I6b53ea2631c5c6e476e2902b5514829a2141796f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-29 07:28:10 +02:00
Simon Hausmann
36f6922925 Implement support for QProperty<T> with a static observer
A common pattern in Qt Quick will be QProperty members that are
connected to a callback that needs to perform something when the value
changes, for example emitting a compatibility signal or marking scene
graph node data dirty.

To make such a pattern more efficient, a new QNotifiedProperty type is
introduced that offers the same API as QProperty<T>, with two changes:

    (1) The template instantiation not only takes the property type as
    parameter but also a callback pointer-to-member.

    (2) Since that member itself cannot be called without an instance
    and to avoid storing an instance pointer permanently, the API for
    setBinding and setValue are adjusted to also take the instance
    pointer. For the former it gets stored in the binding, for the
    latter it is used to invoke the callback after setting the new
    value.

Change-Id: I85cc1d1d1c0472164c4ae87808cfdc0d0b1475e1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-05-28 21:08:51 +00:00
Allan Sandfeld Jensen
d80a98d525 Fix ExtendedRgb and Rgb encoding comparisons
ExtendedRgb should be treated as Rgb as it can be an automatic upgrade.

Pick-to: 5.15
Change-Id: I2942a1067ed5cacb2f60f303f467887cb44c36dd
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-05-28 21:15:55 +02:00
Laszlo Agocs
56977990e0 rhi: Harmonize create-destroy API pattern with the rest of Qt
For historical reasons we use build and release instead of create and
destroy. This becomes confusing now that more modules in Qt start taking
QRhi into use. Migrate to the more familiar naming, so those who have
used QWindow or QOpenGLContext before will find it natural.

Change-Id: I05eb2243ce274c59b03a5f8bcbb2792a4f37120f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-05-28 17:53:32 +02:00
Edward Welbourne
449b347644 Rework QLocale and QDateTime tests that expect CET abbreviation
The name CET is locale-dependent; but QLocale doesn't know about
localization of time zone names. Such abbreviated zone names are, in
any case, potentially ambiguous - various zones around the world have
collisions - so they can't be relied on.

QTimeZone's various backends have differing handlings of how to
abbreviate zone names (MS's provides no abbreviated names at all); and
it appears macOS actually follows the relevant localizations.

So it is hopeless to hard-code the expected zone abbreviations.
Changed the tests to consult QTimeZone for the abbreviation and
compare what it gets with the results of checks which should match
this. This is less stringent, but it is at least robustly correct,
thereby getting rid of assorted kludges and #if-ery.

Pick-to: 5.15
Task-number: QTBUG-70149
Change-Id: I0c565de3fd8b5987c8f5a3f785ebd8f6e941e055
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-05-28 15:15:17 +02:00
Dimitrios Apostolou
b37cf68810 Add tests for a couple of edge cases
Change-Id: I1cd799cc671fa2191e20d4681632588dc79e98dd
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-05-28 10:48:58 +02:00
Andrei Golubev
cfbb30decd Make QDateTimeParser recognize local time offsets
Fixes: QTBUG-84209
Pick-to: 5.15
Change-Id: Iedbc7beafcaa55c72fec3ac5a5f519c6ed5f7770
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-05-28 11:48:57 +03:00
Friedemann Kleint
9c31acbf47 Move windowsuiautomation API support into QtGui
Task-number: QTBUG-83255
Change-Id: Ibface71931b6384494842ba9744d76f738c5ca85
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-05-27 22:28:41 +02:00
Ulf Hermann
a64a0ce331 Add a QPropertyAlias
A property alias is the equivalent of the "alias" keyword in QML. It
provides the same API as QProperty, but redirects any access to the
QProperty it was initialized with. When the original property is
destroyed the binding becomes invalid and ignores any further acccess.

Task-number: QTBUG-84370
Change-Id: I0aef8d50e73a2aa9e7703d51194d4c5480573578
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-27 14:41:52 +02:00
Volker Hilsheimer
ee92ee7a3c Remove deprecated QProcess methods
Add default parameter for arguments in start, startDetached, and
execute for better source compatibility with Qt 5.15. This has the risk
of then hiding incorrect calls to the previous overload taking a single
"command" strings if code is ported from pre-5.15 or ignores deprecation
warnings. This is acceptable, given that the alternative is that all
calls to these functions would require a default constructed QStringList
as the second parameter.

Change-Id: I1ba4df97ac4894d007da5083c8359015d784ddbb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-27 11:55:06 +02:00
Shawn Rutledge
3373aa8b35 QTextMarkdownImporter: allow nesting text span formatting
The bold+italic combination indicated by ***triple stars*** requires
this; but it enables combinations of italics, bold, strikeout, anchor
text (and associated link formatting), image alternate text, and inline
code formatting (monospace). A code span overrides the formatting from
surrounding spans (which might be a bug to fix in another patch, if we
compare to how md2html formats code nested in bold-italics for example),
but the format stack restores state when any char format span ends.

Task-number: QTBUG-81306
Pick-to: 5.15
Change-Id: I289556fa53de400eb50a4d159b9b344eafc517da
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-05-27 11:55:02 +02:00
Ulf Hermann
524d781607 QProperty: Support multiple observers
Previously, only the first observer would get notified. Also, make sure
that the notifiers are always retained when switching between bindings
and values.

Change-Id: I9c25c0f2e288dac3a335b68e618f7ddeb44be25a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-05-27 11:54:30 +02:00
Ulf Hermann
36bd34dbdc QProperty: Apply coding style and avoid warnings
Change-Id: I14efdb293a4be39b3849b34bd8013fdab016ce7e
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
2020-05-27 11:54:16 +02:00
Sona Kurazyan
d7d6a1fe32 Don't queue events in QFutureWatcher when pause is requested
When QFutureWatcher (or QFutureInterface) is paused, it doesn't
mean that it will take effect immediately: the pending tasks may
still be in progress and keep reporting results. At the moment
QFutureWatcher will queue those events and report only with the
next resume. This behavior is wrong, QFutureWatcher should not
decide when to report events, the sender should decide when is the
right time. There's no benefit in reporting already happened events
with delay. Because of this, even the pause event itself was being
reported after resume.

Fixed the behavior by removing the logic of queueing events when
the state is set to "paused". It seems unlikely that the users of
QFutureWatcher rely on reporting events with delay.

[ChangeLog][Important Behavior Changes][QtCore] QFutureWatcher will not
immediately stop delivering progress and result ready signals when the
future is paused. At the moment of pausing there may be still computations
that are in progress and cannot be stopped. Signals for such computations
will be still delivered after pause, instead of being postponed and
reported only after next resume.

Fixes: QTBUG-12152
Change-Id: I9f0b545ac096578c52cc72d60575c018c01e3368
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-05-27 11:53:28 +02:00
Fabian Kosmale
d8a2456fbf moc: handle include directives in enums
When including files, moc inserts a MOC_INCLUDE_BEGIN and
MOC_INCLUDE_END token into the token stream. Those are already handled
in the toplevel Moc::parse function, but parseEnum lacked support so
far.

Pick-to: 5.15
Fixes: QTBUG-80578
Change-Id: I35c8fd959347d94af20090b3a505dd9e6bfaff88
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-27 09:21:08 +02:00
Giulio Camuffo
7db527dbdd Add a property to QSFPM to show children of accepted items
[ChangeLog][QtCore][QSortFilterProxyModel] Add a 'autoAcceptChildRows'
property to always show children rows of accepted rows.

Change-Id: I2402469ece438179d0f19888b9775cc27cf5c749
Reviewed-by: David Faure <david.faure@kdab.com>
2020-05-26 15:11:40 +02:00
Heikki Halmet
fc8c011450 Blacklist imageAtRightAlignedTab in CentOS
Task-number: QTBUG-46206
Change-Id: I98add304d052f3fc5c0ab80077ba66e8e159748e
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2020-05-25 08:16:14 +03:00
Heikki Halmet
d8ea25b917 BLACKLIST test_Gestures tests for new platforms
Task-number: QTBUG-84258
Change-Id: I4722444ffd8a9b1ebc262a424778a19704881832
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-05-25 05:16:10 +00:00