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>
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
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>
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>
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>
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>
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>
... 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>
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>
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>
[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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Avoid lots of warnings about not being able to set "modal".
Change-Id: I396718f14a55203f9989c03e20efc647c64795a9
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
When the table for a selected column can't be determined (e.g. because
there is no table for it), PQftable returns InvalidOid. This was not
covered and a query to determine the table name was executed every
time which slowed down calls to QSqlQuery::value(QString).
Task-number: QTBUG-65226
Change-Id: Idd8fbaaef7b01ca4151439f46cad2cce6f1c93e9
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
In order to save having to always run a query to get the tablename for
a known oid then we cache the result on the driver side. The oid stays
the same while the table exists, so only on dropping it would it change.
Recreating the table causes it to get a new oid, so there is no risk of
the old one being associated with the wrong table when this happens, if
the driver is still open at that point.
The benchmark added shows the improvement from the previous code, before
the results for PostgreSQL was:
RESULT : tst_QSqlRecord::benchmarkRecord():"0_QPSQL@localhost":
259 msecs per iteration (total: 259, iterations: 1)
whereas now it is:
RESULT : tst_QSqlRecord::benchmarkRecord():"0_QPSQL@localhost":
0.000014 msecs per iteration (total: 59, iterations: 4194304)
Task-number: QTBUG-65226
Change-Id: Ic290cff719102743da84e2044cd23e540f20c96c
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>