Commit Graph

691 Commits

Author SHA1 Message Date
Andreas Buhr
d0ba43f0f5 Fix warnings about marking functions override
Change-Id: I7737469d3016f9522e497b443edd864fa4d714cc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-03-10 23:21:32 +01:00
Fabian Kosmale
3e46c22d94 tst_qguivariant benchmark: Only use valid QMetaTypes
Otherewise, we hit an assertion because the name is empty.

Fixes: QTBUG-91709
Pick-to: 6.0 6.1
Change-Id: I03a530d64ea8dead3efc5fcb8c00909388a387d0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-10 18:00:39 +01:00
Fabian Kosmale
90dc1f9204 tst_bench_qguimetatype: only consider valid metatypes
Otherwise the benchmark crashes as the data tag for the row would be
empty.

Fixes: QTBUG-91708
Pick-to: 6.0 6.1
Change-Id: I484ded5b8670571b80012e64d67846d3b8db5320
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-03-10 17:59:49 +01:00
Alex Trotsenko
f265c87e01 Allow QWindowsPipe{Reader|Writer} to work with foreign event loops, take 2
When a foreign event loop that does not enter an alertable wait state
is running (which is also the case when a native dialog window is
modal), pipe handlers would freeze temporarily due to their APC
callbacks not being invoked.

We address this problem by moving the I/O callbacks to the Windows
thread pool, and only posting completion events to the main loop
from there. That makes the actual I/O completely independent from
any main loop, while the signal delivery works also with foreign
loops (because Qt event delivery uses Windows messages, which foreign
loops typically handle correctly).

As a nice side effect, performance (and in particular scalability)
is improved.

Several other approaches have been tried:
1) Using QWinEventNotifier was about a quarter slower and scaled much
   worse. Additionally, it also required a rather egregious hack to
   handle the (pathological) case of a single thread talking to both
   ends of a QLocalSocket synchronously.
2) Queuing APCs from the thread pool to the main thread and also
   posting wake-up events to its event loop, and handling I/O on the
   main thread; this performed roughly like this solution, but scaled
   half as well, and the separate wake-up path was still deemed hacky.
3) Only posting wake-up events to the main thread from the thread pool,
   and still handling I/O on the main thread; this still performed
   comparably to 2), and the pathological case was not handled at all.
4) Using this approach for reads and that of 3) for writes was slightly
   faster with big amounts of data, but scaled slightly worse, and the
   diverging implementations were deemed not desirable.

Fixes: QTBUG-64443
Change-Id: I66443c3021d6ba98639a214c3e768be97d2cf14b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-03-02 22:53:06 +02:00
Andreas Buhr
a944de7742 Fix some warnings about virtual/override
This patch marks some functions "override" to silence the corresponding
warning.

Change-Id: I88ccc5fa7521ecccc84a6cba9f06ea185cc5679e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-02-23 15:15:45 +01:00
Volker Hilsheimer
784276cc72 Fix compiler warning: initialize variable
The initialization happens outside the bechmarking loop.

Change-Id: Id661fa2f995e964277a5c388b8fac13ff8687d92
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-02-11 21:05:53 +01:00
Fabian Kosmale
1316af2f3e Fix QMetaType benchmark
The benchmark used to crash because QMetaType::typeName would return an
empty string, which is not a legal value for newRow.

Change-Id: I9e6c6c1cf153943bfa21181cd2cca596a7943ea0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-02-04 13:29:46 +01:00
Volker Hilsheimer
f2e5621451 Fix compiler warning in QNetworkReply test
Clang warning: 'isSequential' overrides a member function but is not
marked 'override' [-Winconsistent-missing-override]

Change-Id: I1a7c5516d2656469eab556e7f9d310192510b99b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-02-03 23:46:25 +01:00
Allan Sandfeld Jensen
936d499ed4 Optimize RGBA64->RGBA64PM for SSE2/AVX2
And remove the direct conversion so we can get both the SIMD
optimization and threading applied.

Change-Id: Id032ea91cc40c1cbf1c8a1da0386de35aa36cfb5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-02-03 08:22:16 +01:00
Allan Sandfeld Jensen
bde773ec6a Fix a few compiler warnings in tests
Change-Id: I22f6ac8ed02dd4ef4083ce3c781552623a0b08da
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2021-02-02 12:06:05 +01:00
Joerg Bornemann
7d1cda9de3 Remove qmake project files for benchmarks
Also remove tests/tests.pro that would be empty without the benchmarks.

Change-Id: Iaf92a729d1286b3e0c03bf9f877b59e1d83708e6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-01 21:14:01 +01:00
Maximilian Goldstein
bd520ccc3c Import qproperty benchmarks from private repo
Change-Id: Icff5685b921f8a99acfeda1d79bb03ee652aa107
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-29 11:55:42 +01:00
Fabian Kosmale
6d3a886f09 QVariant benchmark: fix crashes
- Skip unused metatype id
- Do not construct a QVariant from an int, when we instead want to
  construct a QVariant for a given metatype (was: metatype id in Qt 5)

Pick-to: 6.0
Change-Id: I1ac19dec5549b424a9429f69999eaf8e96c022e2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-27 15:00:56 +01:00
Ivan Solovev
fb51b4732c Add simple benchmark for QRegularExpression
The benchmark simply calls QRegularExpression's public API methods, so
that we can assess how changes to the implication impact performance.
(Its addition is prompted by evaluation of whether adding a move
constructor saves more or less than the resulting need for
d-pointer null-checks costs.)

Task-number: QTBUG-86634
Change-Id: Idef775ef6cf9f9ded3ce7ba5b85e460571d12756
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-20 16:31:07 +01:00
Volker Hilsheimer
45dc973d96 Remove unused variable from QNetworkReply benchmark
Fixes compiler warning.

Change-Id: I73963f9f711b02d999b366dbf884acd5c851c950
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-01-19 20:04:12 +01:00
Joerg Bornemann
04f11f9935 Remove .prev_CMakeLists.txt files
Those serve no purpose anymore, now that the .pro files are gone.

Task-number: QTBUG-88742
Change-Id: I39943327b8c9871785b58e9973e4e7602371793e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-01-12 20:59:13 +01:00
David Skoland
9e09677c1d Remove QtDBus includes
Per the discussion of QTBUG-88831, we determined that module-wide
imports are unfortunate, especially for compile times. Following this,
all QtDBus includes have been replaced with the headers for the classes
actually used in each file. Additionally, some cleanup of header file
order and format has been performed in the changed files.

Pick-to: 6.0
Change-Id: I62c1b75682a48422f0ba1168dd5d7bd0952808ac
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-12 09:19:27 +01:00
David Skoland
27d96b4789 Replace QtTest headers with QTest
Complete search and replace of QtTest and QtTest/QtTest with QTest, as
QtTest includes the whole module. Replace all such instances with
correct header includes. See Jira task for more discussion.

Fixes: QTBUG-88831
Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44
Pick-to: 6.0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-12-22 15:20:30 +01:00
Alexandru Croitor
2304acab5f CMake: Regenerate projects using pro2cmake one last time
And fix up some wrong qmake project files

Pick-to: 6.0
Change-Id: I66cb82aeb9c1419a74df1a650fa78a511ade7443
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-12-10 11:52:30 +01:00
Andreas Buhr
0440614af0 Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE
Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with
move semantics, its name is misleading. Q_RELOCATABLE_TYPE was
introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE
is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE
by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this
patch should have no impact on users.

Pick-to: 6.0
Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-11-30 17:16:21 +01:00
Andreas Buhr
5e84023344 Fix warnings about unused variables in benchmarks
This patch removes two unused variables and marks one unused, fixing
three warnings.

Change-Id: I71f59839452590b82ffb5459a968f06bd434fb9a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-11-30 17:16:21 +01:00
Allan Sandfeld Jensen
f61f8bb966 Replace qt_make_unique with std::make_unique
We can depend on C++14 now.

Change-Id: Iee9796cd22dbfbb70d4bdb25f0eee1662a026d6d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-11-23 09:50:21 +01:00
Kai Koehne
ce29ce586f Revert "Allow QWindowsPipe{Reader,Writer} to work with foreign event loops"
This reverts commit ee122077b0.

Reason for revert: This causes QProcess::readAll() to sometimes
return nothing after the process has ended.

Fixes: QTBUG-88624
Change-Id: I34fa27ae7fb38cc7c3a1e8eb2fdae2a5775584c2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 23100ee61e33680d20f934dcbc96b57e8da29bf9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-11-20 13:28:31 +00:00
Alex Trotsenko
1e9dc3ec2f CMake: fix QLocalSocket benchmark to use new qt_internal_ API
Amends ee122077b.

Change-Id: I9b750eb88ac9c83da26da4e5921cb147716c5eb6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-11-17 21:34:04 +02:00
Alex Trotsenko
ee122077b0 Allow QWindowsPipe{Reader,Writer} to work with foreign event loops
When a foreign event loop that does not enter an alertable wait state
is running (which is also the case when a native dialog window is
modal), pipe handlers would freeze temporarily due to their APC
callbacks not being invoked.

We address this problem by moving the I/O callbacks to the Windows
thread pool, and only posting completion events to the main loop
from there. That makes the actual I/O completely independent from
any main loop, while the signal delivery works also with foreign
loops (because Qt event delivery uses Windows messages, which foreign
loops typically handle correctly).

As a nice side effect, performance (and in particular scalability)
is improved.

Several other approaches have been tried:
1) Using QWinEventNotifier was about a quarter slower and scaled much
   worse. Additionally, it also required a rather egregious hack to
   handle the (pathological) case of a single thread talking to both
   ends of a QLocalSocket synchronously.
2) Queuing APCs from the thread pool to the main thread and also
   posting wake-up events to its event loop, and handling I/O on the
   main thread; this performed roughly like this solution , but scaled
   half as well, and the separate wake-up path was still deemed hacky.
3) Only posting wake-up events to the main thread from the thread pool,
   and still handling I/O on the main thread; this still performed
   comparably to 2), and the pathological case was not handled at all.
4) Using this approach for reads and that of 3) for writes was slightly
   faster with big amounts of data, but scaled slightly worse, and the
   diverging implementations were deemed not desirable.

Fixes: QTBUG-64443
Change-Id: I1cd87c07db39f3b46a2683ce236d7eb67b5be549
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-11-17 12:45:50 +02:00
Giuseppe D'Angelo
1869615fc9 QChar: make construction from integral explicit
QChar should not be convertible from any integral type except from
char16_t, short and possibly char (since it's a direct superset).

David provided the perfect example:

  if (str == 123) { ~~~ }

compiles, with 123 implicitly converted to QChar (str == "123"
was meant instead). But similarly one can construct other
scenarios where QString(123) gets accidentally used (instead of
QString::number(123)), like QString s; s += 123;.

Add a macro to revert to the implicit constructors, for backwards
compatibility.

The breaks are mostly in tests that "abuse" of integers (arithmetic,
etc.). Maybe it's time for user-defined literals for QChar/QString,
but that is left for another commit.

[ChangeLog][Potentially Source-Incompatible Changes][QChar] QChar
constructors from integral types are now by default explicit.
It is recommended to use explicit conversions, QLatin1Char,
QChar::fromUcs4 instead of implicit conversions. The old behavior
can be restored by defining the QT_IMPLICIT_QCHAR_CONSTRUCTION
macro.

Change-Id: I6175f6ab9bcf1956f6f97ab0c9d9d5aaf777296d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-11-15 14:41:05 +01:00
Alex Trotsenko
aefd414ce2 QWinEventNotifier: unlink from event dispatcher
Instead of multiplexing all notifications into a single Qt event for
the event dispatcher, we can send 'WinEventAct' event directly for each
notifier which activated. This trick improves the performance (esp.
on a large number of events) and allows us to remove notifiers handling
from the event dispatcher completely.

As an alternative to sending Qt events, use of Windows' APC queue in
conjunction with waking up the Qt event loop from within the Windows
thread pool has been considered. However, that would lead to signal
emission asynchronous to the Qt event loop's operation, which is not
acceptable.

Thanks to Oswald Buddenhagen for the proposed idea.

[ChangeLog][QtCore][QAbstractEventDispatcher] The
{un}registerEventNotifier() member functions have been removed.
QWinEventNotifier is no longer needed to be registered in the
event dispatcher.

Change-Id: I140892fb909eaae0eabf2e07ebabcab78c43841c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-11-10 17:56:51 +02:00
Andrei Golubev
250b69ace4 Fix QArrayDataOps generic and relocatable emplace()
Emplace() implemented with std::rotate is just awful on my system
(Ubuntu 18.04 GCC 7.5.0). Custom code is much faster, so go for
it. Cannot really use insert() code, which is also fast, because
it doesn't forward-reference values but copies them always

Changes in performance (approximately) for emplacing 100k elements
into the middle:
Complex 7600ms -> 1700ms
Movable 7600ms -> 200ms

Task-number: QTBUG-86583
Change-Id: If883c9b8498a89e757f3806aea11f8fd3aa3c709
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-09 17:36:31 +01:00
Andrei Golubev
02a5928fa5 Add QList/QVector benchmark tests
Added some simple benchmarks for QList insertion of 1 element

Added same tests for QVector (within the same file) for 5.15

Task-number: QTBUG-87330
Task-number: QTBUG-86583
Pick-to: 5.15
Change-Id: I19a851c79cf5ce0329266883e99ecaf2d6b3df19
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-11-04 11:21:01 +01:00
Edward Welbourne
c8d42961a0 Add constructor benchmarks for QLocale, to test likely sub-tag matching
Change-Id: Ib4c1d0ea031a581020c1f050fa4096d5196cc752
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-10-26 15:56:06 +02:00
Andreas Buhr
2516fc935c Add benchmark for QString::number(int)
Add a almost trivial benchmark for QString::number(int).

Change-Id: Ice67eaf28e8d7b235fd5ec5e0b87b3b9053ae61e
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-10-23 06:55:35 +02:00
Edward Welbourne
5a948dd50b Fix [[nodiscard]] compile errors in QLocale benchmark
QString::toUpper() now insists we use its return, so the benchmark
won't compile unless we do so. Also document the helper macro used by
the tests, to explain why it's even there at all.

Change-Id: I830f121d92867bcd09277ecdeb1c764413b34fa6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-10-19 17:45:30 +02:00
Lars Knoll
77d812683f Refactor QMutexLocker to be able to handle recursive mutexes
Since we're going to split QMutex and QRecursiveMutex into
separate classes, make sure QMutexLocker is prepared for that.

Change-Id: Id5e9a955d1db7c8ee663dd3811ad6448dad0aeae
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-17 12:02:49 +02:00
Volker Hilsheimer
1c76aa077e Get rid of all usage of QApplication:desktop
Use QScreen APIs instead.

Change-Id: Ie99af94fe4292223dbb165b3f5c1b74e8fe0498b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-10-14 06:38:43 +02:00
Allan Sandfeld Jensen
564b59d903 Another round of replacing 0 with nullptr
This time based on grepping to also include documentation, tests and
examples previously missed by the automatic tool.

Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-10-07 23:02:47 +02:00
Alexandru Croitor
403213240c CMake: Regenerate projects to use new qt_internal_ API
Modify special case locations to use the new API as well.
Clean up some stale .prev files that are not needed anymore.
Clean up some project files that are not used anymore.

Task-number: QTBUG-86815
Change-Id: I9947da921f98686023c6bb053dfcc101851276b5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-09-23 16:59:06 +02:00
Alexandru Croitor
a3bd80c08c CMake: Regenerate projects
Clean up the state of the projects,
before changing the internal CMake API function names.

Task-number: QTBUG-86815
Change-Id: I90f1b21b8ae4439a4a293872c3bb728dab44a50d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-09-22 19:08:53 +02:00
Allan Sandfeld Jensen
5f198584e2 Define inverted QRects consistently
Changes the definition of invalid QRects to be more consistent.
This simplifies the logic, and makes it possible for us to fix
normalized() so dimensions don't change.

The actual API is not changed except for inverted rects.

Only one use-case for the old normalized() function existed,
and has been reimplemented as QRect::span().

Fixes: QTBUG-22934
Change-Id: I29dad2952dc6c8e84a6d931898dc7e43d66780f3
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-21 15:04:51 +02:00
Christian Ehrlicher
4e2656a6d2 QStyleOptionGraphicsItem: remove deprecated member matrix/levelOfDetail
QStyleOptionGraphicsItem::matrix and levelOfDetail are deprecated and
not used anywhere anymore.

Change-Id: Id4b0fa8ac3ac53d771e858ecda5524a5e690342d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-06 18:31:43 +02:00
Edward Welbourne
26547c296b Purge qalgorithm.h of deprecated API
A large slice of it has been deprecated since 5.2.

Reflowed a doc paragraph pointed out, in the deprecation commit, as
having been left ragged by its edits.

Note: qSwap() is documented as \deprecated but not marked, where it's
defined, as deprecated.

Change-Id: Iaff10ac0c4c38e5b85f10eca4eedeab861f09959
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-28 21:22:32 +02:00
Lars Knoll
acbf9a858b Cleanup QTypeInfo
Remove QTypeInfo::isStatic, as that's not used anymore in Qt 6.
Also remove sizeOf, it's unused, and we have QMetaType for that if
required.
Remove all typeinfo declaractions for trivial types, as the default
template covers them correctly nowadays.

Finally set up a better default for isPointer, and do some smaller
cleanups all over the place.

Change-Id: I6758ed37dfc701feaaf0ff105cc95e32da9f9c33
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-26 01:03:22 +02:00
Lars Knoll
524edc7363 Clean up QVariant::Private::Data
Remove all the internal members of the union. Instead replace
it with raw storage (uchar[]) aligned to max_align_t.

Place all accesses to the internal members with get<> methods
for consistency.

Change-Id: Icebf46b90c9375aa6ea0b5913b2132608e8c223d
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2020-08-24 00:17:05 +02:00
Karsten Heimrich
2766322de3 Move QStringRef and remains to Qt5Compat
Export some private functions from QUtf8 to resolve
undefined symbols in Qt5Compat after moving QStringRef.

Task-number: QTBUG-84437
Change-Id: I9046dcb14ed520d8868a511d79da6e721e26f72b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-20 00:58:13 +02:00
Lars Knoll
8929c0a355 Remove QVariant(int type, void *data, ...) constructor
It was marked internal anyway. Use the constructor taking a
QMetaType instead.

Change-Id: I15b9cd0911aac063a0f0fe0352fa2c84b7f7c691
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-15 10:56:29 +02:00
Allan Sandfeld Jensen
6f0df02d00 Replace Qt CONSTEXPR defines with constexpr
Both normal and relaxed constexpr are required by our new minimum of
C++17.

Change-Id: Ic028b88a2e7a6cb7d5925f3133b9d54859a81744
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-08-14 15:52:58 +02:00
Mårten Nordheim
d40f88e8d2 QDecompressHelper: Introduce zstd support
Also take this opportunity to reshuffle the content-encodings in the
intended ordering since the ordering is used to signify priority.

Task-number: QTBUG-83269
Change-Id: I022eecf1ba03b54dbd9c98a9d63d05fb05fd2124
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-14 13:17:11 +02:00
Mårten Nordheim
ad1a5bf63f QDecompressHelper: Add brotli support
Task-number: QTBUG-83269
Change-Id: If23b098ee76a4892e4c2c6ce5c635688d8d9138d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-08-06 20:56:42 +02:00
Alexandru Croitor
92ee9bd6b8 CMake: Properly handle CONFIG += thread aka Threads::Threads
mkspecs/features/qt.prf adds a dependency on the system threading
library if the Qt Core thread feature is enabled. Because qt.prf is
loaded by any public or internal Qt project, it's essentially a public
dependency for any Qt consumer.

To mimic that in CMake, we check if the thread feature is enabled, and
and set the Threads::Threads library as a dependency of Qt6::Platform,
which is a public target used by all Qt modules and plugins and Qt
consumers.

We also need to create a Qt6Dependencies.cmake file so we
find_package(Threads) every time find_package(Qt6) is called.

For the .prl files to be usable, we have to filter out some
CMake implementation specific directory separator tokens
'CMAKE_DIRECTORY_ID_SEP' aka '::@', which are added because we call
target_link_libraries() with a target created in a different scope
(I think).

As a result of this change, we shouldn't have to hardcode
Threads::Threads in other projects, because it's now a global public
dependency.

Task-number: QTBUG-85801
Task-number: QTBUG-85877
Change-Id: Ib5d662c43b28e63f7da49d3bd77d0ad751220b31
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-08-06 19:15:39 +02:00
Mårten Nordheim
07b008425a Privately introducing QDecompressHelper for network purposes
To support streaming decompression in QNAM.
Will also be used to refactor existing decompression code in QNAM.

Task-number: QTBUG-83269
Change-Id: Iecf3e359734163f15686c949f75d41fa4794a00e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-05 09:17:11 +02:00
Edward Welbourne
a6b3a1e459 Remove deprecated binary json feature
Deprecated in 5.15 in favor of CBOR.

Fixes: QTBUG-81239
Change-Id: I711d4bd7dd1247f58e77ac9fa53304cbe5028918
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-31 17:12:48 +02:00
Peng Wenhao
59e3073b1c Close memory leak in QTestLib support for string to numeric testing
QTest::toString allocates memory by calling qstrdup; that memory must
be freed by the caller.

Change-Id: I9724db0c617884cf08592968b1411f002ef23204
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-07-28 13:36:31 +08:00
Sona Kurazyan
361dc074f2 Move QRegExp and its remaining mentions out of QtCore
Task-number: QTBUG-85235
Change-Id: Ibd6c98d952c1bb9916b64715c6430fb0d3fe3843
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-13 10:53:23 +02:00
Alexandru Croitor
1718948ed4 CMake: Regenerate benchmarks
Change-Id: I4154d9ebb8303338a07350b655c7b468751efd10
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-08 11:01:38 +02:00
Lars Schmertmann
6ce2f3f26b Add ; to Q_UNUSED
This is required to remove the ; from the macro with Qt 6.

Task-number: QTBUG-82978
Change-Id: I3f0b6717956ca8fa486bed9817b89dfa19f5e0e1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-07-07 11:51:48 +02:00
Jarek Kobus
d33655a953 Use QList instead of QVector in other qtbase tests
Task-number: QTBUG-84469
Change-Id: Ie0455c890c048c52eacad1badd6d21df999badf9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-07-07 11:48:45 +02:00
Lars Schmertmann
18cfabafa6 Remove unnecessary ; after function implementations
Task-number: QTBUG-82978
Change-Id: Iea3bcaec1ef9f4bd0f73e5dccca33354650f5bf4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-07-06 11:46:39 +02:00
Jarek Kobus
74dc89de3e Use QList instead of QVector in benchmarks tests
Task-number: QTBUG-84469
Change-Id: Id61d6036067da0bcd0811b1b97df5f1334007b7e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 10:13:31 +02:00
Sona Kurazyan
d7ccd8cb45 Remove QByteArray's methods taking QString and their uses
[ChangeLog][QtCore][QByteArray] Remove method overloads taking
QString as argument, all of which were equivalent to passing the
toUtf8() of the string instead.

Change-Id: I9251733a9b3711153b2faddbbc907672a7cba190
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-25 09:54:16 +02:00
Volker Hilsheimer
75638e258f Don't pollute global namespace with #define P
Breaks the build if any global header has

using P = SomeType;

statement, and unnecessary to do so before the headers are included.

Change-Id: I3b8cc705bf662f768b8895e4b3ec1428ab39ef27
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-25 06:19:50 +02:00
Timur Pocheptsov
c2bf56fc3a QSslSocket: remove certificate-related setters
They were deprecated with replacements in QSslConfiguration proposed (and
some without alternative, which we'll provide if there is any demand
in such an API). Special thanks to M.N. for a nice hint on how to
amend the test without introducing a new API.

Change-Id: I7841a5b3f30469d8204b61cb65921c34275e0650
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-06-22 12:11:47 +02:00
Karsten Heimrich
18ec53156e Move QTextCodec support out of QtCore
* Assume UTF-8 on all Unix like systems
* Export some functions to be able to compile QTextCodec once
  moved to Qt5Compat.

Task-number: QTBUG-75665
Change-Id: I52ec47a848bc0ba72e9c7689668b1bcc5d736c29
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-20 02:04:38 +02:00
Giuseppe D'Angelo
3e1d03b1ea Port Q_STATIC_ASSERT(_X) to static_assert
There is no reason for keep using our macro now that we have C++17.
The macro itself is left in for the moment being, as well as its
detection logic, because it's needed for C code (not everything
supports C11 yet).  A few more cleanups will arrive in the next few
patches.

Note that this is a mere search/replace; some places were using
double braces to work around the presence of commas in a macro, no
attempt has been done to fix those.

tst_qglobal had just some minor changes to keep testing the macro.

Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-19 19:38:23 +02:00
Volker Hilsheimer
44fb925f50 Phase 2 of removing QDesktopWidget
Remove QDestopWidget public header, simplify the implementation that
maintains a Qt::Desktop type QWidget for each QScreen, and turn
QWidget's initial target screen into a QScreen pointer.

QApplication::desktop() now takes an optional QScreen pointer, and
returns a QWidget pointer, so that applications and widgets can get
access to the root widget for a specific screen without having to
resort to private APIs.

QDesktopWidgetPrivate implementations to look up a screen for an index,
widget, or point are now all inline functions that thinly wrap
QGuiApplication::screens/screenAt calls. We should consider adding those
as convenience APIs to QScreen instead.

Note that QWidget::screen is assumed to return a valid pointer; there is
code that handles the case that it returns nullptr (but also code that
trusts that it never is nullptr), so this needs to be defined, verified
with tests, and asserted. We can then simplify the code further.

Change-Id: Ifc89be65a0dce265b6729feaf54121c35137cb94
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-06-08 20:29:49 +02:00
Oliver Wolff
45b0f1be68 Remove winrt
Macros and the await helper function from qfunctions_winrt(_p).h are
needed in other Qt modules which use UWP APIs on desktop windows.

Task-number: QTBUG-84434
Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-06-06 20:25:49 +02:00
Lars Knoll
b2ee684a13 Remove QRegExp support from QString and StringList
Replacement methods do now exist in QRegExp, or
for QRegularExpression when porting to it.

Remove all autotests associated with the old methods.

Change-Id: I3ff1e0da4b53adb64d5a48a30aecd8b960f5e633
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-14 14:19:47 +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
Edward Welbourne
7202df3689 Replace QTime with QElapsedTimer in benchmarks
Various benchmarks were still using the deprecated timing API.
One didn't even *use* the timer it implemented this way.
One was just using start as a short-hand for assigning to currentTime().

Change-Id: If406d0fb606e454fec056f386bcd0aa6726ee96e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-04-20 17:44:13 +02:00
Volker Hilsheimer
09dd94091f Remove deprecated members from graphics view classes
Change-Id: Ia192de674b1085edcf4a88cdeada6df89b442ddd
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-04-16 16:53:33 +02:00
Qt Forward Merge Bot
c937ed8af4 Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-04-08 22:04:23 +02:00
Alexandru Croitor
e0346df1b2 CMake: Handle finding of OpenSSL headers correctly
In Coin when provisioning for Android, we download and configure
the OpenSSL package, but don't actually build it. This means that
find_package(OpenSSL) can find the headers, but not the library,
and thus the package is marked as not found.

Previously the openssl_headers feature used the result of finding
the OpenSSL package, which led to it being disabled in the above
described Android case.

Introduce 2 new find scripts FindWrapOpenSSL and
FindWrapOpenSSLHeaders. FindWrapOpenSSLHeaders wraps FindOpenSSL,
and checks if the headers were found, regardless of the OpenSSL_FOUND
value, which can be used for implementing the openssl_headers feature.

FindWrapOpenSSL uses FindWrapOpenSSLHeaders, and simply wraps the
OpenSSL target if available.

The find scripts also have to set CMAKE_FIND_ROOT_PATH for Android.
Otherwise when someone passes in an OPENSSL_ROOT_DIR, its value will
always be prepended to the Android sysroot, causing the package not
to be found.

Adjust the mapping in helper.py to use the targets created by these
find scripts. This also replaces the openssl/nolink target.

Adjust the projects and tests to use the new target names.

Adjust the compile tests for dtls and oscp to use the
WrapOpenSSLHeaders target, so that the features can be enabled even
if the library is dlopen-ed (like on Android).

Task-number: QTBUG-83371
Change-Id: I738600e5aafef47a57e1db070be40116ca8ab995
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-04-08 22:03:24 +02:00
Qt Forward Merge Bot
8823bb8d30 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	examples/opengl/doc/src/cube.qdoc
	src/corelib/global/qlibraryinfo.cpp
	src/corelib/text/qbytearray_p.h
	src/corelib/text/qlocale_data_p.h
	src/corelib/time/qhijricalendar_data_p.h
	src/corelib/time/qjalalicalendar_data_p.h
	src/corelib/time/qromancalendar_data_p.h
	src/network/ssl/qsslcertificate.h
	src/widgets/doc/src/graphicsview.qdoc
	src/widgets/widgets/qcombobox.cpp
	src/widgets/widgets/qcombobox.h
	tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp
	tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
	tests/benchmarks/corelib/io/qdiriterator/qdiriterator.pro
	tests/manual/diaglib/debugproxystyle.cpp
	tests/manual/diaglib/qwidgetdump.cpp
	tests/manual/diaglib/qwindowdump.cpp
	tests/manual/diaglib/textdump.cpp
	util/locale_database/cldr2qlocalexml.py
	util/locale_database/qlocalexml.py
	util/locale_database/qlocalexml2cpp.py

Resolution of util/locale_database/ are based on:
https://codereview.qt-project.org/c/qt/qtbase/+/294250
and src/corelib/{text,time}/*_data_p.h were then regenerated by
running those scripts.

Updated CMakeLists.txt in each of
	tests/auto/corelib/serialization/qcborstreamreader/
	tests/auto/corelib/serialization/qcborvalue/
	tests/auto/gui/kernel/
and generated new ones in each of
	tests/auto/gui/kernel/qaddpostroutine/
	tests/auto/gui/kernel/qhighdpiscaling/
	tests/libfuzzer/corelib/text/qregularexpression/optimize/
	tests/libfuzzer/gui/painting/qcolorspace/fromiccprofile/
	tests/libfuzzer/gui/text/qtextdocument/sethtml/
	tests/libfuzzer/gui/text/qtextdocument/setmarkdown/
	tests/libfuzzer/gui/text/qtextlayout/beginlayout/
by running util/cmake/pro2cmake.py on their changed .pro files.

Changed target name in
	tests/auto/gui/kernel/qaction/qaction.pro
	tests/auto/gui/kernel/qaction/qactiongroup.pro
	tests/auto/gui/kernel/qshortcut/qshortcut.pro
to ensure unique target names for CMake

Changed tst_QComboBox::currentIndex to not test the
currentIndexChanged(QString), as that one does not exist in Qt 6
anymore.

Change-Id: I9a85705484855ae1dc874a81f49d27a50b0dcff7
2020-04-08 20:11:39 +02:00
Qt Forward Merge Bot
86d9e36b06 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	tests/benchmarks/corelib/text/qstringlist/qstringlist.pro

Change-Id: Ie9b97bd83c2df00fd9b556b5f09d405f71970169
2020-04-03 09:01:44 +02:00
Edward Welbourne
53ed635dbb Set CONFIG += benchmark in corelib's various benchmarks
This leads to "make benchmark" actually running the benchmark, which
would be nice, I think. Purged various CONFIG += release or -= debug
lines from the same configurations; those surely only configure how
the test code is compiled, which is more or less pointless; it's the
code under test whose debug/release state matters, and I don't suppose
that's affected by the build config of the test code.

In the process, reduce diversity of the ordering of lines within these
*.pro files and purge some dangling space.

Change-Id: Ia9f9f0ca4c096262de928806bdfa6ea3b9e7b9ba
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-04-02 18:33:42 +02:00
Liang Qi
576dc2c701 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/plugins/platforms/xcb/qxcbdrag.cpp

Change-Id: I0b47324b70b0b4894e54b21aa3e7a5041f9bd5e3
2020-03-24 14:36:02 +01:00
Robin Burchell
2af04860f6 qtimezoneprivate_tz: Apply a cache over the top of timezone data
Constantly re-reading the timezone information only to be told the exact
same thing is wildly expensive, which can hurt in operations that cause
a lot of QTimeZone creation, for example, V4's DateObject - which
creates them a lot (in DaylightSavingTA).

This performance problem was identified when I noticed that a
QDateTime binding updated once per frame was causing >100% CPU usage
(on a desktop!) thanks to a QtQuickControls 1 Calendar (which has a
number of bindings to the date's properties like getMonth() and so
on).

The newly added tst_QTimeZone::systemTimeZone benchmark gets a ~90%
decrease in instruction count:

--- before
+++ after
 PASS   : tst_QTimeZone::systemTimeZone()
 RESULT : tst_QTimeZone::systemTimeZone():
-     0.024 msecs per iteration (total: 51, iterations: 2048)
+     0.0036 msecs per iteration (total: 59, iterations: 16384)

Also impacted (over in QDateTime) is
tst_QDateTime::setMSecsSinceEpochTz(). The results here are - on the
surface - less impressive (~0.17% drop), however, it isn't even
creating QTimeZone on a hot path to begin with, so a large drop would
have been a surprise.

Added several further benchmarks to cover non-system zones and
traverse transitions.

Done-With: Edward Welbourne <edward.welbourne@qt.io>
Task-number: QTBUG-75585
Change-Id: I044a84fc2d3a2dc965f63cd3a3299fc509750bf7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-03-20 16:58:09 +02:00
Lars Knoll
47b1e883e4 Remove the old harfbuzz library and integration code
It's not used anymore. harfbuzz-ng is a requirement in Qt 6 if you
want any open type shaping.

Fixes: QTBUG-82881
Change-Id: If7100aebdcfa078a999608bb8f07a2ef3a79d282
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
2020-03-17 01:43:29 +01:00
Alexandru Croitor
8facb31fde CMake: Regenerate tests projects
Change-Id: I559bf2c82d83fac9bd3c52a331d99e1e83bc3f87
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-03-12 11:41:39 +01:00
Qt Forward Merge Bot
865afac250 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ibee5acec72a1a1769d4bc5f23f56c7dc8d4cf3cb
2020-03-11 15:34:21 +01:00
Jarek Kobus
50d2acdc93 Add default arguments to QPainterPath methods using transform
Fixes: QTBUG-82602
Change-Id: Id82f145ffb33e6d4ef9b81282ad14657b1c8fbd0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-03-06 21:09:48 +01:00
Qt Forward Merge Bot
63312fe2ec Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: If36d96c0fef3de5ab6503977501c55c62a2ecc97
2020-03-03 14:13:02 +01:00
Edward Welbourne
305ddbeb5b Use Qt::SplitBehavior in preference to QString::SplitBehavior
The Qt version was added in 5.14 "for use as eventual replacement for
QString::SplitBehavior." Move another step closer to that goal.

Change-Id: I399b5ea56e9255e775ca1746632f7421519a6616
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-02-28 15:37:11 +01:00
Johan Klokkhammer Helsing
3673ee9823 Fix build errors for GraphicsViewBenchmark
QGL* has been removed amongst other things

Task-number: QTBUG-74408
Task-number: QTBUG-74409
Change-Id: Ia19774f2bb6d0b86b3fbde224cbc8652b4ae0b22
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-02-28 12:03:48 +01:00
Lars Knoll
a450cce6b6 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I469b0501cc65fc5ce4d797a69ae89405cc69c7f8
2020-02-28 09:48:30 +01:00
Alexander Akulich
4c86e667d2 Revert "QNetworkReply: deprecate the 'error' getter"
This reverts commit ccb2cb84f5 and
commit 0f568d0a67.

The patches fix ambiguity between a getter and a signal by changing the
getter name, but we still have to rename the signal to follow the signals
naming convention.

Revert the commits to keep the getter as is and change the signal name instead.

Change-Id: Iddbab7c33eea03826ae7c114a01857ed45bde6db
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-02-28 07:21:14 +03:00
Johan Klokkhammer Helsing
f6f6eab89f Remove opengl benchmark
It used QGLPixelBuffer. Not sure how/if it could've been ported to QOpenGL.

Task-number: QTBUG-74408
Change-Id: I1271f501ccad4ae391ee0f6fc5a1ddfaf46ef0af
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-02-27 14:31:49 +01:00
Leander Beernaert
0959c75d16 Apply the same fix from test/auto/network to network benchmarks
Change-Id: I81d41aa526d5c06adef637e756a3d81e799443e4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-02-20 16:11:01 +01:00
Alexandru Croitor
0d177053b9 Regenerate projects one last time before merge
Change-Id: Ia24cf56b79ca6dacd370a7e397024e9b663e0167
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-12 17:30:49 +00:00
Alexandru Croitor
c9e67a7926 CMake: Regenenerate projects where recent changes happened
Change-Id: If86e49d73a45b7cfc494fa48bdc6cb1ba503b112
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-02-11 10:19:45 +01:00
Mårten Nordheim
3568ad58f5 Introduce a configure-time check for C++17 filesystem
Various compilers have various fun ways of failing to compile when it
is used so let's check if they will work properly during configure
rather than much later.

Change-Id: Ia93d4b91b3d269b4cab2a5f677c3c89e06b44ce3
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-02-07 23:51:06 +01:00
Alexandru Croitor
43d2b60a29 Post-merge fixes
Change-Id: I6acd29103f6cc550544e7422328d97ea0e2dcafb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-30 20:45:08 +00:00
Alexandru Croitor
a1dbdcbd6e Merge remote-tracking branch 'origin/dev' into wip/cmake
Conflicts:
        src/corelib/Qt5CoreConfigExtras.cmake.in
        src/corelib/Qt5CoreMacros.cmake
        src/dbus/Qt5DBusConfigExtras.cmake.in
        src/widgets/Qt5WidgetsConfigExtras.cmake.in

Change-Id: Ib782f3b177c38b2cce83beebe15be9c0baa578f7
2020-01-29 16:57:27 +01:00
Simon Hausmann
a4ea0d9eac Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ia5727ce68001bcaab467f5fae3a4933d1217015f
2020-01-28 18:27:28 +01:00
Qt Forward Merge Bot
558fc903ac Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/corelib/io/qsettings.cpp
	src/corelib/kernel/qvariant.cpp
	src/corelib/serialization/qjsoncbor.cpp
	src/corelib/serialization/qjsonvalue.cpp
	src/corelib/tools/tools.pri
	src/gui/image/qimage.cpp
	src/gui/kernel/qguivariant.cpp
	src/widgets/kernel/qshortcut.cpp
	tests/auto/tools/moc/allmocs_baseline_in.json
	tests/auto/tools/moc/tst_moc.cpp
        src/opengl/qglframebufferobject.cpp

Done-With: Edward Welbourne <edward.welbourne@qt.io>
Done-With: Leander Beernaert <leander.beernaert@qt.io>
Change-Id: Ie7f5fa646c607fe70c314bf7195f7578ded1d271
2020-01-28 14:14:20 +00:00
Jarek Kobus
4bb897a384 Deprecate all methods that use QMatrix
Don't use QMatrix in implementation classes anymore.

Task-number: QTBUG-46653
Fixes: QTBUG-81627
Change-Id: I4806c1302e42645dc6a608062c8d9c336ae8629b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-01-28 04:12:25 +01:00
Marc Mutz
f21a6d409e QStringList: use local storage in removeDuplicates()
If available, use a C++17 std::pmr::unordered_set with a monotonic
buffer resource and a 256-byte stack buffer to avoid the per-element
allocations of QSet.

Results on my machine:

 RESULT : tst_QStringList::removeDuplicates():"empty":
-     0.00014 msecs per iteration (total: 74, iterations: 524288)
+     0.000031 msecs per iteration (total: 66, iterations: 2097152)
 RESULT : tst_QStringList::removeDuplicates():"short-dup-0.00":
-     0.00043 msecs per iteration (total: 57, iterations: 131072)
+     0.00013 msecs per iteration (total: 69, iterations: 524288)
 RESULT : tst_QStringList::removeDuplicates():"short-dup-0.50":
-     0.00049 msecs per iteration (total: 65, iterations: 131072)
+     0.00032 msecs per iteration (total: 85, iterations: 262144)
 RESULT : tst_QStringList::removeDuplicates():"short-dup-0.66":
-     0.00057 msecs per iteration (total: 75, iterations: 131072)
+     0.00039 msecs per iteration (total: 52, iterations: 131072)
 RESULT : tst_QStringList::removeDuplicates():"short-dup-0.75":
-     0.00064 msecs per iteration (total: 85, iterations: 131072)
+     0.00048 msecs per iteration (total: 63, iterations: 131072)
 RESULT : tst_QStringList::removeDuplicates():"long-dup-0.00":
-     0.083 msecs per iteration (total: 85, iterations: 1024)
+     0.039 msecs per iteration (total: 80, iterations: 2048)
 RESULT : tst_QStringList::removeDuplicates():"long-dup-0.50":
-     0.11 msecs per iteration (total: 58, iterations: 512)
+     0.078 msecs per iteration (total: 80, iterations: 1024)
 RESULT : tst_QStringList::removeDuplicates():"long-dup-0.66":
-     0.13 msecs per iteration (total: 70, iterations: 512)
+     0.10 msecs per iteration (total: 53, iterations: 512)
 RESULT : tst_QStringList::removeDuplicates():"long-dup-0.75":
-     0.16 msecs per iteration (total: 86, iterations: 512)
+     0.13 msecs per iteration (total: 69, iterations: 512)

When interpreting the data, take into account that each iteration
contains _also_ a deep copy of the QStringList d/t the detach from
'input'.

The pattern is used elsewhere in Qt, so I've put the class that
implements the seen set into a private header file and used in some
other places I found.

Change-Id: I1f71a82008a16d5a3818f91f290ade21d837805e
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2020-01-26 08:11:58 +00:00
Leander Beernaert
502d3d6744 Merge remote-tracking branch 'origin/dev' into merge-dev
Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
2020-01-24 13:17:33 +01:00
Johan Klokkhammer Helsing
f3ecda32e0 Move QOpenGLPaintEngine and related classes from QtGui to QtOpenGL
Also moves the openglwindow test to the opengl folder, as it makes use of these
classes.

Task-number: QTBUG-74409
Change-Id: Id9f0013cedcc8bd1e87122c005641d7298525045
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-01-22 09:40:59 +01:00
Qt Forward Merge Bot
0a4e5bb265 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/widgets/kernel/qshortcut.cpp
	tests/auto/network/access/spdy/tst_spdy.cpp

Change-Id: If76c434beac2c0a393440aa365f89f77439774ce
2020-01-16 11:20:42 +01:00
Qt Forward Merge Bot
d14fd32d40 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	tests/benchmarks/network/access/qnetworkreply/tst_qnetworkreply.cpp
	tests/auto/network/access/spdy/tst_spdy.cpp

Change-Id: I3196c5f7b34f2ffc9ef1e690d02d5b9bb3270a74
2020-01-15 10:14:05 +01:00
Qt Forward Merge Bot
c3123c757a Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I8dbcf23835d52d3aa7d018ed250814d60c68aa83
2020-01-15 01:00:39 +01:00
Tor Arne Vestbø
eb2a7738a4 Skip instead of fail tests when test server is not available
We were being inconsistent in how we handled this, some tests skipping
while others using QVERIFY. It makes more sense to skip the tests, since
the problem is a missing pre-condition of the test, not the test itself
being bad or exposing real failures in the implementation.

Change-Id: I20eacfe12dbce0b0d926e48cbe2d2772819fa4a5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-01-14 00:15:16 +01:00
Timur Pocheptsov
ccb2cb84f5 QNetworkReply: deprecate the 'error' getter
To disambiguate &QNetworkReply::error expression.

[ChangeLog][Deprecation Notice] QNetworkReply::error() (the getter) was deprecated; superseded by networkError().

Task-number: QTBUG-80369
Change-Id: I545f963788bce0800c9e0f0c94d5f1029946effe
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-01-13 15:50:47 +01:00
Liang Qi
a503bf5470 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/corelib/tools/qvector.h
		Make QVector(DataPointer dd) public to be able to properly merge
		5b4b437b30 from 5.15 into dev.
	src/widgets/kernel/qapplication.cpp
	tests/auto/tools/moc/allmocs_baseline_in.json

Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Change-Id: I929ba7c036d570382d0454c2c75f6f0d96ddbc01
2020-01-04 15:32:34 +01:00
Mårten Nordheim
d98a1ef902 Add QMap::insert(const QMap &map)
As opposed to unite(), this inserts one map into the other
without duplicating elements.

Task-number: QTBUG-35544
Change-Id: Ie8ab350b29148851a3176cef1007e8a4ca82c273
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-12-12 15:25:30 +01:00
Qt Forward Merge Bot
5b193e3dd4 Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2019-12-11 14:52:25 +01:00
Qt Forward Merge Bot
a4a7c1bcf7 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp

Change-Id: I6b82507bf9a80a374c40393e72f4843f1557de89
2019-12-11 14:50:53 +01:00
Johan Klokkhammer Helsing
f08038fca7 Remove deprecated QGL* classes
Removes QGL paths in sub-attaq and chip examples.

The boxes example depended on QGL and has been removed.

The corresponding module and test directories for the opengl module are now
empty, but has been left there so we can move the QOpenGL* classes there.

[ChangeLog][QtOpenGL] The deprecated QGL* classes have been removed.

Fixes: QTBUG-74408
Change-Id: I52f56409af8f6901359462a7ba162103d051fe3d
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-12-11 11:53:15 +01:00
Liang Qi
90210d5d9c Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	tests/auto/network/kernel/qnetworkinterface/BLACKLIST

Change-Id: I1e8866c63b54bcd95fc2a044276ee15b7f60e79a
2019-12-10 13:51:40 +02:00
Tor Arne Vestbø
c3bd5ffdc8 Don't wrap feature detection macros with QT_HAS_FOO() variants
Using wrappers for these macros is problematic when for example passing the
-frewrite-includes flag to preprocess sources before shipping off to distcc
or Icecream. It will also start producing warnings when compilers implement
http://eel.is/c++draft/cpp.cond#7.sentence-2. See for example
https://reviews.llvm.org/D49091

Both https://clang.llvm.org/docs/LanguageExtensions.html and the SD-6 document at
https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations
recommend defining '__has_foo(x) 0' as a fallback for compilers without the
macros, so that's what we go for.

Change-Id: I0298cd3b4a6ff6618821e34642a5ddd6728be767
Reviewed-by: Alex Richardson <arichardson.kde@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-12-10 00:48:07 +01:00
Qt Forward Merge Bot
4c89005ebe Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Icbb60f8c1891ec2779575276495199ace9d3d6c3
2019-11-30 01:00:58 +01:00
Allan Sandfeld Jensen
00c869a5c6 Fix lancelot PaintCommands for reuse
Some structures needed to be cleaned for the reuse to be safe.
Reusing it cuts down on the overhead in lancebench.

Also uniqueness of block names are now enforced, and the common pattern
of "end_block blockName" could now be parsed if not always commented
out by begin_block handling.

Change-Id: I0daf6445292383aaab9392550d0842e0a654ad27
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-11-28 19:52:16 +00:00
Leander Beernaert
1c655fb0fc Post merge fixes
Change-Id: I78d3c9687f99c0a32da04257e297e88ef0b02581
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-25 14:53:27 +00:00
Qt Forward Merge Bot
58c69df4d3 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/corelib/tools/qhash.h
	src/gui/kernel/qevent.h
	src/widgets/kernel/qshortcut.cpp
	src/widgets/kernel/qshortcut.h

Change-Id: If61c206ee43ad1d97f5b07f58ac93c4583ce5620
2019-11-25 11:30:04 +01:00
Allan Sandfeld Jensen
af2daafde7 Deprecate constructing QFlags from a pointer
This was used to support QFlags f = 0 initialization, but with 0 used
as a pointer literal now considered bad form, it had been changed many
places to QFlags f = nullptr, which is meaningless and confusing.

Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-11-20 19:43:38 +01:00
Leander Beernaert
26e8769124 Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: Ifecc2d9db396d783124df8567553ba5f846f30bb
2019-11-19 13:53:21 +01:00
Leander Beernaert
0ca41ee2aa Fix build for tests/benchmarks/corelib/kernel/qtimer_vs_qmetaobject
Change-Id: I9c793e38b89cc00c8835bdcf85e9ab0b714da1c8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-13 14:01:38 +00:00
Alexandru Croitor
5c28fce38e Regenerate qtbase tests and src/* for some small fixes
Change-Id: I049829492971875a5c5ff159104707d9e2ad1e46
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 13:36:09 +00:00
Leander Beernaert
344e4ec827 Convert remaining tests/benchmarks
Change-Id: Ie7d49d4dc5bf6b2345b54f6bdfffcd974123f729
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-04 15:48:51 +00:00
Lars Knoll
06456873fc Get rid of QT_STRICT_ITERATORS
The concept was a nice idea to avoid accidental detach() calls
in implicitly shared containers, but it conflicts with a C++11
compatible API for them, with signatures for modifying methods
taking a const_iterator as argument and returning an iterator
(e.g. iterator erase(const_iterator)).

Change-Id: Ia33124bedbd260774a0a66f49aedd84e19c9971b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-04 12:52:26 +00:00
Volker Hilsheimer
226a60baf5 Replace Q_ALIGNOF usage in qtbase with C++11 alignof keyword
The macro is not documented, so not part of the public Qt API. It is
made obsolete by the alignof keyword in C++11.

Remove the usage of the macro across qtbase, in particular the
workarounds for compilers that didn't support alignof, and that will
not be supported in Qt 6.

The macro definition is left in place, no need to break existing
code.

Task-number: QTBUG-76414
Change-Id: I1cfedcd4dd748128696cdfb546d97aae4f98c3da
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-10-29 10:37:02 +01:00
Mårten Nordheim
399f815143 qdiriterator benchmark: test against std::filesystem
If c++17 is available and the header is available (not
experimental/filesystem) then we'll try
std::filesystem::recursive_directory_iterator as well.

Results on my PC (Windows, VS 2019):

PASS   : tst_qdiriterator::posix(C:\depot\qt\main/src/corelib)
RESULT : tst_qdiriterator::posix():"C:\depot\qt\main/src/corelib":
     23 msecs per iteration (total: 94, iterations: 4)
PASS   : tst_qdiriterator::diriterator(C:\depot\qt\main/src/corelib)
RESULT : tst_qdiriterator::diriterator():"C:\depot\qt\main/src/corelib":
     17 msecs per iteration (total: 71, iterations: 4)
PASS   : tst_qdiriterator::stdRecursiveDirectoryIterator(C:\depot\qt\main/src/corelib)
RESULT : tst_qdiriterator::stdRecursiveDirectoryIterator():"C:\depot\qt\main/src/corelib":
     6.7 msecs per iteration (total: 54, iterations: 8)
PASS   : tst_qdiriterator::fsiterator(C:\depot\qt\main/src/corelib)
RESULT : tst_qdiriterator::fsiterator():"C:\depot\qt\main/src/corelib":
     23 msecs per iteration (total: 92, iterations: 4)

And as a drive-by fix: move the 'data' function out of the private slots
so it is not invoked as a test function (it doesn't cause any problems
but is ultimately pointless).

Change-Id: Ia160ee276423ec51e35e554a4cd63d4d940c0e6a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-10-21 12:40:49 +02:00
Alexandru Croitor
440286655e Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: I4a78428a8ea273b6960792e3b8043f816fa37fcf
2019-10-14 17:46:34 +02:00
Qt Forward Merge Bot
e164d61ca8 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I129dd579f92cb2592a38ca043472b45cb926ae12
2019-10-14 01:00:34 +02:00
Christian Ehrlicher
b43f5ed2da QMYSQL: remove support for MySql 4.x
MySql 5.0 was released 2005 so it's time to remove support for MySql 4.x
14 years later.

[ChangeLog][QtSql][QMYSQL] Removed support for MySql < 5.0 since 5.0 was
released 14 years ago.

Change-Id: I45005accdffefbd9338ac0e710512a4c7ea8e09e
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-10-12 08:31:01 +02:00
Qt Forward Merge Bot
721a0e8078 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I6ad865b2c26003f4508da9b3f8e075a951ff8ef7
2019-10-12 01:01:25 +02:00
Alexandru Croitor
f4b4c4f79b Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I3a1d7673c3c20019ab12a2ea0a60f1619920a34c
2019-10-11 16:23:19 +02:00
Mårten Nordheim
d79726e9eb Win: QUdpSocket: Use QVarLengthArray for retrieving size
Increased size of the peek buffer to 2048 from 1500 and now
uses QVarLengthArray with space for 10 stack-allocated WSABUF instances,
but still growing at the pace of 5.

In benchmarking (created for and included in this patch) this shows
better performance when retrieving the datagram size for larger
datagrams, and the same performance as before for smaller datagrams
(at the cost of 2048 - 1500 + 16 * 10 = 708 bytes extra stack space).

Benchmarks:

With changes:

********* Start testing of tst_QUdpSocket *********
Config: Using QtTest library 5.13.1, Qt 5.13.1 (x86_64-little_endian-llp64 shared (dynamic) release build; by MSVC 2019)
PASS   : tst_QUdpSocket::initTestCase()
PASS   : tst_QUdpSocket::pendingDatagramSize(52)
RESULT : tst_QUdpSocket::pendingDatagramSize():"52":
     0.0038 msecs per iteration (total: 63, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(1024)
RESULT : tst_QUdpSocket::pendingDatagramSize():"1024":
     0.0039 msecs per iteration (total: 64, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(2049)
RESULT : tst_QUdpSocket::pendingDatagramSize():"2049":
     0.0038 msecs per iteration (total: 63, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(4500)
RESULT : tst_QUdpSocket::pendingDatagramSize():"4500":
     0.0039 msecs per iteration (total: 64, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(4098)
RESULT : tst_QUdpSocket::pendingDatagramSize():"4098":
     0.0040 msecs per iteration (total: 66, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(8192)
RESULT : tst_QUdpSocket::pendingDatagramSize():"8192":
     0.0040 msecs per iteration (total: 67, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(12000)
RESULT : tst_QUdpSocket::pendingDatagramSize():"12000":
     0.010 msecs per iteration (total: 90, iterations: 8192)
PASS   : tst_QUdpSocket::pendingDatagramSize(25000)
RESULT : tst_QUdpSocket::pendingDatagramSize():"25000":
     0.021 msecs per iteration (total: 88, iterations: 4096)
PASS   : tst_QUdpSocket::pendingDatagramSize(32768)
RESULT : tst_QUdpSocket::pendingDatagramSize():"32768":
     0.033 msecs per iteration (total: 69, iterations: 2048)
PASS   : tst_QUdpSocket::pendingDatagramSize(64512)
RESULT : tst_QUdpSocket::pendingDatagramSize():"64512":
     0.088 msecs per iteration (total: 91, iterations: 1024)
PASS   : tst_QUdpSocket::cleanupTestCase()
Totals: 12 passed, 0 failed, 0 skipped, 0 blacklisted, 3090ms
********* Finished testing of tst_QUdpSocket *********

Without changes:

********* Start testing of tst_QUdpSocket *********
Config: Using QtTest library 5.13.1, Qt 5.13.1
(x86_64-little_endian-llp64 shared (dynamic) release build; by MSVC 2019)
PASS   : tst_QUdpSocket::initTestCase()
PASS   : tst_QUdpSocket::pendingDatagramSize(52)
RESULT : tst_QUdpSocket::pendingDatagramSize():"52":
     0.0039 msecs per iteration (total: 65, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(1024)
RESULT : tst_QUdpSocket::pendingDatagramSize():"1024":
     0.0039 msecs per iteration (total: 65, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(2049)
RESULT : tst_QUdpSocket::pendingDatagramSize():"2049":
     0.0040 msecs per iteration (total: 66, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(4500)
RESULT : tst_QUdpSocket::pendingDatagramSize():"4500":
     0.0040 msecs per iteration (total: 67, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(4098)
RESULT : tst_QUdpSocket::pendingDatagramSize():"4098":
     0.0040 msecs per iteration (total: 67, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(8192)
RESULT : tst_QUdpSocket::pendingDatagramSize():"8192":
     0.010 msecs per iteration (total: 90, iterations: 8192)
PASS   : tst_QUdpSocket::pendingDatagramSize(12000)
RESULT : tst_QUdpSocket::pendingDatagramSize():"12000":
     0.010 msecs per iteration (total: 90, iterations: 8192)
PASS   : tst_QUdpSocket::pendingDatagramSize(25000)
RESULT : tst_QUdpSocket::pendingDatagramSize():"25000":
     0.033 msecs per iteration (total: 69, iterations: 2048)
PASS   : tst_QUdpSocket::pendingDatagramSize(32768)
RESULT : tst_QUdpSocket::pendingDatagramSize():"32768":
     0.0502 msecs per iteration (total: 103, iterations: 2048)
PASS   : tst_QUdpSocket::pendingDatagramSize(64512)
RESULT : tst_QUdpSocket::pendingDatagramSize():"64512":
     0.13 msecs per iteration (total: 70, iterations: 512)
PASS   : tst_QUdpSocket::cleanupTestCase()
Totals: 12 passed, 0 failed, 0 skipped, 0 blacklisted, 3192ms
********* Finished testing of tst_QUdpSocket *********

Fixes: QTBUG-78275
Change-Id: If86a226620244aa4e470600c6c1db4a7863b5617
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-11 11:36:16 +02:00
Timur Pocheptsov
13e0a36626 Retire SPDY protocol implementation (Qt6)
As it was superseded by HTTP/2. Bye, Speedy. Since it's Qt 6,
we also fix the attribute's enumerator to fit our coding
convention with HTTP2AllowedAttribute becoming Http2AllowedAttribute,
and the same for HTTP2WasUsedAttribute.

tst_qnetworkreply in 'benchmark' directory of qtbase/tests
was updated - we have the logic they tested in preConnectEncrypted
in tst_http2 now.

Manual qnetworkreply test was updated (instead of SPDY in NPN failure
we can use H2, the second test was deleted - again, auto-tested in
tst_http2).

Change-Id: I559c140c333ddf72664911c6e275b1d0d2b980a9
Task-number: QTBUG-78255
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-09-25 14:46:28 +02:00
Simon Hausmann
e3888dd932 Merge remote-tracking branch 'origin/wip/qt6' into dev
Conflicts:
	src/gui/image/qpicture.cpp

Change-Id: Iecf79f96f54dc23bd703e6c4c634f909b796d7b3
2019-09-18 08:30:11 +02:00
Friedemann Kleint
d49d076431 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ic1fd51143f903b7e9086fc19ca960dfd9654ee00
2019-09-17 08:32:43 +02:00
Marc Mutz
333b1e9229 QReadWriteLock: add a check for writeOnly, too
Results on my machine:

  PASS   : tst_QReadWriteLock::writeOnly(QMutex)
  RESULT : tst_QReadWriteLock::writeOnly():QMutex:
     3,607 msecs per iteration (total: 3,607, iterations: 1)
  PASS   : tst_QReadWriteLock::writeOnly(QReadWriteLock)
  RESULT : tst_QReadWriteLock::writeOnly():QReadWriteLock:
     39,703 msecs per iteration (total: 39,703, iterations: 1)
  PASS   : tst_QReadWriteLock::writeOnly(std::mutex)
  RESULT : tst_QReadWriteLock::writeOnly():std::mutex:
     3,697 msecs per iteration (total: 3,697, iterations: 1)
  PASS   : tst_QReadWriteLock::writeOnly(std::shared_mutex)
  RESULT : tst_QReadWriteLock::writeOnly():std::shared_mutex:
     5,727 msecs per iteration (total: 5,727, iterations: 1)
  PASS   : tst_QReadWriteLock::writeOnly(std::shared_timed_mutex)
  RESULT : tst_QReadWriteLock::writeOnly():std::shared_timed_mutex:
     5,921 msecs per iteration (total: 5,921, iterations: 1)

(the 'nothing' test of course doesn't work with writing, as writing to
the same QString from different threads is UB)

Change-Id: Ia78b54963a51eaf6563ce0d243316a3337056a83
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-09-12 06:38:42 +02:00
Marc Mutz
72259e7186 Brush up QReadWriteLock benchmark
- add override
- tests C++17 shared_mutex in addition to C++14 shared_timed_mutex
- replace manual memory management with unique_ptr

Change-Id: If52df2097a4b92c10df4a7cdbb1c506d64b673e3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-09-12 06:38:23 +02:00
Allan Sandfeld Jensen
f92d8fd64e Combine BGR30_to_RGB30 and BGR888_to_RGB888
And let the meat of the function be shared with the rbSwap routine.

Change-Id: I0ea18b30c26ff050c17dcb3ad4d654bfbb8c6221
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-09-05 17:41:21 +02:00
Alexandru Croitor
f255b1e8e2 Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: I54741635460bb2d8f3fd0be535ee1968d6c442bb
2019-09-04 14:33:40 +02:00
Qt Forward Merge Bot
a2a4c3a5ff Merge remote-tracking branch 'origin/5.14' into dev
Change-Id: I525112b5afbbe8f7fbb54da527bddb94a0c2c242
2019-08-31 01:01:42 +02:00
Edward Welbourne
acd7259a03 Extend QDate's benchmark
Test more methods.
Document what the existing test covers.
Use the right #include for QDate.

Change-Id: I051542c244e5bc381aafa3ae38144e246919db7a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-30 11:22:07 +02:00
Edward Welbourne
14aa481614 Convert foreach to ranged for in QDateTime benchmark
Change-Id: I05cf7b1916afa94a9f0f9b83af9b4ebe20a04cf0
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-30 11:09:59 +02:00
Edward Welbourne
0556366ddb Deduplicate list-building code in QDateTime benchmark
Aside from the start-date and the end-date, and a variant with a
time-zone, the lists various tests were building were all built the
same way; so pack that up as a pair of functions (one without
time-zone, one with) to save duplication. Make the list in each
function const, ready for conversion of foreach loops to ranged for.

In the process, replace QList with QVector, reserve space before we
populate and use auto for the now-const list variables it's saved in.

Change-Id: I7d8cce459a4d6111cd645e8d3966ad769ab7e201
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2019-08-30 11:09:36 +02:00
Edward Welbourne
54f6c9bfd9 Fix unused variable warnings in QDateTime benchmark
Change-Id: Id123ace74cfa7b5ff406eabbfda0aad9f58c3fd4
Reviewed-by: David Faure <david.faure@kdab.com>
2019-08-30 10:55:46 +02:00
Edward Welbourne
06f69700af Fix some bogus date calculations in QDateTime's benchmark
Multiplying a Julian Day number by the number of milliseconds per day
does not get you a time since the start of 1970; it gets you a time
since the start of the Julian Day number system, which was several
millennia earlier.

Change-Id: Ic90a6c3de445baf9cfd30f28dd847f146e6a7adf
Reviewed-by: David Faure <david.faure@kdab.com>
2019-08-30 10:55:12 +02:00
Jędrzej Nowacki
949482f8e4 Add QObject allocation benchmarks
The benchmark measures the performance of QObject allocation,
including costs of memory allocations.

Change-Id: I5d8ecfb97fe0be3375340b5ce84eb423e8a4ddaf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-29 14:04:27 +02:00
Liang Qi
0f1f7fb97f Merge remote-tracking branch 'origin/dev' into 5.14
Conflicts:
	src/widgets/kernel/qwidget.cpp
	src/widgets/kernel/qwidget_p.h
	src/widgets/kernel/qwidgetrepaintmanager.cpp
	src/widgets/kernel/qwidgetwindow.cpp
	tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp

Change-Id: Ifae457d0427be8e2465e474b055722e11b3b1e5c
2019-08-27 09:45:52 +02:00
Allan Sandfeld Jensen
5d94aac2ba Introduce QImage::Format_BGR888
Is pretty common on some architectures so we can avoid swizzling by
supporting it.

Fixes: QTBUG-45671
Change-Id: Ic7a21b5bfb374bf7496fd2b2b1252c2f1ed47705
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-08-23 11:54:09 +02:00
Tor Arne Vestbø
ce73b4db62 Remove dead code from Qt 4 times
The benefit of keeping this code around was to inspire or inform
changes in the areas to take into account possibly missing features
in Qt 5, but at this point that benefit is questionable. We can
always use the history to learn about missing pieces if needed.

Change-Id: I87a02dc451e9027be9b97554427bf8a1c6b2c025
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-08-20 22:27:46 +00:00
Allan Sandfeld Jensen
2cddaf0071 Fix tst_bench_qimagereader
It couldn't find the test images if not build in sources.

Change-Id: Ieeb5a76694a37d05b3e9a4ed0154885040b0812f
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-08-20 22:47:09 +02:00
Alexandru Croitor
c7ec7cd2a1 Merge branch 'wip/qt6' into wip/cmake
Change-Id: I50ac36b8803c296998149e98cc61e38687cdd14b
2019-08-15 16:53:19 +02:00
Lars Knoll
6f357f50b4 Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: Ib719a6249069e6bd6c9311bbec7f364855ab82ff
2019-08-06 12:24:37 +02:00
Sona Kurazyan
376715f1a5 Remove usages of deprecated APIs of qtbase/widgets
- Replace the usages of deprecated APIs by corresponding
  alternatives in the library code and documentation.

- Build docs for deprecated APIs conditionally, based on deprecation
  version. Remove the docs of methods deprecated since 5.0.0, these
  methods are not compiled anymore.

- Modify the tests to make them build when deprecated APIs disabled:
    * Make 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, add tests for the replacement

Task-number: QTBUG-76491
Task-number: QTBUG-76540
Task-number: QTBUG-76541
Change-Id: I6aaf0a1369c479fb880369a38f2b8e1e86b46934
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-08-01 17:04:13 +00:00
Qt Forward Merge Bot
f9b8c544e6 Merge remote-tracking branch 'origin/5.13' into dev
Change-Id: Ic6cfe08dbda1dc92b969e67063f805df63ba0fcf
2019-07-27 01:00:37 +02:00
Liang Qi
bf08e0bbb2 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/network/access/qhttpthreaddelegate.cpp

Change-Id: Id47b977587e2d713c16ac17e63c5ec80c2f05ee9
2019-07-26 10:13:06 +02:00
Marc Mutz
ca5fc087bd Re-apply 'Skip old benchmark that doesn't build automatically'
This commit re-applies commit f8efe8e0c9,
which was lost in the recent tools → text changes.

Change-Id: I03ce35fcb89840e5607776d67578fb75b66f6eb2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-07-24 07:45:59 +03:00
Allan Sandfeld Jensen
c21cc647e9 Fix lancebench results oddness
Imports were expanded in the list of commands every time they were
evaluated. This meant any test with imports ran slower and slower the
more iterations it got through.

Fixed by creating a new PaintCommands object every time and living with
initialization of it being part of the benchmark results.

Change-Id: Ib53a3a25f1393437452bc5aede04ccb63e8715a6
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-07-23 11:47:51 +00:00
Sona Kurazyan
2f33e030b8 Remove usages of deprecated APIs of qtbase/gui
- Replaced the usages of deprecated APIs 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.

Change-Id: Ic38245015377fc0c8127eb5458c184ffd4b450f1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-13 10:43:15 +02:00
Alexandru Croitor
4dac45c9ee Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
Change-Id: I715b1d743d5f11560e7b3fbeb8fd64a5e5ddb277
2019-07-11 17:17:51 +02:00
Edward Welbourne
a9aa206b7b Move text-related code out of corelib/tools/ to corelib/text/
This includes byte array, string, char, unicode, locale, collation and
regular expressions.

Change-Id: I8b125fa52c8c513eb57a0f1298b91910e5a0d786
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-07-10 17:05:30 +02:00
Mårten Nordheim
16158e1132 Win: qdiriterator bench: fix missing null-terminator issues
It's not done by toWCharArray. This caused some issues as we were using
API requiring a null-terminator. wcslen for instance was measuring the
string as being millions of characters long, causing fairly quick
crashes when appending.

Change-Id: Iedaaf9f195be22a610543ab649da92a87cb71973
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-07-10 07:18:05 +00:00
Alexandru Croitor
3622ebaac5 Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: I02cbc4f77a82100b96cdb90c160ce0207f180d7f
2019-07-08 13:20:48 +02:00
Christian Ehrlicher
1e4e006c3f QPainter: mark obsolete RenderHints as deprecated
RenderHint::HighQualityAntialiasing and NonCosmeticDefaultPen are
obsolete since Qt5 but not marked as such. Therefore add
Q_DECL_ENUMERATOR_DEPRECATED_X now so those two enumerations can be
removed with Qt6.

[ChangeLog][QtGui][QPainter] HighQualityAntialiasing and
NonCosmeticDefaultPen are marked as deprecated and don't have an effect
anymore

Change-Id: Ib0c966a078a1d23d492d0255288e2066c50e87b6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-07-03 06:53:34 +02:00
Sona Kurazyan
ff2b2032a0 Remove usages of deprecated APIs from QtAlgorithms
Task-number: QTBUG-76491
Change-Id: I9dab736a0cbd2e86588919640c26e8ce6b3674d0
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-06-29 21:58:36 +02:00
Simon Hausmann
7810209ba3 Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: I4ea2b77cc201daed94fbe321f146dfd20365a534
2019-06-26 11:33:19 +02:00
Alexandru Croitor
fe3bd212fc Merge remote-tracking branch 'origin/wip/qt6' into wip/cmake
This changes many different CMake places to mention Qt6 instead of
Qt5.

Note that some old qt5 cmake config files in corelib are probably not
needed anymore, but I still renamed and kept them for now.

Change-Id: Ie69e81540386a5af153f76c0242e18d48211bec4
2019-06-14 16:31:09 +02:00
Alexandru Croitor
4e875d988e Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: Ieb8efee9d74229b9f141ec715e3a9557586b51e8
2019-06-11 11:16:42 +02:00
Giuseppe D'Angelo
3e75c2965c Remove QLatin1Literal usages
That's an undocumented Qt 4/3/2 remnant, start remove usages.

Fix incorrect include header in qclass_lib_map.h as a drive-by.

Change-Id: I939be2621bc03e5c75f7e3f152546d3af6d37b91
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-10 16:50:31 +00:00
Alexandru Croitor
2a302a7361 Merge remote-tracking branch 'origin/dev' into wip/qt6
Change-Id: Iac12a37fa6536ebe30e6548f7c54ec0c402c9f5d
2019-06-06 19:00:41 +02:00
Alexandru Croitor
e4079eca49 Merge remote-tracking branch 'origin/dev' into wip/cmake
Take 5.

Change-Id: Ifb2d20e95ba824e45e667fba6c2ba45389991cc3
2019-06-03 15:14:42 +02:00
Edward Welbourne
548513a4bd Separate out the time, zone, date code from corelib/tools/
We'll be adding calendar code here as well, and tools/ was getting
rather crowded, so it looks like time to move out a reasonably
coherent sub-bundle of it all.

Change-Id: I7e8030f38c31aa307f519dd918a43fc44baa6aa1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-06-06 15:54:32 +02:00
Edward Welbourne
7efce5d510 Add a bench-mark for QDate's isValid() and daysInMonth()
The two perform related calculations, so test them together.
RESULT : tst_QDate::monthLengths():
     0.33 msecs per iteration (total: 87, iterations: 256)

Change-Id: I86b36a9182b00c0a1f40e858ed3e7812434974c4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-05-22 15:07:32 +02:00
Tobias Hunger
6630937e63 Merge commit 'dev' into 'wip/cmake-merge'
Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
2019-04-16 16:32:08 +02:00
Milian Wolff
58b4e07369 Optimize QTimer::singleShot(0, ...) when taking PMF or Functor callable
QTimer::singleShot is optimized for zero timeouts when using the API
taking a string method name. This optimization was not used for the API
taking a PMF or functor. This patch adds it, making the various API
calls behave similarly from a performance point of view.

The approach taken here requires a QObject context object. If none is
available, e.g. a nullptr was passed explicitly, or the
QTimer::singleShot(O, Functor) API was used, the optimization could
not easily be applied. This is not only bad from a performance POV,
but also poses as a potential source for heisenbugs: Using the
different API versions of QTimer::singleShot would use different code
paths internally, which then would not ensure the expected slot call
order. This problem actually existed already when mixing the
string-based slot syntax with PMF/functors in the QTimer::singleShot
API.

This patch overcomes this hurdle and fixes all of the above: When we
encounter a 0ms single shot timer, and no QObject context object is
available, we fall back to the main thread, or create a temporary
QObject for any other thread. The updated and extended benchmark
shows that this is still a significant performance improvement
over using a timer:

********* Start testing of qtimer_vs_qmetaobject *********
Config: Using QtTest library 5.14.0, Qt 5.14.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.2.1 20181127)
PASS   : qtimer_vs_qmetaobject::initTestCase()
PASS   : qtimer_vs_qmetaobject::bench(singleShot_slot)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_slot":
     7.48 msecs per iteration (total: 748, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(singleShot_pmf)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_pmf":
     7.20 msecs per iteration (total: 720, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(singleShot_functor)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_functor":
     6.79 msecs per iteration (total: 679, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(singleShot_functor_noctx)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_functor_noctx":
     6.92 msecs per iteration (total: 693, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(invokeMethod_string)
RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_string":
     7.34 msecs per iteration (total: 735, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(invokeMethod_pmf)
RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_pmf":
     6.90 msecs per iteration (total: 690, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(invokeMethod_functor)
RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_functor":
     6.62 msecs per iteration (total: 662, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_slot)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_slot":
     7.45 msecs per iteration (total: 745, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_pmf)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_pmf":
     7.46 msecs per iteration (total: 747, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_functor)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_functor":
     6.70 msecs per iteration (total: 671, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_functor_noctx)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_functor_noctx":
     13.75 msecs per iteration (total: 1,376, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(invokeMethod_string)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"invokeMethod_string":
     7.05 msecs per iteration (total: 706, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(invokeMethod_pmf)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"invokeMethod_pmf":
     6.70 msecs per iteration (total: 670, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(invokeMethod_functor)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"invokeMethod_functor":
     6.58 msecs per iteration (total: 658, iterations: 100)
PASS   : qtimer_vs_qmetaobject::cleanupTestCase()
Totals: 16 passed, 0 failed, 0 skipped, 0 blacklisted, 20977ms
********* Finished testing of qtimer_vs_qmetaobject *********

Without the change to qtimer.cpp, the results are:

********* Start testing of qtimer_vs_qmetaobject *********
Config: Using QtTest library 5.14.0, Qt 5.14.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 8.2.1 20181127)
PASS   : qtimer_vs_qmetaobject::initTestCase()
PASS   : qtimer_vs_qmetaobject::bench(singleShot_slot)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_slot":
     7.45 msecs per iteration (total: 745, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(singleShot_pmf)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_pmf":
     112.84 msecs per iteration (total: 11,285, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(singleShot_functor)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_functor":
     115.62 msecs per iteration (total: 11,563, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(singleShot_functor_noctx)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_functor_noctx":
     110.81 msecs per iteration (total: 11,082, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(invokeMethod_string)
RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_string":
     7.04 msecs per iteration (total: 704, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(invokeMethod_pmf)
RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_pmf":
     6.62 msecs per iteration (total: 662, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(invokeMethod_functor)
RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_functor":
     6.62 msecs per iteration (total: 662, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_slot)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_slot":
     7.45 msecs per iteration (total: 746, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_pmf)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_pmf":
     118.42 msecs per iteration (total: 11,842, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_functor)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_functor":
     119.35 msecs per iteration (total: 11,936, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(singleShot_functor_noctx)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"singleShot_functor_noctx":
     130.96 msecs per iteration (total: 13,096, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(invokeMethod_string)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"invokeMethod_string":
     8.08 msecs per iteration (total: 808, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(invokeMethod_pmf)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"invokeMethod_pmf":
     6.79 msecs per iteration (total: 680, iterations: 100)
PASS   : qtimer_vs_qmetaobject::benchBackgroundThread(invokeMethod_functor)
RESULT : qtimer_vs_qmetaobject::benchBackgroundThread():"invokeMethod_functor":
     7.49 msecs per iteration (total: 749, iterations: 100)
PASS   : qtimer_vs_qmetaobject::cleanupTestCase()
Totals: 16 passed, 0 failed, 0 skipped, 0 blacklisted, 153995ms
********* Finished testing of qtimer_vs_qmetaobject *********

Additionally, this patch adds a unit test to verify that the slot call
order for 0ms single shot timers is followed while mixing the various
API versions. It fails without this patch but passes now.

Finally, another test is added to verify that using QTimer::singleShot
before a QCoreApplication was constructed is still working properly.

Change-Id: I0d6211554b6198cb3e527be9ec3adc572b1b54ee
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-06 21:16:56 +00:00
Allan Sandfeld Jensen
5c90a96998 Remove handling of missing Q_COMPILER_CLASS_ENUM
Change-Id: I1fd6d601e49e803b4c3308fb0ca41136c628afbc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-04-06 16:19:14 +00:00
Allan Sandfeld Jensen
1ef274fb94 Replace qMove with std::move
Change-Id: I67df3ae6b5db0a158f86e75b99f422bd13853bc9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-04-06 11:00:38 +00:00
Milian Wolff
4413f7070a Enable and extend the qtimer_vs_qmetaobject benchmark
This benchmark was not compiled, and it only covered some parts of the
API. Enable it, and also measure the performance of PMF and Functor API
variants, for both QTimer::singleShot and QMetaObject::invokeMethod.

This uncovers that the zero-timeout optimization for the singleShot is
not applied to the PMF and Functor API variants:

********* Start testing of qtimer_vs_qmetaobject *********
Config: Using QtTest library 5.11.0, Qt 5.11.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 7.2.1 20171224)
PASS   : qtimer_vs_qmetaobject::initTestCase()
PASS   : qtimer_vs_qmetaobject::bench(singleShot_slot)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_slot":
     5.20 msecs per iteration (total: 520, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(singleShot_pmf)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_pmf":
     75.93 msecs per iteration (total: 7,594, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(singleShot_functor)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_functor":
     77.90 msecs per iteration (total: 7,790, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(singleShot_functor_noctx)
RESULT : qtimer_vs_qmetaobject::bench():"singleShot_functor_noctx":
     76.23 msecs per iteration (total: 7,624, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(invokeMethod_string)
RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_string":
     4.99 msecs per iteration (total: 499, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(invokeMethod_pmf)
RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_pmf":
     5.37 msecs per iteration (total: 538, iterations: 100)
PASS   : qtimer_vs_qmetaobject::bench(invokeMethod_functor)
RESULT : qtimer_vs_qmetaobject::bench():"invokeMethod_functor":
     4.74 msecs per iteration (total: 474, iterations: 100)
PASS   : qtimer_vs_qmetaobject::cleanupTestCase()
Totals: 9 passed, 0 failed, 0 skipped, 0 blacklisted, 50220ms
********* Finished testing of qtimer_vs_qmetaobject *********

Change-Id: I46336613188317124804638627f07eb135dc0286
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2019-03-27 06:37:33 +00:00
Marc Mutz
d2ed1074d0 tests: remove the last uses of Java-style iterators
... except where they are actually the component under test.

Java-style iterators are scheduled for deprecation.

Change-Id: If4399f7f74c5ffc0f7e65205e422edfa1d908ee8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-06-13 09:40:26 +02:00
Lars Knoll
5652d33f97 Bump version to Qt 6
Needed to disable QT_NO_UNSHARABLE_CONTAINERS, as this
triggers asserts.

QMetaType also has some Qt 6 specific code disabled to
get things to compile.

Fix various details in autotests to accommodate for
the changes with Qt 6.

Add a workaround for black lists on macos, where
QSysInfo::productType() now returns 'macos' and not
'osx' anymore.

Change-Id: Ie26afb12a2aac36521472715934a7e34639ea4d0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-05-14 12:14:08 +00:00
Christian Ehrlicher
4f6eb43898 QtCore: mark obsolete enumerations as deprecated
The following enumerations were obsolete for a log time but not marked
as deprecated:
 - WA_NoBackground
 - WA_MacNoClickThrough
 - WA_MacBrushedMetal
 - WA_MacMetalStyle
 - WA_MSWindowsUseDirect3D
 - WA_MacFrameworkScaled
 - AA_MSWindowsUseDirect3DByDefault
 - AA_X11InitThreads
 - ImMicroFocus

mark them as deprecated and remove the usage inside QtBase so they can
be removed with Qt6

Change-Id: Ia087a7e1d0ff1945286895be6425a6cceaa483fb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-05-17 14:08:30 +00:00
Qt Forward Merge Bot
67c70b22f6 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ifa143cc462301aaa305c9c85360e543553a751f0
2019-02-19 01:00:08 +01:00
Joerg Bornemann
8fe3680193 Add cmdline feature to qmake
[ChangeLog][qmake] A new feature "cmdline" was added that implies
"CONFIG += console" and "CONFIG -= app_bundle".

Task-number: QTBUG-27079
Change-Id: I6e52b07c9341c904bb1424fc717057432f9360e1
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2019-02-18 07:12:14 +00:00
Liang Qi
fbfacd33be Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/android/templates/AndroidManifest.xml
	src/network/ssl/qsslsocket_mac.cpp
	src/widgets/styles/qstylesheetstyle.cpp
	tests/auto/corelib/kernel/qtimer/BLACKLIST
	tests/auto/testlib/selftests/blacklisted/tst_blacklisted.cpp
	tests/auto/testlib/selftests/expected_blacklisted.lightxml
	tests/auto/testlib/selftests/expected_blacklisted.tap
	tests/auto/testlib/selftests/expected_blacklisted.teamcity
	tests/auto/testlib/selftests/expected_blacklisted.txt
	tests/auto/testlib/selftests/expected_blacklisted.xml
	tests/auto/testlib/selftests/expected_blacklisted.xunitxml
	tests/auto/testlib/selftests/expected_float.tap
	tests/auto/testlib/selftests/expected_float.teamcity
	tests/auto/testlib/selftests/expected_float.txt
	tests/auto/testlib/selftests/expected_float.xunitxml

Done-With: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: If93cc432a56ae3ac1b6533d0028e4dc497415a52
2019-02-08 12:31:02 +01:00
Edward Welbourne
150c6fb74b Add testlib selftests for double and for non-finite float and double
Tidied up the existing float tests in the process.
(In particular, s/SUCCESS/PASS/ since that matches real test output.)
These verify that QCOMPARE() handles floats and doubles as intended.
Extended the existing qFuzzyCompare tests to probe the boundaries of
the ranges of values of both types, in the process.

Revised the toString<double> that qCompare() uses to give enough
precision to actually show some of the differences being tested there
(12 digits, to match what qFuzzyCompare tests, so as to show different
values rather than, e.g. 1e12 for both expected and actual) and to
give consistent results for infinities and NaN (MinGW had eccentric
versions for these, leading to different output from tests, which thus
failed); did the latter also for toString<float> and fixed stray zeros
in MinGW's exponents (which made a kludge in tst_selftest.cpp
redundant, so I removed that, too).

That's further complicated handling of floating-point types, so let's
just keep an eye on how expensive that's getting by adding a benchmark
test for QTest::toString().  Unfortunately, default settings only get
runs that take modest numbers of milliseconds (some as low as 40)
while increasing this with -minumumvalue 100 or more gets the process
killed - and I'm unable to find out who's doing the killing (it's not
QProcess::kill, ::kill or the QtTest WatchDog, as far as I can tell).
So results are rather noisy; the integral tests exhibit speed-ups by
factors up to 5, and slow-downs by factors up to 100, between runs
with and without this change, which does not affec the integral tests.
The relatively modest slow-downs and speed-ups in the floating point
tests thus seem likely to be happenstance rather than signal.

Change-Id: I4a6bbbab6a43bf14a4089e96238a7c8da2c3127e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-02-06 10:11:22 +00:00
Christian Ehrlicher
7c69f6171d QFile/QFileInfo: mark readLink() as deprecated
QFile/QFileInfo::readLink() functions are obsolete but were not marked
as deprecated.
Explicit mark them as deprecated so they can be removed with Qt6.

Change-Id: I52424dc5441e1f5b01015713df990bbec5186caa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2019-01-23 18:49:15 +00:00
Allan Sandfeld Jensen
c961d1a6d2 Make convert_generic_to_rgb64 more generic
This makes it possible to get rid of specialized functions for
converting to RGBA64PM, while at the same time making the conversion
faster as the painter routines are better optimized.

Change-Id: I3e73856b2c1411977450e72af1741aab0ecf537e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-01-08 15:00:06 +00:00
Tobias Hunger
757d4b85a9 Benchmark: Add _bench_ into the name of the qmap benchmark
Change-Id: I6a1790981eb56d56bc190634e796bc3736ddd475
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-08 21:34:27 +00:00
Tobias Hunger
c99544a474 benchmarks: Fix copy and paste error in .pro-file
Change-Id: I30e4c640b9299559063b0337b6639d7c5a19e1db
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2018-11-08 21:34:08 +00:00
Simon Hausmann
e9c45bbddd Begin port of qtbase to CMake
Done-by: Alexandru Croitor <alexandru.croitor@qt.io>
Done-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Done-by: Kevin Funk <kevin.funk@kdab.com>
Done-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
Done-by: Simon Hausmann <simon.hausmann@qt.io>
Done-by: Tobias Hunger <tobias.hunger@qt.io>
Done-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Done-by: Volker Krause <volker.krause@kdab.com>
Change-Id: Ida4f8bd190f9a4849a1af7b5b7981337a5df5310
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io>
2018-11-01 11:48:46 +00:00
Friedemann Kleint
20a8a277ee tst_qfileinfo: Refactor ntfsJunctionPointsAndSymlinks()
Move the creation of the symbolic link/junction from the _data() slot
into the actual test function. The parameters are passed by a newly
introduced struct. This ensures only the symbolic links/junctions that
are actually needed are created. It can then no longer happen that
filtering for one data row invokes recursive deletion of the mountpoint
junction.

Also use of the newly introduced convenience createSymbolicLink()
in canonicalFilePath()

Task-number: QTBUG-63989
Change-Id: Ia78fd4ad6097136934ab5a375f4c352713d0f115
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-09-30 09:59:09 +00:00
Ivan Komissarov
09e926cc27 Use a std::vector instead of a QVector in QMimeDatabasePrivate
Using std::vector saves a bit c++ code when using range-for loop over
the vector.

Besides, no shared copies created anymore which is a bit faster.

Change-Id: I564306ed9ac907e9f32f59b33ed15c027a59b4eb
Reviewed-by: David Faure <david.faure@kdab.com>
2018-09-29 14:22:18 +00:00
Christian Ehrlicher
43ed09fed5 QListView: Speedup handling of hidden items
Instead iterating through all rows to get the number of hidden items,
iterate over the hidden items which are fewer items.
Also don't create a temporary vector with visible flow positions by
remembering the count of hidden items before the working index and
adjusting them appropriately which gives a significant performance
boost when working with a large data set.

[ChangeLog][QtWidgets][QListWidget] Speedup handling of hidden items
when working with large data sets

Task-number: QTBUG-68977
Change-Id: I599b6e97945c245f02229145baad8363ec2bf2f5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-09-17 14:01:31 +00:00
Allan Sandfeld Jensen
9c9f98f2ff Implement support for 16bpc image formats
Adds support for 16bit per color image formats in QImage. This makes it
possible to read and write 16bpc PNGs, and take full advantage of the
16bpc paint engine.

[ChangeLog][QtGui][QImage] QImage now supports 64bit image formats with
16 bits per color channel, compatible with 16bpc PNG or RGBA16 OpenGL
formats.

Task-number: QTBUG-45858
Change-Id: Icd28bd5868a6efcf65cb5bd56031d42941e04099
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2018-08-11 14:12:48 +00:00
Liang Qi
e3ed2281c0 Merge remote-tracking branch 'origin/5.11' into dev
Conflicts:
	src/plugins/platforms/cocoa/qnsview.mm
	src/plugins/platforms/cocoa/qnsview_dragging.mm
	src/plugins/platforms/ios/qiosinputcontext.mm
	src/plugins/platforms/xcb/qxcbconnection.cpp
	src/plugins/platforms/xcb/qxcbconnection_xi2.cpp
	src/plugins/platforms/xcb/qxcbwindow.cpp
	src/tools/androiddeployqt/main.cpp
		Was moved from qttools into qtbase in 5.11.
		So re-apply 32398e4d here.
	tests/auto/corelib/global/qlogging/test/test.pro
	tests/auto/corelib/global/qlogging/tst_qlogging.cpp
	tests/auto/corelib/io/qfile/tst_qfile.cpp
	tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp
	tests/auto/corelib/thread/qthreadstorage/test/test.pro
	tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
	tests/auto/widgets/kernel/qapplication/test/test.pro

Done-with: Gatis Paeglis <gatis.paeglis@qt.io>
Done-with: Mårten Nordheim <marten.nordheim@qt.io>
Done-with: Oliver Wolff <oliver.wolff@qt.io>
Change-Id: Id970486c5315a1718c540f00deb2633533e8fc7b
2018-07-02 11:23:45 +02:00
Edward Welbourne
d4a5ea2d4a tst_bench_QUuid: eliminate an unused variable
Fixes a warning while compiling.

Change-Id: I6d463d5ab6e95714fcf96a883577249593490380
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2018-06-14 09:15:06 +00:00
David Faure
46ec170d2b Speed up QTimeZone::isTimeZoneIdAvailable by a factor 43
Creating and sorting a list of bytearrays just to check if one entry is
present, is really overkill. By adding a new virtual method
isTimeZoneIdAvailable() in the backend classes, we can do this much more
efficiently.

Implemented for Utc and Tz backends, the others fall back to the
slow way.

The new benchmark shows, in release mode:
Before: 43 msecs per iteration (total: 86, iterations: 2)
After: 1.1 msecs per iteration (total: 73, iterations: 64)

Change-Id: Ic0d79a41d74e2ce6aa088fa7986c41d33902c36b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2018-04-23 06:48:12 +00:00
Lars Knoll
4f158ccee5 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I9f802cb9b4d9ccba77ca39428a5cb1afd2d01642
2018-04-12 22:00:35 +02:00
Allan Sandfeld Jensen
2cc9776652 Cut down on drawPixmap and drawImage combinations
There are too many combinations and the data is not very useful when
it is impossible to get an overview. This cuts a few rare formats out
and reduces the sizes tested to one small for overhead benchmarking
and one large for bandwidth benchmarking.

Change-Id: If0fe33e0e02b8cba771094a79072036f2cd4cf48
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-04-12 12:58:40 +00:00
Qt Forward Merge Bot
bfe5e510b9 Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I954bd6418bc862a04691240c0f1766f6ce033640
2018-04-05 10:02:09 +02:00
Allan Sandfeld Jensen
559964849a Add lancelot based benchmark
Uses the scripts and tests we already have for lancelot as a painting
benchmark.

Change-Id: Idf8a55e2261162e619f6dbb567dc19f8dc96da4e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-04-04 08:17:43 +00:00
Christian Ehrlicher
98f7eba6cf Benchmarks/QGraphicsView: re-enable graphicslayout/graphicslinearlayout
The two benchmarks graphicslayout and graphicslinearlayout were
disabled for some time. Fixed the compile errors and readded them so
there is at least no bitrotting.

Task-number: QTBUG-27461
Change-Id: Ib0c878e97693c0ad3bf87e658d493da61f5174ee
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-04-04 06:54:39 +00:00
Christian Ehrlicher
a91b91ae57 Benchmarks/QGraphicsItem: use testdata instead hard-coded values
tst_QGraphicsItem::setPos() was provided with test data
but it was not used.

Change-Id: I8ed2a1ef9940024e4a0e666276f0953706869ef7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-27 16:51:03 +00:00
Christian Ehrlicher
3c4ea1b3c6 Benchmark: move widgets benchmarks still in gui subdirectory to widgets
Move all widget-dependent benchmarks which were still in gui
subdirectory to widgets

Task-number: QTBUG-23129
Change-Id: I1359f1ea4036cacdfdbe08ff9ecdf1e2c75a005b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2018-03-27 16:50:44 +00:00
Christian Ehrlicher
89bf58b070 Benchmark/QImageReader: remove unused dependencies
QImagereader benchmark does neither depend on network nor widgets.
Therefore those two dependencies can be removed here.

Change-Id: Ic127b2668e22608774ce5878454f4a96ef591f6b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2018-03-23 17:42:52 +00:00
Kari Oikarinen
caa5a20479 Make a benchmark out of tst_QObjectPerformance::emitToManyReceivers
The test has been flaky on top of QEMU. The test is clearly a sort of manually
rolled benchmark, not a regular autotest. Remove the test and replace it with a
benchmark in QObjectBenchmark.

Task-number: QTBUG-66823
Task-number: QTBUG-66216
Change-Id: I7a48293023f32141eed6fea50fbb63af18933a8f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-07 19:43:52 +00:00