Cleanup QTableView autotest:
- use range-based for loops where possible
- use nullptr
- use member initialization
- use new signal/slot syntax
- remove a lot of c-style casts
- use static invocations
- use override
- instantiate objects on stack instead heap to avoid memleaks
Change-Id: I52fee26697b1732afa9f965e600d4c59551370ce
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Use the standard testlib helpers for generating clicks and port the
remaining occurrences to the new versions of
QWindowSystemInterface::handleMouseEvent(). Similarly, fix
QWindowSystemInterface::handleTabletEvent().
Task-number: QTBUG-76491
Change-Id: I6a30957164891b56a018696606956c3cab56047f
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
There is no year 0 in the proleptic Gregorian calendar, so QDate()
won't be happy if asked for a date in it. Tweak scanning of the data
we get from MS-Win so as to avoid a date calculation that could
otherwise happen in year 0 when constructing
QDateTime(QDate(1, 1, 1), QTime(0, 0, 0), QTimeZone("Australia/Sydney")).
Added a test for this case, which Oliver Wolff has kindly verified
does reproduce the assertion failure. However, Coin is unable to
reproduce, as all its MS builds are configured with -release, so
Q_ASSERT() does nothing. (The relevant code then skips over year 0,
albeit for the wrong reasons, and gets the right results, albeit
inefficiently, leaving no other symptom by which to detect the
problem.)
Fixes: QTBUG-78051
Change-Id: Ife8a7470e5bd450bc421e89b3f1e1211756fc889
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
...if there is one and the concept is applicable in the first place.
Change-Id: Iab202c1c1cdd229f4910159de4cae7ce30805ea9
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
The device can be lost when physically removing the graphics adapter,
disabling the driver (Device Manager), upgrading/uninstalling the
graphics driver, and when it is reset due to an error.
Some of these can (and should) be tested manually, but the last
one has a convenient, programmatic way of triggering: by triggering
the timeout detection and recovery (TDR) of WDDM. A compute shader
with an infinite loop should trigger this after 2 seconds by default.
All tests in tests/manual/rhi can now be started with a --curse <count>
argument where <count> specifies the number of frames to render before
breaking the device. Qt Quick will get an environment variable with
similar semantics in a separate patch.
Change-Id: I4b6f8d977a15b5b89d686b3973965df6435810ae
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
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>
Cleanup QTableWidget autotest:
- use range-based for loops where possible
- use nullptr
- use member initialization
- use new signal/slot syntax
- remove a lot of C-style casts
- use static invocations
- use override
- instantiate objects on stack instead of heap to avoid memleaks
Change-Id: I99ed144caab88d648d5ab987ce0963fbc6f1197d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The constructor taking a QWidget is needed for specifying the screen
where the splash screen should be displayed.
Add a new constructor for specifying the target screen for the splash screen
directly, instead of "extracting" the screen information from a widget.
This removes the need for using the deprecated QDesktopWidget.
Deprecate the constructor taking a QWidget.
Task-number: QTBUG-76491
Change-Id: I1dde242ff5f7b53e52af308bb685f492d6266d33
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The test is not failing anymore on QEMU targets.
This partially reverts commit
71bd06d516.
Fixes: QTBUG-71915
Change-Id: I68593edf0ec245e14879833c8aa90661a3c2e227
Reviewed-by: Liang Qi <liang.qi@qt.io>
BT.2020 is an HDR color space and its luminance range doesn't match
that of the rest of the currently available color spaces. Without
support for white-point luminance in 5.14, there would be a behavior
change when luminance support is later introduced, so it is better to
remove it now, and reintroduce it when the necessary handling of
different luminance levels is available.
Change-Id: Ie29e4dd757faae3ac91d4252e1206acce42801dc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This was accidentally introduced by
2f33e030b8 and since manual tests are not
built by default, was not discovered earlier.
Change-Id: I5cb6d5cfe0911bdb01a33014f2648a47b7a48848
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QShortcut::event() did not call the base class implementation
QObject::event() which caused that e.g. QEvent::DeferredDelete was not
handled.
Fix it by calling QObject::event() when the event was not handled.
Fixes: QTBUG-66809
Change-Id: Ideebc980bc658f8f2b9ec4417e738bccda5eeab5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
And let the meat of the function be shared with the rbSwap routine.
Change-Id: I0ea18b30c26ff050c17dcb3ad4d654bfbb8c6221
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The enum OptimizationFlag::DontClipPainter is deprecated and not used in
the code since Qt4 times. Therefore also mark it as deprecated so it can
be removed with Qt6
Change-Id: I318a55cf42e7a233d13d4ec0144e1977251f5c92
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Fix warnings:
tst_qpdfwriter.cpp:223:58: warning: virtual void QPdfWriter::setPageSize(QPagedPaintDevice::PageSize)’ is deprecated: Use setPageSize(QPageSize(id)) instead [-Wdeprecated-declarations]
by using the QPageSize-based API. Streamline the code by using
QPageSizeId.
Task-number: QTBUG-76491
Change-Id: I409f0e27de64bc66502a60a9109c6115f36e527d
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The minimum supported version is Windows 7. Remove
QOperatingSystemVersion::WindowsVista added by
b0cd007335 and replace with "true"
wherever it was used.
Change-Id: I08c0208467b655a921b6773f77d8bc099be69031
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Deprecate the constructors, add guards.
Use a QStandardItemModel in tst_QCompleter::setters() instead.
Task-number: QTBUG-69410
Change-Id: If77298982bb3d0b5321ae1271fab3f33b196101d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Words should not be abbreviated.
Split a long line and reflowed some comments in the process.
Fixes: QTBUG-78008
Change-Id: I52d75409f02e2cecbed3e94d424617ad594c275b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
I was observing rare crashes on my mac, where I was using SecureTransport.
This would imply both the client (the test) and the server were working
in h2c mode. But this is against the test's logic - the first request
will be HTTP/1.1 (and upgrading protocol) and I wanted to send 3 HTTP/2
requests instead.
Fixes: QTBUG-77476
Change-Id: I048ca242e2096ca36dd112277807d1fee530150c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Change the lancelot baseline test runner to use generic text files for
host info data collection. This also avoids relying on QProcess and
scraping the bash scripts output from stdout.
Fixes: QTBUG-71836
Change-Id: I88a46c99dbb11f71afc18cae5a6d2fbebcbe76c5
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
We don't need a getter for the 'preset' of a color-space, as color
spaces can be compared to the presets directly. This allows us to
remove the Undefined and Unknown values from the presets.
Internally we still distinguish known presets from unknown or undefined
presets via the magic 0-value. The validity of a QColorSpace is not
based on this preset, but on its actual values.
Fixes: QTBUG-77963
Change-Id: I1e0a2a4be83021b8c82b3c778019f680fd46455b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
- Remove member m_testWidget; instantiate test widget on the
stack where needed
- Introduce nullptr
- Use range-based for
- Streamline some code
- Fix static invocation
- Fix class structure, add override
- Use initializer lists
- Fix some style issues
Task-number: QTBUG-76493
Change-Id: If339d51a16bb77565cf10404ad1266c8f63a68b4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The test requires High DPI scaling to be disabled since it
manipulates the factors itself in a test.
Turn it off initially and introduce a member variable
containing a suitable size depending on the screen to make the
test pass on High DPI screens without violating minimum window
widths on Windows.
Task-number: QTBUG-76493
Change-Id: I7b908940413d6a35a4bee781b4df07a31069bb17
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
QGraphicsItem::ItemMatrixChange has been deprecated since 5.14. Fixed
the usage in tests to compile condinionally, only when it is available.
Change-Id: I63e892a01a50fb9ac51bf38eb761cb26375bc194
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Stop using QExplicitlySharedDataPointer, makes it possible to inline
the move constructor and assign operator.
Also protect other methods from nullptr d_ptr, and change the default
constructed value to also have a null d_ptr, to match the result after
a move.
Change-Id: I40928feef90cc956ef84d0516a77b0ee0f8986c7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
In QPainter, there is a shortcut code path for the drawImage(point,
image) call, relative to the full drawImage(targetRect, img,
srcRect). The lance script interpreter would only use the latter, so
the former was not covered by the tests.
As a driveby, remove the pointless usage of non-default dithering
flags in drawImage(), since it is more important to test the default.
Change-Id: Id373fd528a0c4c40b6bd8eea37b960fd7cdb2cc7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
In case a text to be layouted contains more than 128 directional characters
it causes the application to crash
The function initScriptAnalysisAndIsolatePairs() collects information of
RTL/LTR chaaracters into vector "isolatePairs". The size of the vector is
capped to 128. Later the function generateDirectionalRuns() iterates
the text again and tries to access items from the previously capped vector
above the upper bound.
Task-number: QTBUG-77819
Change-Id: Ibb7bf12c12b1db22f43ff46236518da3fdeed26a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
(cherry picked from commit 1232205e32)
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
In case a text to be layouted contains more than 128 directional characters
it causes the application to crash
The function initScriptAnalysisAndIsolatePairs() collects information of
RTL/LTR chaaracters into vector "isolatePairs". The size of the vector is
capped to 128. Later the function generateDirectionalRuns() iterates
the text again and tries to access items from the previously capped vector
above the upper bound.
Task-number: QTBUG-77819
Change-Id: Ibb7bf12c12b1db22f43ff46236518da3fdeed26a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The API is problematic for several reasons:
- the mixing of flags and enum in a single enum type
- the name "type" as somewhat overloaded
- the ease of misuse when comparing the result rather than testing
for a bit being set
In light of this, focus for 5.14 on the new isShortcut and
isSymbolicLink functions, thus migitating the problematic
isSymLink which conflates the two concepts.
Change-Id: I57e02321edd5061f69a775f04a0932ef89adf866
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
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>
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>
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>
This can, of course, only be done in private APIs - but comment on
public APIs to do the same at Qt 6.
Change-Id: I3c79951572be3c37b0b0c5b1b05bced051a40964
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
According to Windows docs, GetMessage() function retrieves the messages
from the input queue in defined order, where posted messages are
processed ahead of input messages, even if they were posted later.
Therefore, if the application produces a posted event permanently, as
a result of processing that event, user input messages may be blocked
due to hard CPU usage by the application.
It's not a problem, if an internal Qt event loop is running. By calling
sendPostedEvents() on the beginning of processEvents(), we are sending
posted events only once per iteration. However, during execution of
the foreign loop, we should artificially lower the priority of the
WM_QT_SENDPOSTEDEVENTS message in order to enable delivery of other
input messages.
To solve the problem, it is proposed to postpone the
WM_QT_SENDPOSTEDEVENTS message until the message queue becomes empty,
as it works for the internal loop.
Task-number: QTBUG-77464
Change-Id: I8dedb6837c6fc41aa6f497e67ab2352c2b4f3772
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
As an option. Must opt in via setting ExternalContentsInPass in
the flags for beginFrame(). It is somewhat unfortunate to require
declaring this up front, but forcing using secondary command buffers
always, even though beginExternal() may not be used in many applications,
would be an overkill.
Change-Id: I8d52bcab40c96f89f140c4c7877b6c459925e3c7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>