Commit Graph

10560 Commits

Author SHA1 Message Date
Qt Forward Merge Bot
1315133233 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ic4ffd206bdd3ed68fd3d21a93818923e8d3a1e7a
2019-11-20 01:00:51 +01:00
Kari Oikarinen
315c2c468e tst_QScopeGuard: Remove unused lambda capture
qt5/qtbase/tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp💯38:
      warning: lambda capture 'caught' is not used [-Wunused-lambda-capture]
        auto cleanup = qScopeGuard([&caught] { s_globalState++; });
                                    ~^~~~~~

Change-Id: I0d9b85896594f3ea35c8003846d4ac7ab5e33d16
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-11-19 18:33:43 +02:00
Christian Ehrlicher
d7cb21ac08 QDom: use QLocale::C when converting a double to a xml attribute
QDomElement::setAttribute(QString, double) did not use QString::setNum()
but qsnprintf(). This is wrong because qsnprintf() is using the current
locale instead QLocale::C. It was also inconsistent to
QDomElement::setAttributeNS() which was already using QString::setNum().

Also fix the documentation which stated that all
QDomElement::setAttribute() format the values according the current
locale.

Fixes: QTBUG-80068
Change-Id: Iabb0b39c0d0723060527542c283a5435f26f31ca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-11-19 17:33:33 +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
Qt Forward Merge Bot
587f1cbc5d Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I4e5c8a1fcef443c3383e207102f21d41000ff322
2019-11-19 01:00:12 +01:00
Edward Welbourne
4218c3044d Revert "[macOS] Skip test that triggers a buffer overflow in CoreFoundation"
Allegedly Apple has fixed the bug that made this necessary, so we
should be able to include these two test-cases once more.

This reverts commit ba9585bd02.

Fixes: QTBUG-69875
Change-Id: I5ac6019c0d647691eda6cdbb2a53e7471859d4a3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2019-11-18 10:15:39 +01:00
Christian Ehrlicher
360df2cf74 QComboBox: add property placeholderText
QComboBox had no option to tell the user that he must select an item -
there was no placeholder text like e.g. in QLineEdit. This feature is
widely used in html forms so we should support it also.
Therefore add a new property 'placeholderText' to specify a text which
should be shown when the current selected index is invalid.

[ChangeLog][QtWidgets][QComboBox] QComboBox got a new property
'placeholderText'

Change-Id: If6dac45c9f43455474e267907b0b0d893301c611
Fixes: QTBUG-1556
Fixes: QTBUG-2776
Fixes: QTBUG-77141
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-11-15 20:45:24 +01:00
Qt Forward Merge Bot
5abb976f23 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2019-11-15 16:30:51 +01:00
Qt Forward Merge Bot
adc7bbe910 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/gui/rhi/qshader.cpp
	tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp

Change-Id: I1c4ae718eb3592a0a0a90af9d11553f3ab68cad5
2019-11-15 16:29:40 +01:00
Daniel Teske
9f48f1ebc2 QLineEdit: Fix End key for input masks
Consider this simple example:
   QLineEdit edit;
   edit.setInputMask( "9-9-9-9-9-9" );
   edit.show();

Without any input, m_text will contain: " - - - - - ". text() removes
the input mask's mask characters from that and returns "      ". A string
with 6 spaces. Thus currently the End key jumps to position 6, which is
in the middle of the string. Using m_text the End key jumps to the actual
end.

[ChangeLog][QtWidgets][QLineEdit] Fixed End key in combination with
certain input masks.

Task-number: QTBUG-16187
Task-number: QTBUG-20414
Change-Id: Ibb30a1dfa2f78103611b5afc9971dc43e8bdcc4a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-11-15 13:40:05 +02:00
Christian Ehrlicher
a4751f8824 QShortcut: add pmf ctor overloads
Provide pointer to member function overloads for the QShortcut ctor. The
ctor with two functors but no contexts is not provided since it creates
ambiguousness.

[ChangeLog][QtWidgets][QShortcut] QShortcut ctor has now pmf overloads

Fixes: QTBUG-77816
Change-Id: Ic9a759cde5150dbb94c2fd351b88ee8e447e0852
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-11-14 19:59:23 +01:00
Christian Ehrlicher
c15a069830 QTreeView: make sure to not ask the old model during setModel
Within QTreeView::setModel() the header might emit columnCountChanged
which then tries to update the geometries based on the old model which
is wrong.
Fix it by setting geometryRecursionBlock to true so
QTreeView::updateGeometries() will not ask the old model for it's data.

Fixes: QTBUG-75982
Change-Id: Ia0dd36cd7c6c5347fbc285deac43da6941accbe7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-11-14 20:47:45 +02:00
Robert Loehning
6e42ed217c configure: Add sanitizer "fuzzer-no-link"
Adds instrumentation for fuzzing to the binaries but links to the usual
main function instead of a fuzzer's. The similar sanitizer "fuzzer"
should then be used only for building the test itself.

Requires clang 6 or higher.

Change-Id: I24ee1f018b0b97f2977dc86fbdc29a164d7c4e01
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-11-14 15:45:02 +01:00
Edward Welbourne
ad11cab484 Allow longer time-zone components on Android
Android uses its own time-zone naming, which includes a zone called
"Canada/East-Saskatchewan", whose second component is 17 characters
long. This violates a rule in the IANA naming scheme for zones, that
limits components to 14 characters each. So tweak the isValidId()
check to allow Android its long names.

Android has added Outer Mongolian time-zones, which are as borked as
many others in 1970, so blacklist those transitionEachZone() tests.

Fixes: QTBUG-69128
Change-Id: I46f674f095431335b16900860d83b624257ae3bb
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-11-14 10:47:57 +01:00
Leander Beernaert
47428dfa55 Convert all of tests/manual
Fixes: QTBUG-78164
Change-Id: I28b59bf84533fc33fafafd1511b5337d36af0e2b
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-14 09:03:26 +00: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
Leander Beernaert
bac999f38c Fix two manual tests qmake project files
Fixes incorrect target name for styles test.

Explicit reference of widgets and opengl libraries in dialog.pri. While
not necessary for qmake it makes our lives easier when running the
CMake conversion script.

Change-Id: I036cae9d801c80c5817421b8427fc5c91e2f7883
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-13 15:00:58 +01:00
Leander Beernaert
15b78b3b54 Update version checks in tests/manual
Remove unnecessary version in tests/manual since they are always true in
the CMake port where it's impossible to have a QtVersion less than 6.0.

Change-Id: I26a13117a8c2e032a9cc70ca0f040122cbf79886
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-13 15:00:51 +01: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
Alexandru Croitor
71c43b035b Regenerate tests/auto/testlib
Change-Id: If1b2e105836b73b1a68ed5a8e11feb8e114d66e2
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 13:36:00 +00:00
Robert Loehning
6961d46b6e Fuzzing: Add comment how to recude noise in iccparser's fuzzer
With logging enabled, all the output will slow down
execution and fill up your hard disc in about a day.

Task-number: QTBUG-79050
Change-Id: I5dcac2f349f7dbe471a5e6dd7006b89d312aeeaf
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-11-13 12:37:44 +02:00
Alexandru Croitor
0d43af1281 Regenerate tests/auto/sql
Change-Id: If411b1e7c3a7cb58922e5a48309f42ba29f2c068
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:12:32 +00:00
Alexandru Croitor
47ce9e5a78 Regenerate tests/auto/printsupport
Change-Id: I517adae77f7a5851b07fa660732318c175570fb9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:12:23 +00:00
Alexandru Croitor
6d29435568 Regenerate tests/auto/other
Change-Id: Ib1753d1869f5af1900fbeaf2e95d3160cf979ca8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:12:04 +00:00
Alexandru Croitor
36abcc7cbe Regenerate tests/auto/opengl
Change-Id: I9bd417ae02db1b6827e09baab301152f3614da80
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:11:48 +00:00
Alexandru Croitor
8305b6fe3f Regenerate tests/auto/dbus
Change-Id: I105eb73065e02a4fa508d17f481047b32875f128
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:11:39 +00:00
Alexandru Croitor
0650bafa59 Regenerate tests/auto/concurrent
Change-Id: I6a291f7dd70f78c5cafb6d96a1c0d57ed7223c8b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:07:59 +00:00
Alexandru Croitor
0d62567f0b Regenerate tests/auto/network/ssl
Change-Id: Ib05f4e3c8dea934ce48776fdd50305f7c98c1adb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:07:48 +00:00
Alexandru Croitor
164d8c35b3 Regenerate tests/auto/network/socket
Change-Id: I653f7f4a6e3421f56f873cfbec4309eca49f1756
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:07:36 +00:00
Alexandru Croitor
ee5db96ef7 Regenerate tests/auto/network/bearer
Change-Id: I57526fa99376708203fb1723f3b85243925a1273
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:07:24 +00:00
Alexandru Croitor
5acc32361e Regenerate tests/auto/network/access
Change-Id: I18839ef583336fa2fa42cb4325fdb007675df213
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:07:12 +00:00
Alexandru Croitor
dec6b7cb9e Regenerate tests/auto/network/kernel
Change-Id: I770fce0f0a369204178ea0dfa7bbd8b210dd3585
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:07:02 +00:00
Alexandru Croitor
3909923958 Regenerate tests/auto/widgets/util
Change-Id: Icda122f04c8857f237e822d3981befb78885309b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:06:52 +00:00
Alexandru Croitor
af72e13636 Regenerate tests/auto/widgets/graphicsview
Change-Id: I2e6a8f2f92e9cb8d6bb0be53068dfd43ba87db4c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:06:43 +00:00
Alexandru Croitor
3f5adb4653 Regenerate tests/auto/widgets/itemviews
Change-Id: Ia95c89cde7faf5d3edb69cc8969bda2becd7b51d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:06:34 +00:00
Alexandru Croitor
5c549fba30 Regenerate tests/auto/widgets/styles
Change-Id: I8c9a63d0ac33465db832f01e1dd84abbea66fb30
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:06:25 +00:00
Alexandru Croitor
a678d9fb62 Regenerate tests/auto/widgets/kernel
Change-Id: Ib611ea32623e44c58432a15c73626aab36ab2b98
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:06:16 +00:00
Alexandru Croitor
02278007cb Regenerate tests/auto/widgets/effects
Change-Id: Ib31f764202635198b5cdf236ba19982bb3b18cbb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:06:06 +00:00
Alexandru Croitor
8801d499d0 Regenerate tests/auto/widgets/dialogs
Change-Id: Ief296935d274bfaa217442890927593f0875271a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:05:56 +00:00
Alexandru Croitor
52d9b2234c Regenerate tests/auto/widgets/widgets
Change-Id: I9d9360612931b29b5d13a224236ef650dc5c8e1d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:05:47 +00:00
Alexandru Croitor
bfbf3e0b3a Regenerate rest of tests/auto/gui
Change-Id: Iaaea50790161715517f7a4085116d5c893fa286b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:05:37 +00:00
Alexandru Croitor
3377978122 Regenerate tests/auto/gui/math3d
Change-Id: I7579ed464ec9211b1da7478c02e4e13a2a71277a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:05:27 +00:00
Alexandru Croitor
4936b6c795 Regenerate tests/auto/gui/kernel
Change-Id: I32046f33612f9b306dd889a0d42aa70d32375531
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:05:15 +00:00
Alexandru Croitor
43d7927004 Regenerate tests/auto/gui/painting
Change-Id: Id30f9e7e6cadb4a09c669c5688c01a84300a8c41
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:05:06 +00:00
Alexandru Croitor
cd258ca28a Regenerate tests/auto/gui/image
Change-Id: If6aa42d5b19227e488fc2fcf94b8eacc02c2c209
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-13 10:04:49 +00:00
Edward Welbourne
17b8a49fde Move some tests of QTimeZonePrivate::isValidId() to where they belong
They were tucked away in the back-end of the isTimeZoneIdAvailable()
test, but a separate isValidId() test had been added more recently,
which made some (arguably all) of them redundant. Reworked this test
in the process, so that the QSKIP() happens in _data() once instead of
in the test that's never run because there are no data rows.

Change-Id: Icaa6227ace9a1aa944d085691cdcfb3adf4a51dc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-11-13 10:52:00 +01:00
Alexandru Croitor
b0a223cf08 Regenerate tests/auto/corelib/statemachine
Change-Id: I9b9dcb0ede68116033bcde69cc1b5fafb67a22d1
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-12 17:27:21 +00:00
Alexandru Croitor
2718f5928e Regenerate tests/auto/corelib/serialization
Change-Id: Id2e221e4018b46467203c8d6f29a9758c3c57a60
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-11-12 17:26:59 +00:00
Alexandru Croitor
5c1bb8e4d4 Regenerate tests/auto/corelib/codecs
Change-Id: Iea71e497e8bcf131ed89c9e576381dc305b1dd44
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-11-12 17:26:41 +00:00
Alexandru Croitor
8076afb3c6 Regenerate tests/auto/corelib/tools
Change-Id: I1ea8fbf509c7e6d556ebd974fcff9084bc668e17
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-11-12 17:26:27 +00:00
Alexandru Croitor
5447ccd469 Regenerate tests/auto/corelib/mimetypes
Change-Id: Id137b8e9f48edd65c4df901f11a8ae917395d6b6
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-11-12 17:26:15 +00:00
Alexandru Croitor
7adcdcbf80 Regenerate tests/auto/corelib/text
Change-Id: I34e24b7c2697bcdddc628855e2b539b8db1b98b0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-11-12 17:26:05 +00:00
Alexandru Croitor
f7d7021460 Regenerate tests/auto/tools
Change-Id: I25268499ff966ebf134150accbaec7634726fe40
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-11-12 17:25:41 +00:00
Alexandru Croitor
209c7238a7 Regenerate tests/auto/corelib/thread
Change-Id: Ib70f000480ffbbb994edd80d9e2c7f5d9e270e0c
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-11-12 17:25:29 +00:00
Alexandru Croitor
d802572f0b Regenerate tests/auto/corelib/animation
Change-Id: I698e8bf965cc928bf7f48f44c81bd0dc017f483c
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-11-12 17:25:18 +00:00
Alexandru Croitor
d58d7ebfea Regenerate tests/auto/corelib/kernel
Change-Id: I466387408d26854e11fde0a1fbef74c2fad764c7
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-11-12 17:25:04 +00:00
Alexandru Croitor
812d45ed09 Regenerate tests/auto/corelib/global
Change-Id: I89a82f0cafeda2f38217a24f1c495344910fba1a
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-11-12 17:24:56 +00:00
Alexandru Croitor
76590ce220 Regenerate tests/auto/corelib/io
Change-Id: Ic1d1b5c0deb90800c7219fb8cce4e77e0db145b8
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-11-12 17:24:44 +00:00
Leander Beernaert
2285dd6f10 Rename some more manual test to be unique
This patch renames some of the manual test by prefixing them with
tst_manual_ to make sure they are unique in the project structure. This
is a requirement for the CMake port.

Change-Id: I83e2152826e0f95c3378374ab1c9992412022109
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
(cherry picked from commit 63a1a30a01)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-12 10:35:39 +00:00
Leander Beernaert
70a218b90b Fix compile errors related to missing Qt:: namespace
Change-Id: I092a26ef38b08c52d84adb027a1b1bdee8cc7f6b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
(cherry picked from commit ce187c4f0e)
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-12 10:35:26 +00:00
Leander Beernaert
190021b9c7 Rename some manual test to be unique
This patch renames some of the manual test by prefixing them with
tst_manual_ to make sure they are unique in the project structure. This
is a requirement for the CMake port.

Change-Id: Ie393b125ce5a35b7069cf006db0f3af8c4fda5b4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 937e014e63)
2019-11-12 10:28:40 +00:00
Leander Beernaert
2199a50a2a Build test/manual if it contains a CMakeLists.txt
Change-Id: Ibada60b0902f9c6a6a7284489a56106e0021a9de
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-12 10:06:46 +00:00
Leander Beernaert
63a1a30a01 Rename some more manual test to be unique
This patch renames some of the manual test by prefixing them with
tst_manual_ to make sure they are unique in the project structure. This
is a requirement for the CMake port.

Change-Id: I83e2152826e0f95c3378374ab1c9992412022109
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-11 14:08:57 +01:00
Leander Beernaert
ce187c4f0e Fix compile errors related to missing Qt:: namespace
Change-Id: I092a26ef38b08c52d84adb027a1b1bdee8cc7f6b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-11 14:08:52 +01:00
Leander Beernaert
937e014e63 Rename some manual test to be unique
This patch renames some of the manual test by prefixing them with
tst_manual_ to make sure they are unique in the project structure. This
is a requirement for the CMake port.

Change-Id: Ie393b125ce5a35b7069cf006db0f3af8c4fda5b4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-11 10:01:13 +01:00
Ryan Chu
004e3e0dc2 Make Qt aware of NTFS Junctions on Windows
On NTFS, a junction point can be created and deleted by the mklink and
rmdir commands, respectively. If a directory is not identified
correctly as a junction, then applications will likely try to remove
it using recursive methods, leading to fatal data loss.

With this change, Qt can identify file system entries as junctions,
allowing applications to use the correct file system operation to
remove it.

The test needs to delay the cleaning up of junctions and files it
creates until the checks are complete; since they might fail and make
the test function return prematurely, use a scope guard.

[ChangeLog][QtCore][QFileInfo] Add QFileInfo::isJunction so that
applications can recognize NTFS file system entries as junctions

Task-number: QTBUG-75869
Change-Id: I3c208245afbd9fb7555515fb776ff63b133ca858
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-11-09 00:47:45 +01:00
Alexandru Croitor
de3a806def Make standalone tests build via top level repo project
Previously repo/tests/CMakeLists.txt was a standalone project on which
CMake could be called. This was useful for Coin to be able to build
and package only tests, but was a bit troublesome because that means
having to specify the usual boilerplate like minimum CMake version,
which packages to find in every tests.pro project.

Instead of having a separate standalone project, modify the top level
project and associated CMake code to allow passing a special
QT_BUILD_STANDALONE_TESTS variable, which causes the top level project
to build only tests, and find Qt in the previously installed qt
location.

This also means that when building a repo, we generate a
${repo_name}TestsConfig.cmake file which does find_package on all the
modules that have been built as part of that repo. So that when
standalone tests bare built for that repo, the modules are
automatically found.

qt_set_up_standalone_tests_build() is modified to be a no-op because
it is not needed anymore. Its usage should be removed from all the
other repos, and then removed from qtbase.

Non-adjusted tests/CMakeLists.txt projects in other repositories
should still be buildable with the current code, until they are updated
to the new format.

Adjust the Coin build instructions to build the standalone tests in a
separate directory.

Adjust pro2cmake to generate new structure for the tests/tests.pro
projects.

Adjust the qtbase tests project.

Fixes: QTBUG-79239
Change-Id: Ib4b66bc772d8876cdcbae1e90ce5a5a5234fa675
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-08 15:42:32 +00:00
Alexandru Croitor
c51fe841f4 Fix handling of _nolink targets for the QtNetwork module
When a _nolink target is exported, instead of getting the original
namespace prefix, it gets the Qt6 prefix
(OpenSSL::OpenSSL_nolink -> Qt6::OpenSSL_nolink).

There is some special case code in Network autotests which tries
to access the former target name, which doesn't exist when building
standalone tests.

Make sure to create a Qt6:: library alias for _nolink targets during a
build (so before the library is exported), and change the Network
autotests project to use this Qt6:: namespaced library, which will
ensure it is found both in a standalone tests build and in a regular
Qt build.

Also make sure to actually call find_package to find the OpenSSL
library when building standalone tests, otherwise configuration will
fail.

Change-Id: I3da5b958e72e745a50380f8ab1644459a7c6b005
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-08 15:09:54 +00:00
Friedemann Kleint
1dd83dd202 Diaglib/Windows: Output more information on geometry for native handles
Obtain the client area and output frame and position relative to the
parent window.

Task-number: QTBUG-79861
Change-Id: I193dfbcdec7e27d32a70ada08ba271260eedc969
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-11-08 11:34:11 +01:00
Qt Forward Merge Bot
78c687f98e Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I963b5f48b5d6f3500ca379fbd7f1a4290b570175
2019-11-08 09:11:02 +01:00
Allan Sandfeld Jensen
52a3f1b00c Fix accuracy of ARGB32->A2RGB30 conversions
It was converted over ARGB32PM, when it should have been directly
converted to not lose accuracy, instead there was an unnecessary direct
ARGB32->RGB30 conversion, which was converted to the necessary type.

This also improves the selection of conversion over ARGB32PM or RGBA64PM
for ARGB32 and RGBA8888 by using 32-bit conversion when alpha is not
relevant.

Change-Id: I5990d8a23b2909d3910d8c1213fa46477742b052
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-11-07 10:42:08 +01:00
Edward Welbourne
e6a0a945c5 Simplify two complex test conditions
Since the test was fatuous for i == 0, iterate from i = 1, instead.

Change-Id: I9b9c1b7b10639aefdd74f48051d592da4f84dc85
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-11-07 10:35:03 +01:00
Qt Forward Merge Bot
e3cc16e9fb Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	.qmake.conf
	mkspecs/features/mac/default_post.prf
	src/corelib/tools/qsimd_p.h
	src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
	util/qfloat16-tables/gen_qfloat16_tables.cpp

Change-Id: If48fa8a3bc3c983706b609a6d3822cb67c1352a4
2019-11-06 11:41:19 +01:00
Edward Welbourne
7bf4f81de8 Add qfloat16::copySign() since we can't overload std::copysign()
Change-Id: Idfaf841b3eb3538f076ae4f0de2d7d029e1588fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-11-06 11:36:49 +01:00
Lars Knoll
2faccdf9a6 Don't insert multiple names for the same role
It doesn't make a lot of sense to have two names for the
same role. Use 'fileIcon' exclusively for the Qt::Decoration/
FileIconRole.

Change-Id: Icaa46ba4aa61efc56ba007a14bab5e59ea26cd35
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-11-05 16:32:28 +00:00
Shawn Rutledge
d1c6f7e5a2 QTextMarkdownWriter: preserve empty lists
You can save a "skeletal" document with list items to fill in later,
the same as you can do in HTML or ODF format.  Reading them back via
QTextDocument::fromMarkdown() isn't always perfect though.

Fixes: QTBUG-79217
Change-Id: Iacdb3e6792250ebdead05f314c9e3d00546eeb9f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-11-05 16:40:18 +02:00
Shawn Rutledge
524ab7b535 Avoid crashing when the end of an empty markdown list is detected
The markdown parser generates empty lists in some cases when a character
that can be used as a bullet is found on a line by itself.
cbEnterBlock() and cbLeaveBlock() are called symmetrically in such cases.
QStack::pop() on an empty stack triggers an assert, so push and pop need
to be done symmetrically too.  But it's difficult to actually create the
list as soon as the MD_BLOCK_UL or MD_BLOCK_OL callback occurs, without
breaking the case fixed in 7224d0e427 (and
probably other cases).  That's because QTextCursor::insertList() creates
a list item at the same time as it creates the list itself, and also
inherits block formatting from the previous block.  We now insert empty
lists with empty items whenever the need for that is detected though,
and there's a failsafe to prevent popping in case something still goes
wrong with that logic.  We aren't strict about reproducing the original
markdown when regenerating it via toMarkdown(), but it's getting closer.

Fixes: QTBUG-78870
Change-Id: Ided194ce7aec2710c60dbac42761ee4169ed9b78
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2019-11-05 16:39:13 +02:00
Allan Sandfeld Jensen
edec095cf8 Fix 64-bit integer support in QtJSON
Fixes parsing writing and pass-through of integers with
higher precision than double can handle.

Note this adds extra precision compared to JavaScript, but the
JSON files read and written this way are still valid, and the extra
precision in reading and writing this way is used by many JSON
libraries.

Fixes: QTBUG-28560
Change-Id: I30b2415c928d1c34c8cb4e4c6218602095e7e8aa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-11-05 10:12:04 +01:00
Andy Shaw
b1004c7d0a If only family is set, prefer that in the families list after resolving
If a font with only a family set is resolved with one that has been setup
with setFamilies() then the family needs to be prepended to the families
list after resolving. This is so that the font still prefers the one set
as just a family with no famillies set.

This also amends the QFontDialog test to account for this too.

[ChangeLog][QtGui][Text] Resolving a font that just has a family set
with families set will prepend the family to the families so that it
is still the first preference for the font.

Task-number: QTBUG-46322
Change-Id: Icc4005732f95b2b4c684e592b06b31e133270e44
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-11-05 09:46:29 +01:00
Marc Mutz
e99b0016e8 Eradicate Q_FOREACHs over QVarLengthArray
There is no excuse for copying several KiBs of data just to iterate
over it, yet that's exactly what Q_FOREACH does.

Besides, this use of Q_FOREACH is being deprecated. In my tree, it's
already a hard error.

Change-Id: I07240c37626f7d284781e8c4be05eef3c7a54f39
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-11-05 09:53:32 +02:00
Sona Kurazyan
43c964b8ad Fix converting a null QStringRef to QString
The assumption when calling QStringRef::toString() on a null
QStringRef (i.e. when QStringRef::isNull() is true) is that
QStringRef::toString().isNull() will also return true. With the
current implementation we return a null QString() only when the
QStringRef references a nullptr QString. We need to do the same
also when QStringRef references a QString with null private data.

Change-Id: I4177a5ea187ae758d7c46fe76a9d0583140e90cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-11-04 20:06:38 +01: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
Leander Beernaert
56115dba42 Convert remaining gui utils tests
Fixes:QTBUG-78229

Change-Id: I3bff1b562e1c146f291e5692c90d2c38f162d395
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-04 13:36:46 +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
Frederik Gladhorn
7ba1d611cf Fix qtHaveModule(widgets) condition
In qmake syntax there should be a colon or curly braces following a condition.

Change-Id: Ibd989662aef6320cec8093e7c6103bf8362b8255
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-11-02 08:55:27 +01:00
Qt Forward Merge Bot
ab6affac10 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I256a4b0bac4d2f5eb170967fedc4eccaec8c7f2a
2019-11-02 01:01:12 +01:00
Friedemann Kleint
89f1f14c5e Extract QGuiShortcut
[ChangeLog][QtGui] Added QGuiShortcut and made the equivalent
existing classes in Qt Widgets derive from them. This provides
basic functionality for adding shortcut handling in QML.

Fixes: QTBUG-79638
Task-number: QTBUG-76493
Change-Id: I5bbd2c8f192660e93c4690b9f894643275090e4d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-11-01 20:29:46 +01:00
Friedemann Kleint
5367f76e17 QAction: Properly port to the new configure system
Use QT_REQUIRE_CONFIG in the headers of classes to be disabled.
Add headers/source files in the .pro file depending on the configure
feature in libraries and tests.
Add the necessary exclusions and use QT_CONFIG.

Only the widgets/kernel tests were made to compile since also
the buttons depend on the action feature and it would become too
involved.

Task-number: QTBUG-69478
Change-Id: Id5bf88bc108f2bbb14dce8625bfdcb7eb0deb8e3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-11-01 20:09:28 +01:00
Friedemann Kleint
c92cb78b6d Split tests of QGuiAction(Group)
Fixes: QTBUG-69478
Change-Id: I3f5a4b859f06a0f89b2d344c36b75da4647aedce
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-11-01 15:10:51 +01:00
Timur Pocheptsov
1a878e65c2 QSslSocket - remove old OpenSSL backend (< 1.1)
OpenSSL 1.0.2 will stop receiving all support at the end
of 2019. Qt 5.15 is our next LTS thus makes sense remove
OpenSSL 1.0.2 support there. This also allows us quite
a significant cleanup of an old heavily if-defed code
and all 'pre11' suffixed source files.

[ChangeLog][QtNetwork][SSL] Removed OpenSSL 1.0.x support, now 1.1.x is required

Change-Id: I70c70c56cbd8aeff793afe793335696d1b1b7408
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-11-01 14:52:09 +01:00
Frederik Gladhorn
e7118bd7fd cmake: add tests/auto/gui/text
Fixes: QTBUG-78228
Change-Id: I3d4666a553e94de47e01d64551b8fe672994b137
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-11-01 13:28:59 +00:00
Frederik Gladhorn
8931f4fe5f cmake: fix tests/auto/gui/kernel/qguieventloop
The include does not join the required libraries. When building the
tests in a separate build directory this works for some reason (that's
why the CI doesn't catch it). Building everything top level breaks
though.

Considering this happens in maybe two places, I'm not sure it's worth
the effort of fixing the porting scripts.

Change-Id: I104ab9717257cbe8dfd5112dffd0d0b002cdb09e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-11-01 13:01:21 +00:00
Frederik Gladhorn
48c56a992e cmake: re-generate auto/gui/kernel/qguieventloop
The target naming has been fixed, it used to be taken from the include,
but now that we added the real tst_qeventloop we have a name clash.

All that's needed to fix the situation is regeneration of this cmake list.

Change-Id: Id336906f30494dfa92cf5e2812f8b1a8771a992f
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-11-01 08:50:45 +00:00
Qt Forward Merge Bot
4b0af2cdbf Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I68a6ed3184e62fa89c47c564bb01002c0918d0fd
2019-11-01 01:01:02 +01:00
Qt Forward Merge Bot
7a13a09116 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ic13ef00d76c81295076bb2432576db70ec84fe29
2019-11-01 01:00:45 +01:00
Ville Voutilainen
36e277e917 Add a transfer timeout at QNAM level as well
Task-number: QTBUG-3443
Change-Id: Idc4d3c9b1ace69bd8b6456506778116a3e8a5490
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-10-31 19:12:07 +02:00
Laszlo Agocs
09ee9ef65d Avoid EGL_BAD_MATCH in tst_qrhi autotest
Call adjustedFormat() as advised by the docs: "Applications are advised
to set this format on their QWindow in order to avoid potential BAD_MATCH
failures."

Task-number: QTBUG-79659
Change-Id: Ibf415fb0ee64bdd3f01d4ba744244bce811c0d27
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-31 14:41:07 +01:00
Frederik Gladhorn
045bb3df92 cmake: add gui/kernel tests
Fixes: QTBUG-78224
Change-Id: I9e6294b5035b066dead0f5ff91f81e472bc56d62
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-31 09:49:30 +00:00
Frederik Gladhorn
79c384ebb0 cmake: add widgets/kernel tests
Fixes: QTBUG-78230
Change-Id: Ia59f531f92e1f8499a8e814ff48c36f65984ff2a
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-10-31 09:49:03 +00:00
Friedemann Kleint
cff492fed1 Extract QGuiAction(Group) from QAction(Group) into QtGui
Simply moving QAction to QtGui was not deemed possible since
it operates on a set of controls of some kind. The approach to
extract a base class was taken instead, named QGuiAction
following the QGuiApplication scheme. QAction remains in
widgets, but changes base class.

For QActionGroup, the functions addAction(text/icon), which
create an action, cannot be implemented in QtGui, hence a base
class is needed, too (unless they are deprecated and removed).

- Extract base classes providing functionality not based on
  QtWidgets, using virtuals in QGuiActionPrivate to provide
  customization points

- Change QActionEvent to take QGuiAction, removing
  the need to forward declare QAction in QtGui

[ChangeLog][QtGui] Added QGuiAction(Group) and made the equivalent
existing classes in Qt Widgets derive from them. This provides
basic functionality for implementing actions in QML.

Task-number: QTBUG-69478
Change-Id: Ic490a5e3470939ee8af612d46ff41d4c8c91fbdf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-10-31 10:14:55 +01:00
Edward Welbourne
c3eb521a0f Update UCD data to Unicode 12.1.0's Revision 24
Had to teach the update program to accept category Lm as for
Joining_Transparent, for the sake of a new ArabicShaping.txt entry.
Added three new Unicode versions, several new scripts and a new
word-break class.

Updated UCD's test data for tst_QTextBoundaryFinder.  This left 57
tests failing; I have commented out the data rows for those tests,
pending someone with more knowledge addressing this.

Task-number: QTBUG-79631
Task-number: QTBUG-79418
Change-Id: Ic33d3b3551195d47a84d98e84020f57a68f0b201
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-10-30 17:38:02 +01:00
Lars Knoll
d273076b44 Get rid of unsharable containers
The support for unsharable containers has been deprecated
since Qt 5.3.0, so let's finally remove support for them.

Change-Id: I9be31f55208ae4750e8020b10b6e4ad7e8fb3e0e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-30 16:39:37 +01:00
Jędrzej Nowacki
b76f662726 Fix all tst_qmetatype breakages after QList to QVector aliasing
In Qt6 QList is just a typedef to QVector. To keep Qt5  behavior
compatibility we need to register aliases, otherwise some type name
based operations would not work. The patch adds automatic
registration of QList metatype alias for every QVector.

The patch doesn't cover usage of already typedef'ed and aliased
QList and QVector, but that should be quite esoteric, especially
after introduction of automatic QList and QVector type registration.

Change-Id: I84672dda2b159d94e76cdc6034861e7d7ef52533
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-30 11:52:53 +01:00
Lars Knoll
5357231c0a Make QList an alias to QVector
This is almost 100% source compatible with Qt 5. Exceptions are

* Stability of references for large or non movable types
* taking a PMF for types that are now overloaded with r-value references
  in QVector
* The missing prepend optimization in QVector (that is still planned
  to come for Qt 6)

Change-Id: I96d44553304dd623def9c70d6fea8fa2fb0373b0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-30 11:52:48 +01:00
Qt Forward Merge Bot
c51ca1d1b2 Merge remote-tracking branch 'origin/5.13.2' into 5.13
Change-Id: Ieb5afc87086758119bcfc8efbe355f5c0a93fc04
2019-10-30 06:52:03 +01:00
Qt Forward Merge Bot
cd04181b2b Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I7f11733bda960196a96c6452bdabeb7072a8430d
2019-10-30 01:00:33 +01:00
Qt Forward Merge Bot
a317bff298 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ib4df563fc7b1f7c40f425e0e71180d9517a672be
2019-10-30 01:00:14 +01:00
Edward Welbourne
d05ca484cf Make tst_QNumeric more systematic about checking float as well as double
Do this by templating the floating-point tests, which removes some
existing duplication as well as avoiding new duplication. Did some
renaming in the process. Added some tests of fuzzyCompare that come
closer to its boundary. Increased number of tests from 69 to 97. Use
std::numeric_limits to replace assorted hard-coded constants and old
C-library boundary-value macros.

It turns out MSVC's float conflates quiet and signaling NaN (although
MinGW's doesn't); and WebAssembly's old fastcomp compiler conflates
NaNs for both float and double; so XFAIL the test for distinct NaNs in
those cases.

Change-Id: I0a1c0d2f68f75d51b8cda9e3ddfe7fa9c190a3e2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
2019-10-29 16:46:54 +01:00
Laszlo Agocs
58a67e4e0a rhi: Move to CBOR in QShader and expand the autotest
Binary JSON is said to become deprecated. Therefore, add support
for CBOR. Binary JSON is still supported for deserialization, so
all existing .qsb files will continue to work, as long as the
binaryjson feature is enabled in the Qt build.

Also makes QShaderDescription comparable. This is important for
tests in particular.

A nice side effect of using CBOR is that .qsb files become smaller.
For a typical Qt Quick material shader this can mean a reduction of
300 bytes or more.

Task-number: QTBUG-79576
Change-Id: I5547c0266e3e8128c9653e954e47487352267f71
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-29 15:22:46 +01:00
Morten Johan Sørvig
dcbcda81b4 wasm: add local file access manual test
Testes file load and save, computes a sha256 hash
for verifying file content.

Change-Id: Id7f697c4dfd41e051442350f4050f04b493cfc18
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-10-29 14:02:43 +00:00
Volker Hilsheimer
3ea6a13a01 Replace usage of Q_DECL_ALIGN with C++11 alignas keyword
The macro is not documented, so can be considered private API.
Pre-C++11 compilers that don't support alignas will no longer be
supported with Qt 6.

The macro definition for the standard case of compilers supporting
the alignof keyword is left in place.

Task-number: QTBUG-76414
Change-Id: I7d722e4faf09ae998a972d3ed914de808ab316d7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-29 10:37:09 +01: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
Andy Shaw
ccd3bf0871 Ensure that child windows are visible again when showing their parent
When a window is closed, then it will cause the child windows to be
closed as well as a result. Therefore in order to ensure that they are
shown again as a result, we need to remove the WA_WState_ExplicitShowHide
attribute if the widget was not already hidden before. This enables us to
test for this attribute when calling showChildren(), so that if the
window has a windowHandle then we can make sure that this widget is shown
again.

Fixes: QTBUG-73021
Change-Id: I1186242b889899dfcd38d782a67567348e2055ee
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-10-29 10:45:19 +02:00
Christian Ehrlicher
c87e2c37de tst_QDataWidgetMapper/QFileIconProvider/ItemEditorFactory: cleanup
Cleanup QDataWidgetMapper/QFileIconProvider/ItemEditorFactory autotests:
 - use range-based for loops
 - use nullptr
 - use member initialization
 - use new signal/slot syntax
 - use static invocations
 - use override

Change-Id: I1a36ea2da7de1cfa5d5d4e305ef508fda3a6c460
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-29 06:24:01 +01:00
Ville Voutilainen
c33d8bfc99 Add a timeout for transfers
If a transfer timeout is set for QNetworkRequest, downloads
and uploads are aborted if the timeout expires and bytes
haven't been transmitted in either direction.

Task-number: QTBUG-3443
Change-Id: I702d223d673f0c6612343dc9d053815acfcb61b8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-10-28 21:15:43 +03:00
Leander Beernaert
0cab837fd7 Convert tests/auto/other
Change-Id: I79ba4f6bbbbede8ddab278dd987d9ad98277a229
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-10-28 12:19:50 +00:00
Leander Beernaert
b0aee08ff6 Convert qvulkan test
Change-Id: I395fa1c08bb67d65604962883dce3b390c604b9c
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-28 12:05:17 +00:00
Leander Beernaert
c3de886b61 Port qopengl and qopenglconfig tests
Change-Id: Ic3b61fb7f23cb884552126038d0bdf289d0cbc6a
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-28 12:04:59 +00:00
Leander Beernaert
1fa03ced47 Port rhi tests
Change-Id: I3bf5731696a0647bf0e62758eb3d1742ba097041
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-28 12:04:46 +00:00
Qt Forward Merge Bot
08f90adffd Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/corelib/serialization/qjson_p.h

Change-Id: I83cea141a4de8b3998478bfded84ca9029f7a2a9
2019-10-28 10:50:03 +01:00
Leander Beernaert
69fb4ae343 Distinguish between qt_plugin and regular plugins
If we do not encounter the load(qt_plugin) statement in the .pro file
but we do see the entry CONFIG+=plugin, treat the target as a regular
CMake library instead of treating it as a qt_plugin by default.

Change-Id: I67ad5c865a1a5ab691a6b0d86c2db4b686aa04dd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-28 09:20:37 +00:00
Qt Forward Merge Bot
8bcecd86fa Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I182a639748760393f9e6b0724259201588aeaae3
2019-10-27 01:00:50 +02:00
Qt Forward Merge Bot
7b3bdcbfe8 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I379794a01cbf6fb39d94b24cc8c90b1971a212b9
2019-10-26 01:01:32 +02:00
Qt Forward Merge Bot
86e74d60d2 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I208a36bf1c88c8291baaa5ca8fe8e838bc9d7aea
2019-10-26 01:01:14 +02:00
Friedemann Kleint
dff3843d98 QShortcut: Properly port to the new configure system
Move the feature to corelib so that the QMetaType enumeration
values can be properly excluded and there is no need for a
dummy class.

Use QT_REQUIRE_CONFIG in the headers of classes to be disabled.
Add headers/source files in the .pro file depending on the configure
feature in libraries and tests.
Add the necessary exclusions and use QT_CONFIG.

Task-number: QTBUG-76493
Change-Id: I02499ebee1a3d6d9a1e5afd02517beed5f4536b7
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2019-10-25 12:12:39 +02:00
Edward Welbourne
43f64b4dc8 Update CLDR to v36
Released on October 4th.
Adds Windows names for two time zones, Qyzylorda and Volgograd.
Added languages Chickasaw (cic), Muscogee (mus) and Silesian (szl).

Norwegian number formatting has flipped back to using colon rather
than dot as time separator; it's flipped back and forth over the last
several CLDR releases.  The dot form is present as a variant, the
colon form was long given as the normal pattern, then went away; but
now it's back as a contributed draft and that's what we pick up.

The MS-Win time-zone ID script was iterating a dict, causing random
reshuffling when new entries are added. Fixed that by doing the
critical iteration in sorted order.

Omitted locales ccp_BD and ccp_IN due to QTBUG-69324.

Task-number: QTBUG-79418
Change-Id: I43869ee1810ecc1fe876523947ddcbcddf4e550a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-10-25 11:44:48 +02:00
Edward Welbourne
ef9c498215 Tidy up data-stream test
While I was looking into a bug related to problems building the test
without GUI, I noticed a lot of spurious #include lines so tidied up a
bit.  Split some long lines, while I was about it.

Change-Id: Id87eb6f612c6b174f8240dfe9c00e0929244fb6c
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-10-25 11:44:13 +02:00
Edward Welbourne
59ca056a79 Exclude tests that need GUI when GUI isn't available
Thanks to Dmitriy Purgin for pointing out the serialization one.

Task-number: QTBUG-79353
Change-Id: Ia3d750b17ddd8fbb7a83a55df7e4546ca78c358b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-25 11:42:09 +02:00
Edward Welbourne
fd3db1dc3a Don't try to define QT_NO_CAST_TO_ASCII when the test undefines it
The qmake config for tst_QString tried to impose QT_NO_CAST_TO_ASCII
on it, but the source file explicitly #undef-s this symbol and its
friends. Leave the define commented out in the .pro so that a comment
can explain why it's no good.

Change-Id: I7620f4e104f0cdab05fdc246b903c40026e63d76
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-25 11:41:44 +02:00
Edward Welbourne
946c701883 Move a test for feature ICU from .pro to .cpp
Test QT_CONFIG(icu) in the code instead of testing qtConfig(icu) in
the profile and setting an extra define just to shadow what's already
defined. Also remove the matching define from qcollator.pro, whose
test code didn't use it.

Noticed while reviewing the conversions to CMake.

Change-Id: I19d3b1026b2a8f50ec424c450614e721500fd38a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-10-25 11:41:30 +02:00
Johan Klokkhammer Helsing
c9b3091be5 tst_qgraphicspixmaptiem: Fix undefined behavior in contains
See the comment in the test for details.

Change-Id: Ie3d356e476ba0419d304bccd396fc18a831a30cd
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-10-25 07:20:54 +00:00
Qt Forward Merge Bot
375efdd0e1 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Iebedaa967a263854f18cd403ce007d7965f26d2b
2019-10-25 01:00:16 +02:00
Christian Ehrlicher
9ae0fa4d49 cleanup QSortFilterProxyModel tests
Cleanup QSortFilterProxyModel tests:
 - adjust includes
 - use nullptr
 - use override
 - avoid unneeded casts
 - use new signal/slot syntax

Change-Id: I05f7c18cd2642bc8251bf1560803e7635684d24d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-24 19:41:16 +02:00
Christian Ehrlicher
5edf34848a QTableView: properly deselect row when column 0 is hidden/not visible
When the first column is hidden or not visible in the current viewport,
it is not possible to deselect the current row.
Fix it by passing the correct column to
QItemSelectionModel::selectedRows() when testing if the current index is
selected.

Fixes: QTBUG-79092
Change-Id: I9d8082d2b29ad2f799156aee910c6ff6e3217771
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-24 19:41:14 +02:00
Ulf Hermann
9ab043b688 QFileSystemEngine: Consistently check for invalid file names
stat() and friends expect a null-terminated C string. There is no way to
generate anything useful from a string that has null bytes in the
middle. It's important to catch this early, as otherwise, for example, a
QDir::exists() on such a path can return true, as the path is silently
truncated.

Extend the checks for empty file names to windows and add checks for null
bytes.

Change-Id: Ie9794c3a7c4fd57f9a66bdbbab8b45a08b6f9170
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-24 13:37:22 +02:00
Robert Loehning
c46eec096f QStateMachine: Don't scream at the user
Change-Id: I171606d10985bc7338b0f24ceb142fc0d88e7932
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-10-24 10:26:03 +02:00
Qt Forward Merge Bot
4158de330d Merge "Merge remote-tracking branch 'origin/5.13' into 5.14" 2019-10-24 10:25:37 +02:00
Qt Forward Merge Bot
b327807c5e Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/corelib/io/qstandardpaths_unix.cpp
	src/corelib/tools/qsharedpointer_impl.h
	tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp

Change-Id: Iae95c5778dc091058f16f6db76f04a0178a9e809
2019-10-24 10:23:44 +02:00
Eirik Aavitsland
03717be788 Fix: confusion in QImage paintEngine creation on shared images
During the creation of a raster paint engine in QImage::paintEngine(),
the QImage will be detached. At least old gcc versions would get
confused so that the newly created paintengine would end up in the old
QImage copy insteads of the newly detached one. Work around by
dropping the temporary engine pointer.

Fixes: QTBUG-79383
Change-Id: I27b1f24312269bc2bcc641dc4334397a92e3bfbb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-10-24 08:56:21 +02:00
Frederik Gladhorn
d784864b58 cmake: add gui/image tests
Fixes: QTBUG-78223
Change-Id: I9a5c90bb664e3baa4481e6bdaa9a4990e3f68317
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-23 07:56:08 +00:00
Qt Forward Merge Bot
563dc21c51 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ic062a5bd62621877b17cc0d47303b3c879241385
2019-10-22 01:00:49 +02:00
Leander Beernaert
f8c1909320 Convert corelib plugin tests
Change-Id: Ia98f7945a2c5b09a9b4d59e430cf05a7fecb7d55
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-21 11:17:20 +00: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
Samuel Gaist
9294d02395 test: migrate QDom test to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: I74ca824d5a2ee6c295c41cd577eab466326395f0
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-10-21 10:38:23 +02:00
Samuel Gaist
9fc5902d23 test: migrate manual dialogs tests to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: I9eae3291bc6934375404224c7242e2b23af2019b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-10-21 10:38:02 +02:00
Samuel Gaist
439f343416 test: migrate QDBusInterface test to QRegularExpression
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: I47a047e27432c874b47bd25581806e1bc156e94f
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-10-21 10:37:15 +02:00
Eskil Abrahamsen Blomfeldt
5205510524 Enable cursor in ligature test on Windows
The default font on Windows ("Times" is not found) does not have
a ligature for "fi", so the test would not actually be testing
what it was supposed to on this platform, and would pass even
when the code was buggy.

To enable the test on Windows, we select a standard font which
has the ligature (Calibri).

Change-Id: Ic117cd8e549aa729a0cd68006d7c180c6c89c053
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-21 09:01:26 +02:00
Qt Forward Merge Bot
daa8040b50 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I642be6de9ef32491b09db97185146c671266240e
2019-10-21 01:00:56 +02:00
Qt Forward Merge Bot
ab5153aa0b Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I5b671c89ceb8998b37f99d58df0e0a9e5785e3ad
2019-10-19 01:01:03 +02:00
Qt Forward Merge Bot
84db112fe2 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I69f44ea7254cb2643a00b040bbb46f41b7f76a87
2019-10-19 01:00:45 +02:00
Leander Beernaert
bb7fa0b9a0 Fix OpenSSL include path for QtNetwork private tests
On platforms which use OpenSSL that is not installed in a standard
directory, e.g: android + vcpkg, private tests would fail to resolve
the include for OpenSSL.

Change-Id: I57ce6a83e3bc9a232d4285530f8619ffbfdf2f77
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-18 13:30:57 +00:00
Johan Klokkhammer Helsing
52484cc4b6 Widget tests: Skip tests that fail on Wayland
Either by testing for platform name or window activation.

After this gets in, we can enable widget tests in the Wayland bot, which
hopefully will reduce the number of regressions in the Wayland plugin.

Fixes: QTBUG-62188
Change-Id: I71ce8abd6b5891e5b953126b1c35345892585931
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-18 10:53:34 +02:00
Eirik Aavitsland
19f29802bf Fix: QPainter off-by-one clipping for some non-integer scalings
For some scalings, setClipRect(QRect) would produce a clip one pixel
different from setClipRect(QRectF) because of different
rounding. Ditto for setClipRegion. Fix by making sure to transform
QRectFs instead of QRects.

Fixes: QTBUG-78962
Fixes: QTBUG-78963
Change-Id: I0be721133858c30769ec6d81e978962a3d6b70cf
Reviewed-by: Christoph Cullmann <cullmann@kde.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-10-18 06:11:39 +00:00
Qt Forward Merge Bot
56e5e06ff2 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I24461492372fb9a2e46a3b8dfb6c854b85e9c600
2019-10-18 01:00:52 +02:00
Qt Forward Merge Bot
dce8849037 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I4fbbf100b673ab100997dbf2f42bf195dc3c050f
2019-10-18 01:00:35 +02:00
Frederik Gladhorn
328122dddd tst_qiconhighdpi: fix target name
CMake will complain that we have a duplicate test name otherwise.
Generally it makes a lot of sense to name the test binary the same as
the test itself.

Change-Id: I27c4b51e6a2869f025e1100f1a9dd6b54ebdaf55
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Morten Kristensen <me@mortens.dev>
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-10-17 16:44:51 +02:00
Johan Klokkhammer Helsing
4b5ff2be7c QGraphicsView tests: Prefer exposed over active
Makes the tests pass on Wayland.

Task-number: QTBUG-62188
Change-Id: I5860c1ae6dd3d15632d827f4e357cb6c2cc9c5e3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-17 13:12:17 +02:00
Johan Klokkhammer Helsing
ee4a604a2e tst_qdialog: Wait for exposed instead of active
This makes the test pass on Wayland.

Task-number: QTBUG-62188
Change-Id: Ib67cf8913055bbe753f71791095aff035342c18d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-17 13:12:12 +02:00
Simon Hausmann
02164e0288 Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: Ia1da879a7bd8f71a649661a1844144dd67d60b3a
2019-10-17 09:41:36 +02:00
Qt Forward Merge Bot
6f27bb1352 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ica69de99be9c8af4d28a52e4b69e6af748ed983c
2019-10-17 01:01:01 +02:00
Samuel Gaist
c222a9283d QAbstractItemModel: implement QRegularExpression support for match
This is part of the migration of qtbase from QRexExp to
QRegularExpression.

[ChangeLog][QtCore][QAbstractItemModel] The match() method now
supports the new Qt::RegularExpression match flag value. This
will allow users to use either a string or a fully configured
QRegularExpression when doing searches. In the second case,
the case sensitivity flag will be ignored if passed.

Task-number: QTBUG-72587
Change-Id: I07c8d72a661c48b7f4fcf13ef8e95980bcdcb998
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-10-16 21:53:30 +02:00
Eirik Aavitsland
ea377c5a2f Add testing of fillRect() to QPainter lancelot test
Change-Id: I3be230d3fafa178a37cf7387f79f372c8d8aeb05
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-10-16 06:31:59 +00:00
Christian Ehrlicher
78d349eaab tst_QSqlQuery: remove tests commented out a long time ago
Remove some code which was commented out with 'NOT_READY_YET' since the
initial Qt5 import. Since the mentioned bug reports are no longer
available remove this code.

Change-Id: I98686e53d85619f01d16105d147eba79b557a104
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-10-16 08:25:38 +02:00
Johan Klokkhammer Helsing
821c2eb131 tst_qfiledialog2: Don't assume window activation is available
Prefer qWaitForWindowExposed over qWaitForWindowActive whenever possible, skip
in the other cases.

Makes the test pass on Wayland.

Task-number: QTBUG-62188
Change-Id: I60b4000c72c3727a2f33b79a5038469055b0fef2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-16 07:06:12 +02:00
Johan Klokkhammer Helsing
8814c5778d tst_QAbstractScrollArea: Use qWaitForWindowExposed instead of active
Makes the test pass on Wayland.

Task-number: QTBUG-62188
Change-Id: I53011ad623e4bdb557d79c136f06ce7ac00a08ee
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-16 07:03:09 +02:00
Qt Forward Merge Bot
e3f5912747 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I8348c823117dd3d594d365fc3583f7e44d44a81c
2019-10-16 01:01:07 +02:00
Qt Forward Merge Bot
faab18c65a Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ifd83db69416230175ddc3161f640b612755018fc
2019-10-16 01:00:49 +02:00
Johan Klokkhammer Helsing
80ddac3a0a tst_qgraphicseffect: Wait for exposed instead of active
Makes the test pass on Wayland.

Task-number: QTBUG-62188
Change-Id: I3900925e74d8d940a8c5af87ea64a6ec3c8c3293
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-15 20:39:32 +02:00
Sona Kurazyan
9cc040a806 Prepare for deprecating the QDesktopWidget
QDesktopWidget is marked as obsolete in docs, but it is not yet
completely deprecated, some of its methods are still in use.

Replace uses of the following methods marked as obsolete:
- QDesktopWidget::screenNumber(QWidget*) -> QWidget::screen()
- QDesktopWidget::screenGeometry(QWidget*) -> QWidget::screen()->geometry()
- QDesktopWidget::availableGeometry(QWidget*) -> QWidget::screen()->availableGeometry()

Task-number: QTBUG-76491
Change-Id: I2cca30f2b4caa6e6848e8190e09f959d2c272f33
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-15 20:09:29 +02:00
Christian Ehrlicher
ed7dd9a6ed QODBC: Fix crash when a prepared statement is deleted after the db was removed
When a prepared statement is still alive after the database was removed
with QSqlDatabase::removeDatabase(), the cleanup routine is trying to
access the driver which is no longer alive which results in a crash.

Fixes: QTBUG-79019
Change-Id: I4630e3b947a12b23ed062f015abc373fc0e246c1
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-10-15 13:37:42 +02:00
Alexandru Croitor
190e9dcdcf Regenerate files after dev -> wip/cmake merge
Note the following bigger things that had to be done:
Handle GSS library / feature with a new custom find module.
Implement rudimentary support for relocatability (does not currently
handle extprefix).

Change-Id: Ic6cd27dda7ebca9829f51cb42ea76fff6d1767ef
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-14 19:01:19 +00:00
Friedemann Kleint
05a829f923 Win32: Consolidate registry code
Add a RAII class for registry keys and use it throughout
the code base.

Change-Id: I666b2fbb790f83436443101d6bc1e3c0525e78df
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-10-14 20:26:42 +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
Johan Klokkhammer Helsing
332c255c69 tst_qgraphicsitem: Skip tests that fail on Wayland
Task-number: QTBUG-62188
Change-Id: If0638d51bffa6ef375476c0a601c387bd05583ae
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-14 14:06:32 +02:00
Alexandru Croitor
b6e75ff3ea Regenerate qtbase after wip/qt6 -> wip/cmake merge
Note that android builds will be broken after this merge and
regeneration, because we don't currently handle the minimum required
changes that were brought in with the Android multi ABI support
that comes from 5.14.

This will have to be addressed in a separate change.
For now the build on Android will fail while compiling due to incorrect
generation of LIB_SUFFIX with QT_ARCH.

Change-Id: Ia4a871f4b7ddd0da11caf5f34e10a599a97bb55d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2019-10-14 08:49:24 +00:00
Sona Kurazyan
ffac899576 Fix the size calculation of QHeaderView when stylesheet is used
When calculating the header section size based on its contents when a
stylesheet is used, the size hints from the stylesheet are used. In case
if the stylesheet specifies only one of the sizes, the other is set to
-1. Because of this the actual content size is ignored.

The solution is to calculate the size based on the application style, in
case if it's not specified in the stylesheet.

Fixes: QTBUG-75615
Change-Id: I3453fa623d75b6b32832edf753de6e3e4e7f5a22
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-10-14 10:17:07 +02:00
Johan Klokkhammer Helsing
df91ff5551 tst_qgraphicsitem: Don't assume window activation is available
Some windowing systems (i.e. Wayland) do not allow applications to steal window
focus.

Normally, we would just replace qWaitForWindowActive with
qWaitForWindowExposed, because that is usually the intent, in this test
however, there are many occurrences of both variants right after each other.
And, as described in the commit message of 153e8b49a, this may be because
window activation may cause repaints, and we want to wait for it to reduce
the chance of receiving an extra repaint later (possibly causing tests to be
racy).

Therefore, I took the conservative approach, and kept the qWaitForWindowActive
calls, except when the capability is not available. Hopefully this will not
cause flakiness in existing platforms, while also allowing tests to pass on
platforms where activation is not supported.

Task-number: QTBUG-62188
Change-Id: I15502baa28c464a808d585a5e6d67c9b745b17ae
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-14 08:39:31 +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
Sona Kurazyan
66a9c4b0b2 Remove usages of deprecated APIs of QDesktopWidget
- Replaced the usages of the following deprecated APIs:
  * QDesktopWidget::screenCount() -> QGuiApplication::screens().size()
  * QDesktopWidget::screenGeometry(int) -> QGuiApplication::screens().at()
  * QDesktopWidget::screenNumber(QPoint) -> QGuiApplication::screenAt(QPoint)

- Added notes for the QWidget *QDesktopWidget::screen(int), which
currently has no replacement.

- Fixed the tests to build conditionally, only when these APIs are
enabled.

Task-number: QTBUG-76491
Change-Id: I2fdec96d0a6a4fc782c53549b05a5556412b8305
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-10-13 13:08:42 +02:00
Qt Forward Merge Bot
8d8140dffa Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I9953c1ca16862184c2373027e946c482ce8e6f0e
2019-10-13 01:00:43 +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
Samuli Piippo
55427858e3 QStandardPaths: Correct handling for XDG_RUNTIME_DIR
Always try to create the runtime directory and never change
the permissions of an existing directory. Conform to the
XDG Base Directory Specification:

"If, when attempting to write a file, the destination directory
is non-existent an attempt should be made to create it with
permission 0700. If the destination directory exists already
the permissions should not be changed."

Fixes: QTBUG-68338
Change-Id: Iaf854d69225fc46e43abae86232d749e5c247df0
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-12 08:57:35 +03: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
Andre de la Rocha
31012df705 Fix QGraphicsScene::update() performance
A previous fix has caused a performance degradation while adding a
check for avoiding adding duplicated rectangles to the update list.
This patch fixes it by using a std::set instead of a QList, avoiding
duplication while using an O(log N) operation, instead of the O(N)
used before.

Fixes: QTBUG-77952
Change-Id: Ifa9fbf110e0bad60ee02a42d91281981fd98ceab
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-10-11 16:53:23 +02:00
Milian Wolff
014d7ac654 Q{Shared,Weak}Pointer: Reduce overload sets in implicit conversions
Only allow implicit conversions when the types involved are compatible.
That means, only allow construction and copy assignment when the type
X* is convertible to type T*. This is done using SFINAE and the
std::is_convertible type trait, which makes the previous
QSHAREDPOINTER_VERIFY_AUTO_CAST obsolete.

This patch fixes compilation when a function is overloaded with
Q{Shared,Weak}Pointer of different, incompatible types. Previously, this
resulted in a compilation error due to an ambiguous overload.

Change-Id: I069d22f3582e69842f14284d4f27827326597ca2
Fixes: QTBUG-75222
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-11 16:53:23 +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
Volker Hilsheimer
1748dc3e2d QGroupBox: always disable children in a checkable, unchecked groupbox
The childEvent handler sets the enabled property of children as they are
added to the groupbox, but applications might later enable children and
check/uncheck the groupbox's checkbox in undefined order. In that case,
we would end up with enabled children inside a conceptually disabled
groupbox (the groupbox's checkbox represents the logical "disabled"
state), which breaks documented QWidget::enabled rules.

To make sure that all children are disabled as per the state of the
groupbox, we need to run that logic once the UI has been set up, and
before it becomes visible. This is what polishing is for, so listen
for that event in addition and handle it the same way as adding (which
duplicates things, but keeps existing code that might depend on things
being updated as they are added working).

Adds the case to the existing enabledChildPropagation test case.

[ChangeLog][QWidget][QGroupBox] Always disable children of a checkable,
unchecked group box before showing.

Change-Id: I978bd27b6f1a3f54ec745faeea529a98d0d93619
Fixes: QTBUG-25938
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-10-11 13:53:49 +02:00
Eirik Aavitsland
c54083ff93 Fix QEasingCurve possible imprecision at endpoints
Both the spline curves and (most of) the predefines curves are defined
as having start value 0.0 and end value 1.0. The spline and In/OutBack
functions would sometimes not produce that result precisely, so code
could not reliably depend on expressions like (easedValue < 1.0)
becoming false. Fix by explicitly handling endpoints.

Fixes: QTBUG-76781
Fixes: QTBUG-72630
Change-Id: I21be43af469a76c090154bffef8406a9baf2d0b1
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-11 12:29:27 +02:00
Edward Welbourne
60deb69034 Distinguish invalid datetimes from others
A default-constructed QDateTime is invalid, but compared equal to a
valid one referencing the start of 1970.  This lead to date properties
in QML being initialized invalid but not getting an onChange if the
first value they're set to is the start of 1970.

Fixing that then lead to some tests failing. Indeed, the original
equality check involved using toMSecsSinceEpoch(), whose value is
undefined unless the datetime is valid, without a prior check on its
validity: so ensure all uses of toMSecsSinceEpoch() are guarded with
isValid() checks.

Reworked tst_QDateTime::toSecsSinceEpoch() to use its bool column
(previously unused, after separating from toTime_t(), which uses this
column for "out of time_t's range") for validity of the datetime.

[ChangeLog][QtCore][QDateTime] Invalid datetimes are now treated as
equal and less than all valid ones. They could previously be found
equal to valid datetimes.

Fixes: QTBUG-79006
Change-Id: Ie72deb8af4350a5e808144d0f6e42dc8eb3ff5ef
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-11 11:59:41 +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
Frederik Gladhorn
afb82ef5be Merge 5.13 into 5.13.2
Change-Id: Id8852e90bfc5e4bd3e344435195992c5c7a0ab86
2019-10-11 09:54:09 +02:00
Qt Forward Merge Bot
50d41f14ee Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I14f539ccfa4ab6e21188b98c314bdb030f3b9f70
2019-10-11 01:01:15 +02:00
Shawn Rutledge
f1dd6addda Make QTextBlockFormat::MarkerType an enum class
This came up during API review.

Change-Id: I9198e1eb96db0c21e46a226a032919bb62d3ca66
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-10-10 21:08:08 +02:00
Christian Ehrlicher
95717ea834 tst_QAbstractItemView: cleanup
Cleanup QAbstractItemView autotest:
 - use range-based for loops
 - use nullptr
 - use member initialization
 - use new signal/slot syntax
 - use static invocations
 - use override
 - replaced QCoreApplication::processEvents with
   QTRY_VERIFY/QTRY_COMPARE

Change-Id: Iba91811db6fb925364fc88ec36357e758b937329
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-10 18:08:36 +02:00
Frederik Gladhorn
5e421957de Fix strange qmake syntax
It seems like qmake is happy with the comment, followed by a
continuation and then another comment, but having the continuation at
the end of the line makes more sense.
This will make it easier to port to CMake.

Change-Id: I20c964e8c3b6fea4745095783503045b191b000b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-10 16:57:37 +02:00
Frederik Gladhorn
06fdea1ce5 cmake: add corelib/thread/qthreadstorage
Fixes: QTBUG-78221
Change-Id: Icb4614f8187c16e6b13d9db1dbc6adfcd579db43
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-10 12:10:27 +00:00
Timur Pocheptsov
9845c06d1f DTLS auto-test(s) - fix a buggy logic with pending datagrams
Fixes: QTBUG-79128
Change-Id: Ifebd5b056541b7732b15b5cf063ad22ab754a64c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-10-10 11:28:24 +02:00
Lars Knoll
e1fd607493 Remove leftovers from QML1
QML1 is not supported anymore, remove the leftover hooks for it.

Change-Id: I2900726714c5faea3523b2ebe39bb393364b3bfb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-10-10 11:28:19 +02:00
Leander Beernaert
f863bf7d64 Add XML tests
Initial conversion of XML tests.

Change-Id: I47256d4d87dad106b04be2c2e1abc9ef070be973
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-10 09:02:43 +00:00
Liang Qi
9c84b7786c Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/plugins/platforms/xcb/qxcbscreen.h
	src/src.pro

Change-Id: I4e1981e69a1ddcbe4078ec6ab2a64b0da6a445de
2019-10-10 09:13:49 +02:00
Qt Forward Merge Bot
68375b4f3d Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Iadeca81f499d6b19e86ceae1edd7960db2575e90
2019-10-10 09:10:27 +02:00
Qt Forward Merge Bot
8b91c68315 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Iab9b3a7d004a2e4b4de816f4a2d7ed2fb936d3ae
2019-10-10 01:01:26 +02:00
Robert Loehning
d6734e8ab7 Fuzzing: Don't copy input data to QByteArray
Change-Id: I603413805dca46a85709c2ab6ff573687849572e
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-10-09 17:16:09 +02:00
Laszlo Agocs
b62b80706e rhi: Autotest for rendering a triangle into a window
Change-Id: Id1562ff8cf7c6bc7e5bd147bb628f3d9dd57f2b5
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-09 17:15:06 +02:00
Laszlo Agocs
df0b1836b5 rhi: Autotest rendering with uniform buffer
Change-Id: I4251f31494680c78e90a08a2b471cb1af08ecd81
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-09 17:15:06 +02:00
Laszlo Agocs
b2de7f8583 rhi: Autotest rendering a textured quad
Task-number: QTBUG-78971
Change-Id: I0e7e0f3c00f9509031f7b4a8a389e51c915f01c2
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-09 17:15:06 +02:00
Laszlo Agocs
8f44da1f55 rhi: Enable the qrhi autotest on WinRT
There is no onscreen support for WinRT in the D3D11 backend yet.
However, offscreen operations (rendering into a texture) should work.
One catch is that there is no D3DCompile available for deployed WinRT
apps. So ship the intermediate format (DXBC output from fxc) in the
.qsb files.

Change-Id: Ic0aba4b817c27d13dcf3af41bf7612d799382655
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-10-09 17:15:05 +02:00
Laszlo Agocs
dd105fab8d rhi: Autotest rendering a triangle
Also improve (docs and runtime checks) and test the minimum set
of required data to create a graphics pipeline.

Task-number: QTBUG-78971
Change-Id: If5c14f1ab1ff3cf70f168fde585f05fc9d28ec91
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-09 17:15:05 +02:00
Laszlo Agocs
9baf69c765 rhi: gl: Add a feature flag for reading back non-zero mip levels
The joys of "level - Specifies the mipmap level of the texture
image to be attached, which must be 0." for glFramebufferTexture2D
in OpenGL ES 2.0.

Change-Id: Iaf19502f48d7ba73b26abb72535bfa6696a1e182
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-09 17:15:05 +02:00
Laszlo Agocs
9c466946d0 rhi: Autotest basic texture operations
...and make the Null backend able to deal with these, for RGBA8 textures
at least. Naturally it is all QImage and QPainter under the hood.

Also fix a bug in the OpenGL backend, as discovered by the autotest:
the size from the readback did not reflect the mip level.

Task-number: QTBUG-78971
Change-Id: Ie424b268bf5feb09021099b67068f4418a9b583e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-09 17:15:05 +02:00
Laszlo Agocs
89ec1b3618 rhi: Add support for buffer readbacks
This also marks the beginnings of significantly extending autotesting
of the resource and rendering functionality in QRhi.

Also involves fixing up the buffer operation lists like we did
for textures before. This is to ensure updates and reads on the
same batch execute in the correct order. So just have two lists:
one with buffer, one with texture operations.

Also simplify the struct layouts. No need for those inner structs
with many duplicate members. This reduces the size even, since using a
union was never an option here. Also switch to a VLA, the size is around
253 KB per batch.

The Null backend now keeps track of the QRhiBuffer data so it can return
valid results in readbacks.

Task-number: QTBUG-78984
Task-number: QTBUG-78986
Task-number: QTBUG-78971
Task-number: QTBUG-78883
Change-Id: I9694bd7fec523a4e71cf8a5c77c828123ebbb3bd
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-09 15:15:05 +00:00
Laszlo Agocs
4a3ee77f65 rhi: Exercise nativeHandles() in qrhi test
Task-number: QTBUG-78971
Task-number: QTBUG-78972
Change-Id: Ibce10caf1ccd74ae7efead9579f4a4342ef896b8
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-09 17:15:05 +02:00
Lars Knoll
ba26496647 Don't crash when calling jumpToFrame() on an empty QMovie
Properly return an invalid frame when calling jumpToFrame()
with a non existent frame number.

Fixes: QTBUG-79029
Change-Id: Ic40f4a6de3106fab42c0bb6c961194be47b04e31
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-10-09 15:58:26 +02:00
Edward Welbourne
61ec1abc08 Suppress deprecation warnings on a test of a deprecated QString method
QString::fromAscii() is deprecated since 5.0 but still tested.
So suppress deprecations for its code.

Change-Id: Ic048a843c43551021da39a16d94c3222201573dc
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2019-10-09 11:18:22 +02:00
Qt Forward Merge Bot
74858dc4af Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I03d82c5bc47908a97e7a908d7e67a7301b28d8cb
2019-10-09 01:00:42 +02:00
Robert Loehning
af8f3c5da4 Add libfuzzer test for QTextLayout::beginLayout()
Task-number: QTBUG-77819
Change-Id: I34e9cbaa615896222bcf947012cfed9f6c3186c7
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
2019-10-07 15:40:34 +02:00
Mårten Nordheim
3dd8f6dc34 Schannel: no longer keep old ssl errors around when reusing socket
And add a test for it so it can no longer happen in any current or
future implementation.

Change-Id: I3214aa90595e291b1e1c66befe185cfe1ea7bc6b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-07 11:34:39 +02:00
Frederik Gladhorn
7bca6edc16 cmake: add tests in corelib/serialization
The DEFINES -= QT_NO_LINKED_LIST is no longer needed, so just remove it
from .pro and CMakeLists.txt.
Handle $$[QT_INSTALL_TESTS] and $$TARGET in target.path.
When we have DESTDIR set, do not use target.path for OUTPUT_DIRECTORY.

Fixes: QTBUG-78219
Change-Id: I5161a955b25ff2f3b35428dc4b935a7c9d2d425b
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
2019-10-07 08:57:31 +00:00
Qt Forward Merge Bot
2c4b44d750 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ife31dad3c8dc43c5ff4d266e6d646230c5d20a50
2019-10-06 01:01:08 +02:00
Qt Forward Merge Bot
327b305e95 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I554a2762890391b3b6013c8b82211a8386a4ced8
2019-10-05 01:01:06 +02:00
Frederik Gladhorn
a594629602 cmake: Add find ICU to fix building test
This fixes building of tests, which are currently all failing in
auto/corelib/time/qtimezone.

Change-Id: I6183217d51b5636651da9026f71353cdde1e2444
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-04 22:01:37 +00:00
Simon Hausmann
da284ef10e Add support for machine-readable JSON output to the MOC
The --output-json parameter will make moc produce a .json file next to
the regular output file. With --collect-json the .json files for a
module can be merged into a single one.

Task-number: QTBUG-68796
Change-Id: I0e8fb802d47bd22da219701a8df947973d4bd7b5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-10-04 18:35:29 +02:00
Frederik Gladhorn
18cf9b24cb cmake: add tests/auto/corelib/itemmodels
Fixes: QTBUG-78217
Change-Id: Ic2c343ab3cb1d86b9649e8ef242c7cd180f73c60
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-04 13:45:40 +00:00
Christian Ehrlicher
64473c9320 tst_QColumnView: cleanup
Cleanup QColumnView autotest:
 - use range-based for loops
 - use nullptr
 - use member initialization
 - use new signal/slot syntax
 - use static invocations
 - use override

Change-Id: Iae94e9074b65cca1e4d9eb199ea2b13e0cfa2880
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-04 15:36:39 +02:00
Liang Qi
96a2044009 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/network/access/qnetworkaccessmanager.cpp
	src/network/access/qnetworkreplyhttpimpl.cpp

Change-Id: I059be651604623616fd31e8616be8ae61b4f8883
2019-10-04 15:27:15 +02:00
Tor Arne Vestbø
0768a28fbf Remove CFBundleGetInfoString from Info.plist templates
Is't been deprecated since Mac OS X 10.5.

Task-number: QTBUG-74872
Change-Id: I8b1ad7aca6448883cb164fd0c4b329592ca60548
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-04 13:09:34 +00:00
Robert Loehning
de182ea0be Add libfuzzer test for QTextDocument::setMarkdown()
Change-Id: I729d4a3bb276523011a6f17a800e72aa34540e47
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-10-04 14:47:59 +02:00
Frederik Gladhorn
b3b2c799f8 cmake: add tests in corelib/time
Change-Id: Idcd5d1be7503b50a43954c1b209e48a32cc8eaa9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-04 06:30:36 +00:00
Frederik Gladhorn
a98f64af91 cmake: add more tests in corelib/thread
This fixes the qatomicinteger magic by making $$basename work for one
particular case.

qthreadstorage still needs investigation.

Task-number: QTBUG-78221
Change-Id: I7bb38f6ca24273bcf0443ab25685c8e815814c3c
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-04 06:27:19 +00:00
Qt Forward Merge Bot
3a1613c227 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I43393cf47675fd6c14972df1221986335c6f493c
2019-10-04 01:01:48 +02:00
Joerg Bornemann
5ab8efd66a Make conflicting targets check less strict
People tend to "turn off debug and release builds" by just not building
one of the variants. For example, Qt's own rcc is built in release only,
however it is configured for debug_and_release with the same TARGET for
both.

Let qmake complain about conflicting TARGETs only we're about to build
all of those conflicting targets, i.e. if build_all is set.

Change-Id: I0448bf5cb421e2d801d3cc30e0d80353fba0d999
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-10-03 20:28:03 +02:00
Simon Hausmann
3598ffcc26 Disable tests with qemu-arm & developer-build configurations in the CI
After commit b88acae7a8e773c307e44f84da037d01d19e60f7 in qt5, the
developer-build enabled qemu-arm tests were disabled and after that
changes were introduced in qtbase that would make tests fail (such as
qtextmarkdownwriter or tst_QSocks5SocketEngine). These tests would still
be run when another repository enables qemu-arm developer builds, such
as qtdeclarative. This patch removes that test coverage.

We can't really change the behavior of the CI to not run tests in
dependent repos when a repo adds test configurations (such as
qtdeclarative.yaml) as that in turn would remove the test coverage that
qt5.yaml adds over default.yaml.

Also amends d225f73c09

Change-Id: I05bdeac7fffbbfcc2be7904cb06067897958f30d
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-10-03 15:12:33 +00:00
Simon Hausmann
dcecaeb7b9 Prospective fix to stabilize tst_qwindow::isActive() on Windows 10
It is conceivable that during the try-compare loop of processing
windowing system events we loose and regain the focus. That would
explain the occasional test failure where instead of the expected 3
focus in events, we have received four.

Task-number: QTBUG-77769
Change-Id: I2221440d09a74d4d18a72f7786232b4491cf45a8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 56f084781e)
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-10-03 15:09:16 +00:00
Edward Welbourne
d448f2ecb8 Correct handling of -qfloat16(0)
It is finite and normal; it classifies as a zero; and it should not be > qfloat16(0).
Added tests to match.

Change-Id: I7874fb54f622b4cdf28b0894050ad3e75cf5d77c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-03 16:30:40 +02:00
Edward Welbourne
b4efdd3769 Reorganise the qfloat16 auto-test
Its limits() test was rather large and had some overlap with an older
qNan() test, that needed some clean-up (it combined qfloat16 values
with double and float values in ways that caused qfloat16 to be
promoted to another type, so we weren't testing qfloat16).

Renamed the qNan() test to qNaN(), separated out the parts of it that
actually tested infinity. Moved various parts of limits() to these and
rationalised the result. Split out a properties() test from limits()
for the properties of the qfloat16 type that are supplied by its
numeric_limits. Split out a data-driven finite() test to cover some
repeated code that was in limits() and extended it to test more
values. Added more tests of isNormal().

Fixed my earlier UK-ish spelling of "optimise", in the process, and
identify the processor rather than the virtualization as the context
where the compiler errs.

Change-Id: I8133da6fb7995ee20e5802c6357d611c8c0cba73
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-03 11:09:47 +02:00
Laszlo Agocs
f1c7814a55 rhi: Remove QVectors from the data description structs as well
As usual, keep some QVector overloads around to allow Qt Quick to compile.

Color attachments and vertex input bindings get an at(index) type of
accessor, unlike any other of similar lists. This is because there the
index is significant, and sequential iteration is not the only type of
operation that is performed. Sometimes a lookup based on an index will
be needed as well.

Task-number: QTBUG-78883
Change-Id: I3882941f09e94ee2f179e0e9b8161551f0d5dae7
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-03 09:37:48 +02:00
Simon Hausmann
d225f73c09 Blacklist markdownwriter also on boot2qt
Task-number: QTBUG-78950
Change-Id: Ia5cb8e38d9e9edf75ded253160852b0ede42f75c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-10-02 19:27:08 +02:00
Frederik Gladhorn
936444d859 tst_qnetworkreply: Remove getFromHttp:success-external
The test fails because the server (reasonably) sends a https redirect.
Let's not rely on external servers serving http indefinitely.

Fixes: QTBUG-71953
Change-Id: I20937b2c6f268519636349bae8c99c1afe64fcf9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-10-02 11:36:04 +02:00
Qt Forward Merge Bot
4c8814a341 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ideaa64d583746f1ce8265997131fb1ce3a9acbcf
2019-10-02 08:39:15 +02:00
Mårten Nordheim
6e203824a2 Move away from recently deprecated HTTP2 attributes
Amends f59f67287f

Change-Id: I74045c558e9d20f9f45f150a91f181a04e9b8c69
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-01 18:40:29 +02:00
Qt Forward Merge Bot
8791a8398a Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2019-10-01 11:47:42 +02:00
Simon Hausmann
56f084781e Prospective fix to stabilize tst_qwindow::isActive() on Windows 10
It is conceivable that during the try-compare loop of processing
windowing system events we loose and regain the focus. That would
explain the occasional test failure where instead of the expected 3
focus in events, we have received four.

Task-number: QTBUG-77769
Change-Id: I2221440d09a74d4d18a72f7786232b4491cf45a8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-01 11:47:37 +02:00
Qt Forward Merge Bot
4e40c54a3c Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I77ba01f09b3dbcaf13cb265a70d9da661c32a61f
2019-10-01 01:01:20 +02:00
Laszlo Agocs
7000b66f7e Remove QVector in the API of QRhiResource subclasses
Forcing users to go through a QVector, when in practice they almost
always want to source the data from an initializer list, a QVarLengthArray,
or a plain C array, is not ideal. Especially since we can reason about
the maximum number of elements in the vast majority of use cases for all
the affected lists. QRhiResource is also not copyable so we do not need
the usual machinery offered by containers. So switch to a
QVarLengthArray.

Note that a resource is not a container. The only operations we are
interested in is to be able to source data either via an initializer
list or by iterating on something, and to be able to extract the data,
in case a user wishes to set up another resource based on the existing
one.

In some cases a QVector overload is kept for source compatibility with
other modules (Qt Quick). These may be removed in the future.

Also do a similar QVector->QVarLengthArray change in the srb-related
data in the backends.

Change-Id: I6f5b2ebd8e75416ce0cca0817bb529446a4cb664
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-30 20:07:43 +02:00
Liang Qi
6f9a215cc4 Merge "Merge remote-tracking branch 'origin/5.13' into 5.14" 2019-09-30 20:07:25 +02:00
Edward Welbourne
4bd6cd1992 Featurize support for signaling NaN
One of our compilers for emscripten coerces all signaling NaNs to
quiet ones, so won't do any actual signaling. Anyone relying on them
to do so shall be disappointed, so it's better that they know about it
at compile-time - or, at least, have the ability to find it out.

Put the signaling NaN producers (and remaining (test) code using them)
under the control of a feature that's disabled when numeric_limits
claims double has no signaling NaN. Assume the bootstrap library
doesn't need signaling NaNs. Sadly, until C++20 <bit>, there's no
contexpr way to test that alleged signalling and quiet NaNs are
actually distinct.

Added some auto-tests for signaling NaN, including that it's distinct
from quiet NaN. Any platform on which the last fails should disable
this feature.

Task-number: QTBUG-77967
Change-Id: I57e9d14bfe276732cd313887adc9acc354d88f08
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-09-30 20:05:42 +02:00
Liang Qi
99cdd5fc67 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/corelib/global/qrandom.cpp
	src/corelib/io/qfileinfo.cpp
	src/corelib/kernel/qeventdispatcher_win.cpp
	src/corelib/kernel/qeventdispatcher_win_p.h
	src/gui/text/qfontdatabase.cpp
	src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
	src/plugins/platforms/windows/qwindowsglcontext.cpp
	src/testlib/qtestcase.cpp

Done-With: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I4893212471aa24be804c989a581810e2f714545c
2019-09-30 14:43:02 +02:00
Laszlo Agocs
86876744f0 Ensure drawable size atomicity within a frame
Revert surfacePixelSize() to be a getter only. With Metal this will
mean returning the "live" layer size (and so not the
layer.drawableSize), which is in line with what we expect with other
backends.

Instead, we leave it to the swapchain's buildOrResize() to "commit"
the size by setting drawableSize on the layer. With typical
application or Qt Quick logic this ensures that layer.drawableSize is
set once and stays static until we get to process the next resize - on
the rendering thread.

This of course would still mean that there was a race when a client
queries surfacePixelSize() to set the depth-stencil buffer size that
is associated with a swapchain. (because that must happen before
calling buildOrResize() according to the current semantics)

That can however be solved in a quite elegant way, it turns out,
because we already have a flag that indicates if a QRhiRenderBuffer is
used in combination with (and only in combination with) a
swapchain. If we simply say that setting the UsedWithSwapChainOnly
flag provides automatic sizing as well (so no setPixelSize() call is
needed), clients can simply get rid of the problematic
surfacePixelSize() query and everything works.

Task-number: QTBUG-78641
Change-Id: Ib1bfc9ef8531bcce033d1f1e5d4d5b4984d6d69f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-29 22:16:55 +02:00
Laszlo Agocs
cd5a0bc735 rhi: Always enable debug info printing from manual tests
It can be important to see for example the adapter enumeration that is
printed when qt.rhi.general is enabled. Make it enabled by default in
the tests.

Change-Id: I7bd073781e176d9b17b5386c548e9f8a2e16c10f
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-29 00:12:53 +02:00
Qt Forward Merge Bot
e8d7df4cb2 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I98086dc1584e90a24a4f90cd7b86582df047e81d
2019-09-28 01:00:51 +02:00