Commit Graph

10000 Commits

Author SHA1 Message Date
Qt Forward Merge Bot
1cfa636fe2 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ie24be82ee70bf103c2664de1a42741979262b10c
2019-09-16 01:00:07 +02:00
Christian Ehrlicher
6f8fc4217a tst_QTableView: cleanup
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>
2019-09-14 15:50:05 +02:00
Friedemann Kleint
147a8bc4c8 tst_QWindow: Remove usages of deprecated QWSI API
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>
2019-09-14 11:39:29 +02:00
Edward Welbourne
8286daba03 MS TZ data: avoid calculating a date in year 0
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>
2019-09-13 10:47:41 +02:00
Qt Forward Merge Bot
104f0535a1 Merge remote-tracking branch 'origin/5.13' into 5.14
Change-Id: Idcf8fc1d79bcd84b494d7f43308e6fe82d60e1a4
2019-09-13 01:00:15 +02:00
Laszlo Agocs
ef78a2e8f9 rhi: Add a flag to indicate preferring a software adapter
...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>
2019-09-12 14:28:23 +00:00
Laszlo Agocs
f567129bb5 rhi: d3d11: Add the device lost testing machinery
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>
2019-09-12 12:39:12 +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
Qt Forward Merge Bot
dc4ecf0641 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ie69d40d2efc5559b31e28ba71f88e3cda741e051
2019-09-11 01:00:09 +02:00
Christian Ehrlicher
f5f24731ec tst_QTableWidget: cleanup
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>
2019-09-10 13:36:30 +02:00
Sona Kurazyan
49362d064f Add a QSplashScreen constructor taking a QScreen
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>
2019-09-10 07:34:03 +00:00
Assam Boudjelthia
17032c4d64 Re-add tst_selftests "crashes old stdout txt" on QEMU
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>
2019-09-09 11:19:38 +00:00
Friedemann Kleint
1d53b6d9f2 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	tests/auto/gui/text/qtextlayout/tst_qtextlayout.cpp

Change-Id: Idd3ca5cb9a2b95a4c3513b2a4c8966e6f56193f1
2019-09-09 07:51:49 +00:00
Qt Forward Merge Bot
2eead078c8 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: If8e9d88771243fd9e221b49f53d7d8b111a8ce2a
2019-09-09 09:21:48 +02:00
Allan Sandfeld Jensen
89d0a03c06 Remove BT.2020 support from QColorSpace
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>
2019-09-08 16:19:14 +02:00
Qt Forward Merge Bot
1f35c8caa0 Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: I371c5ae1af6f58e32e579671f485b92b586e0b76
2019-09-08 11:33:28 +02:00
Qt Forward Merge Bot
a9db729095 Merge remote-tracking branch 'origin/5.12.5' into 5.12
Change-Id: I41a252fdbf22551aadb0b1a6e9ecf3f95f99fbd4
2019-09-07 13:08:26 +02:00
Sona Kurazyan
14ade9c476 Fix the build of the qgraphicslayout manual test
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>
2019-09-06 09:57:57 +02:00
Christian Ehrlicher
a42a451339 QShortcut: call base class implementation in event()
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>
2019-09-05 20:41:43 +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
Christian Ehrlicher
42011c0361 QGraphicsView: mark obsolete flag DontClipPainter as deprecated
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>
2019-09-05 17:40:29 +02:00
Friedemann Kleint
d2894d968d tst_QPdfWriter: Fix deprecation warnings
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>
2019-09-05 16:08:47 +02:00
Qt Forward Merge Bot
fa2589bbb5 Merge remote-tracking branch 'origin/5.13.1' into 5.13
Change-Id: Ic633850940bbe17dcedc1609217a052b6f81ce4b
2019-09-05 13:33:00 +02:00
Qt Forward Merge Bot
f3a1048b61 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I065e212f0dc115efa1ffcb14cf9f679259da6b79
2019-09-05 08:58:25 +02:00
Sona Kurazyan
43983b0b6f Remove QOperatingSystemVersion::WindowsVista
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>
2019-09-05 08:25:05 +02:00
Friedemann Kleint
e82a1d6b29 Deprecate QDirModel
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>
2019-09-04 21:27:33 +02:00
Edward Welbourne
46ec24d2b9 Rename calendar methods from m{in,ax} to m{in,ax}imum
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>
2019-09-04 18:43:35 +02:00
Tor Arne Vestbø
c3e0e7a3eb Limit QColorSpacePrimaries export to auto-test
Change-Id: I997a5a7afa72f2fd527921ed81d6ccf5f339962b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-09-04 16:35:33 +02:00
Timur Pocheptsov
b9b48464df tst_http2::goaway - run in ALPN mode only
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>
2019-09-04 15:35:50 +02:00
Daniel Smith
651dd26403 Update lancelot tests to use non-system-specific host info collection
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>
2019-09-04 13:09:39 +00:00
Liang Qi
6a36fe904c Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/corelib/codecs/qicucodec.cpp
	src/dbus/qdbusserver.cpp
	src/gui/painting/qbezier.cpp
	src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmscreen.cpp
	src/plugins/printsupport/cups/qppdprintdevice.cpp

Change-Id: I2703128bb64baf5580fbc2c2061b55b0f0611d2a
2019-09-04 07:03:54 +02:00
Tor Arne Vestbø
cc1ea2bf47 Simplify QColorSpace named presets
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>
2019-09-03 15:10:11 +00:00
Friedemann Kleint
efbba1e54a Brush up tst_QStyle
- 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>
2019-09-03 15:00:13 +02:00
Friedemann Kleint
194d4946c7 tst_QStyleSheetStyle: Pass on High DPI screens
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>
2019-09-03 06:27:55 +00:00
Friedemann Kleint
0a1f48a082 Brush up tst_QStyleSheetStyle
- Fix includes
- Fix a widget leak (incorrectly parented QComboBox)
  and add a check in cleanup()
- Add window titles
- Introduce nullptr
- Replace C-style casts
- Use range-based for
- Streamline some code
- Fix static invocation
- Fix class structure, add override
- Use initializer lists

Task-number: QTBUG-76493
Change-Id: I035ec782fa1241a5a1d775e86b0591d9bd134359
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-09-03 06:27:44 +00:00
Sona Kurazyan
38d5ad2ee5 Fix the build with disabled QGraphicsItem::ItemMatrixChange
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>
2019-09-02 20:56:03 +02:00
Allan Sandfeld Jensen
c8d3eb35e7 Fixup move semantics of QColorSpace
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>
2019-09-02 18:37:07 +02:00
Eirik Aavitsland
6bb51e0f08 QPainter lancelot test: improve drawImage testing
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>
2019-09-02 12:08:40 +02:00
Rainer Keller
af6ac444c9 Fix crash when text contains too many directional chars
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>
2019-08-31 08:29:31 +00:00
Rainer Keller
1232205e32 Fix crash when text contains too many directional chars
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>
2019-08-30 21:17:32 +02:00
Volker Hilsheimer
ca3be92234 Remove QFileInfo::type and related enum from 5.14
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>
2019-08-30 13:20:07 +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
Edward Welbourne
2faa6cafa9 Pass QDate, QTime as value classes, rather than by const reference
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>
2019-08-30 10:54:27 +02:00
Alex Trotsenko
81408c0e76 QEventDispatcherWin32: avoid livelock in a foreign event loop
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>
2019-08-29 09:12:29 +00:00
Laszlo Agocs
2602209f54 rhi: vulkan: Introduce secondary command buffer usage
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>
2019-08-29 10:23:15 +02:00