Commit Graph

768 Commits

Author SHA1 Message Date
Lars Knoll
71b4d4f150 Fix crash in concurrent disconnect
This does not fix all data races that we have in the system yet.
One major issue is the virtual disconnectNotify(), that can be
called from any thread and thus is inherently problematic, as it
can collide with the object getting destroyed at the same time
in another thread.

Pick-to: 6.2 6.1 5.15
Task-number: QTBUG-88248
Change-Id: I9d841eb363b7e4f0de1657aeb8f5340d0fd55190
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-06-17 08:56:22 +02:00
Allan Sandfeld Jensen
93cd9130d6 Introduce float QImage formats and rendering
Useful for some HDR representations and HDR rendering.

Change-Id: If6e8a661faa3d2afdf17b6ed4d8ff5c5b2aeb30e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-05-26 18:00:01 +02:00
Assam Boudjelthia
23780891a5 Add tests for QAndroidApplication's sdkVersion and activity
While at it, move tst_android under corelib/platform/android.

Change-Id: Icf91cd75cb5e04d03fe6a81d52fba52a485ca41f
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-05-13 01:41:36 +03:00
Ivan Solovev
1a65a4faf5 QObject: port to new property system
Extended QObjectPrivate::ExtraData to store a pointer
to its parent, and reimplemented qGetBindingStorage()
function for QObjectPrivate::ExtraData.
This allows to use Q_OBJECT_COMPAT_PROPERTY macro
for a property, stored in QObjectPrivate::ExtraData
and solves all the problems with calling a custom
setter.

Task-number: QTBUG-85520
Change-Id: I40e01c29430846359ef9160fa1ae97c702be9a18
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2021-04-21 15:34:28 +02:00
Joerg Bornemann
d437a0bfca Remove Qt dependency from some test helper executables
pro2cmake did not take into account the
   QT -= qt
bit of the .pro files.

Fixes: QTBUG-91676
Change-Id: If1373ee966312e4246490bd7389d75be9fa739cb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-15 20:38:44 +02:00
Eirik Aavitsland
f4d791b330 Avoid processing-intensive painting of high number of tiny dashes
When stroking a dashed path, an unnecessary amount of processing would
be spent if there is a huge number of dashes visible, e.g. because of
scaling. Since the dashes are too small to be indivdually visible
anyway, just replace with a semi-transparent solid line for such
cases.

Pick-to: 6.1 6.0 5.15
Change-Id: I9e9f7861257ad5bce46a0cf113d1a9d7824911e6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-04-14 13:52:37 +02:00
Heikki Halmet
409443a376 Extend blacklisting of tst_gestures including all RHEL's
These are also failing in RHEL 8.2

Task-number: QTBUG-52523
Change-Id: I1448124376a2b415351d1a755043431050808e38
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
2021-04-13 08:20:48 +03:00
Volker Hilsheimer
83d4ca3f66 Remove QEXPECT_FAIL from passing test
The test is blacklisted in dev and 6.1, let it fail properly. We can
watch the history of the test and remove the blacklisting if/when it
passes consistently on supported macOS versions.

Pick-to: 6.1
Task-number: QTBUG-20984
Change-Id: I3211ecf565995578c83a092c637890c0e8bfd766
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-03-31 10:20:07 +02:00
hjk
8403fc7796 Make it even more obvious on what to do when tst_toolsupport fails
Triggered by 6778b247.

Pick-to: 6.0 6.1 5.15
Change-Id: Ic8e7136cd82eb8d3891450cfa8994f43b7cc09fc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-22 09:56:51 +01:00
hjk
8b5561c7ee Tests: Clarify the course of actions when touching tst_toolsupport
Change-Id: Ifc9caa8f1b05cd642c1bb57b0f37866de97ca2c2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-03-19 13:07:03 +01:00
Eskil Abrahamsen Blomfeldt
d860aaa200 Disable two tests in tst_QAccessibility on Wayland
These two tests (applicationTest() and mainWindowTest())
require QApplication::setActiveWindow() to work, which it
does not on Wayland.

Task-number: QTBUG-91418
Change-Id: I0e7b4e24050684b437de63d19bd885bab53d36b9
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2021-03-18 07:58:42 +01:00
Samuli Piippo
0ce443691f Move QEMU emulation detector to QTest
The emulation detection has been usable only on qtbase tests, move it to
QTest so that it can be used in other modules as well.

Pick-to: 6.1
Change-Id: I4b2321b7856414d7b1cfd5e6b1405a633c6bb878
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-02-13 10:02:51 +02:00
Volker Hilsheimer
85416ae6fd Split up the QMetaType unit test
gcc 9 consumed enourmous amounts of memory building the test, regularly
dying on a VM with 4GB RAM. Splitting it up helps.

As a drive-by, use inline static variables, and rename the header used by
other tests to tst_qmetatype_common.h.

Change-Id: Ib716d8e3506aac6c87845e57b04cb1a4f6c68387
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-02-09 14:27:20 +01:00
Tor Arne Vestbø
eab286b760 Blacklist tst_macgui::scrollBarPainting()
It fails on 10.15 and 11, preventing those from being significant,
and the test is already marked as expect-fail based on QTBUG-20984.

Task-number: QTBUG-20984
Change-Id: I6911166a1c3e9173d6d36f2a3a68b37778fd3406
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-02-08 11:29:37 +01:00
Jan Arve Sæther
f4887aca1e a11y: Report mixed state if QCheckBox is PartiallyChecked
Previously it only returned checked or unchecked for a tri-state
checkbox.

Fixes: QTBUG-84616
Pick-to: 5.15 6.0 6.1
Change-Id: Ife72098e35f8295fd389bda232de5478ffa7e87f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-02-04 13:23:33 +00:00
Eirik Aavitsland
167bcafcb6 Fix lancelot GL painting test for GLES
RGB10 internal texture format is not supported on GLES, use RGB10_A2
instead.

Pick-to: 6.0
Change-Id: Ib43eb99b170f441e886be50d29a6a5f7696c05c7
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-01-18 07:42:31 +01:00
Joerg Bornemann
04f11f9935 Remove .prev_CMakeLists.txt files
Those serve no purpose anymore, now that the .pro files are gone.

Task-number: QTBUG-88742
Change-Id: I39943327b8c9871785b58e9973e4e7602371793e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-01-12 20:59:13 +01:00
Joerg Bornemann
ad2da2d27a Remove the qmake project files
Remove the qmake project files for most of Qt.

Leave the qmake project files for examples, because we still test those
in the CI to ensure qmake does not regress.

Also leave the qmake project files for utils and other minor parts that
lack CMake project files.

Task-number: QTBUG-88742
Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-01-07 15:32:28 +01:00
Samuli Piippo
513be303b7 tst_toolsupport: fix expected alignment on ARMv7
The alignment has been recently updated but never correctly tested,
as test has either been disabled or marked as insignificant.

Change-Id: If6e529c290b2057f58c3b27c89279d9e90728ad4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-01-07 08:35:10 +02:00
David Skoland
27d96b4789 Replace QtTest headers with QTest
Complete search and replace of QtTest and QtTest/QtTest with QTest, as
QtTest includes the whole module. Replace all such instances with
correct header includes. See Jira task for more discussion.

Fixes: QTBUG-88831
Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44
Pick-to: 6.0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-12-22 15:20:30 +01:00
hjk
c6dde54e67 Check size of QObjectPrivate::ExtraData in tst_toolsupport.cpp
Change-Id: I96a5ec886fe862e0ee5d25120dda625478ecf420
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-12-18 13:12:28 +01:00
Friedemann Kleint
a46a723dba Tests: Fix building with qmake on Windows
Apparently some library definitions went overboard, link them directly.

Pick-to: 6.0
Change-Id: I009737f7e3edff5619241b700a627dc4e25e6018
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-12-17 13:02:15 +01:00
Alexandru Croitor
2304acab5f CMake: Regenerate projects using pro2cmake one last time
And fix up some wrong qmake project files

Pick-to: 6.0
Change-Id: I66cb82aeb9c1419a74df1a650fa78a511ade7443
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-12-10 11:52:30 +01:00
Liang Qi
4fc8a446fe tests: blacklist tst_NetworkSelfTest::smbServer() on openSUSE
Task-number: QTBUG-89209
Change-Id: I8d7d9bbf30a8f0654bc9aa84f7833c950e838b34
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2020-12-10 11:02:06 +01:00
Lars Knoll
de4a73ebd6 Inline access to the QBindingStorage
And inline the fast checks inside the methods in QBindingStorage.
This allows QObjectBindableProperty and friends to inline all the
fast checks and almost completely eliminates the overhead for property
accesses when no bindings are being used.

Read and write times of QObject based properties when no bindings
are being used:
                                              Read       Write
Old style property:                           3.8ns       7.3ns
QObjectBindableProperty (no notification):    4.5ns       4.3ns
QObjectBindableProperty (with signal):        4.5ns       7.6ns
QObjectBindableProperty (inline accessors):   3.2ns       3.4ns

Numbers without this patch:

Old style property:                           3.8ns       7.9ns
QObjectBindableProperty (no notification):    7.2ns       7.7ns
QObjectBindableProperty (with signal):        7.2ns      16.0ns
QObjectBindableProperty (inline accessors):   6.3ns       6.7ns

Change-Id: Ifd1fa3a489c3be8b1468c0b88af547aac397f412
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 98c82fb445acf45cc4c4bc86a5adda43358127bf)
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-11-30 23:02:27 +00:00
Assam Boudjelthia
97b914b3e7 Android: fix tst_android test
Fixes: QTBUG-88506
Pick-to: 6.0
Change-Id: I938de388fce8ec393b03b2f0f42ddfe9094e6a5e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-25 21:08:10 +00:00
Timur Pocheptsov
4f6c5d83d0 Network self-test: make it work with docker/containers
Fixes: QTBUG-87740
Pick-to: 5.15
Change-Id: Idfe73708784774188afd40048f81406aa720a554
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-11-17 19:56:06 +01:00
Tony Sarajärvi
c9420aeeff Conditionally disable tests that depend on cxx11_future flag
Task-number: QTBUG-88392
Change-Id: Ic8451ca4052ec4a94f0d78307e1b32965eb18c4e
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-11-17 05:21:06 +00:00
Assam Boudjelthia
8904c50d6f Android: exclude failing test tst_android:assetsRead
Task-number: QTBUG-87025
Task-number: QTBUG-88506
Change-Id: I11137fadd1455ae782af5ada1c6d88d65050440d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-16 13:35:48 +02:00
Assam Boudjelthia
039d3fe4e8 Android: blacklist a list of failing tests for android
We want to re-enable Android tests in QTQAINFRA-3867. However,
many tests are failing already preventing that from happening.
QTBUG-87025 is currently keeping track (links) to all of those
failing tests.

The current proposal is to hide those failing tests, and enable
Android test running in COIN for other tests. After, that try
to fix them one by one, and at the same time we can make sure
no more failing tests go unnoticed.

Task-number: QTBUG-87025
Change-Id: Ic1fe9fdd167cbcfd99efce9a09c69c344a36bbe4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-04 12:27:49 +02:00
Mårten Nordheim
ec258b8291 QSsl: Further work around to pass network test
Our tls certificate/key are a bit on the old side and need to be
updated. But for now let's lower the openssl level. In this case openssl
complains about the server's key used for DHE being too short.

Task-number: QTBUG-86187
Change-Id: I142a7d52f7599f60b8f4f3ff3ac5ce61fed06b4c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-10-26 09:30:36 +02:00
Volker Hilsheimer
1c76aa077e Get rid of all usage of QApplication:desktop
Use QScreen APIs instead.

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

Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-10-07 23:02:47 +02:00
Allan Sandfeld Jensen
c3cd760303 Remove compiler test
Outdated test for old buggy compilers

Change-Id: I605a2318a21121bde9a80c046a7beb6edcd2d546
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-02 22:13:18 +00:00
Alexandru Croitor
403213240c CMake: Regenerate projects to use new qt_internal_ API
Modify special case locations to use the new API as well.
Clean up some stale .prev files that are not needed anymore.
Clean up some project files that are not used anymore.

Task-number: QTBUG-86815
Change-Id: I9947da921f98686023c6bb053dfcc101851276b5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-09-23 16:59:06 +02:00
Edward Welbourne
533df067e9 Purge Q_{STDLIB,COMPILER}_UNICODE_STRINGS
These were now always defined, hence redundant.
Leave the #define in place so that we can verify we actually do always
define it, in a #else of an existing #if check on it.

Change-Id: Iea4c3dbc8f9982268bcf81da5ef17fe2ebf5c462
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-14 09:47:51 +02:00
Lars Knoll
2c698a6d07 Fix compiler warnings about missing overrides
Change-Id: I52bf9fe45607f4a99cafa441bd78dfe5f7adb0e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-09-13 21:03:31 +02:00
Lars Knoll
0078391c18 Fix warnings coming from using the deprecated overload of qCheckSum
Change-Id: I719c2d56a690fd245d3917045de4005f118c688b
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-09-11 19:32:34 +02:00
Lars Knoll
6ae7a02104 Remove most compiler warnings about missing overrides
Remove around 1000 compiler warnings about missing overrides
in our auto tests.

This significantly reduce the compiler warning noise in our auto
tests, so that one can actually better see the real problems
inbetween.

Change-Id: Id0c04dba43fcaf55d8cd2b5c6697358857c31bf9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-09-11 00:20:47 +02:00
Morten Johan Sørvig
b3c991ae8f Port from devicePixelRatioF() to devicePixelRatio()
This ports all of QtBase.

Change-Id: If6712da44d7749b97b74f4614a04fac360f69d9e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-09-10 17:28:11 +02:00
Joerg Bornemann
067fb7915a pro2cmake: Fix qmake parser's line continuation handling
The qmake parser of pro2cmake handles completely commented lines to make
assignments like this work:

    SUBDIRS = \
       foo \
    #  bar \
       bar

However, assignments like

    SUBDIRS = \
       foo \
       #bar \
       bar

were cut off at the commented line.

Fix this by allowing leading whitespace for "fully commented lines".

Change-Id: Ib5de850a02fd9b9ebb7c056c2f64f9d684334b08
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-09-02 23:44:15 +02:00
Lars Knoll
6778b247a8 Add a QBindingStorage class
QBindingStorage is a class that can store a set of binding objects
for the properties of a QObject. This will get used to reduce the
memory overhead of the property system when adding bindable properties
to QObject based classes.

The binding storage has a pointer to the TLS entry containing the
currently evaluating binding. Like that we avoid repeated TLS
lookups and reduce the overhead of the property system to one
pointer lookup and one compare for the case that properties
aren't being used.

Each QObject now owns one binding storage object, that can be used to
store binding data for properties that members of the QObject.

Change-Id: I27427c03c2ba281f072e074be96147bdbcaac246
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-09-02 22:44:28 +02:00
Giuseppe D'Angelo
c1454d07cf Take the right lock before using a connection's receiver
When a signal/slot connection is activated, a lock on the receiver
object is taken (to be sure it doesn't get destroyed).
The path for blocking queued connections however took the lock on
the sender by accident, fix that.

Pick-to: 5.15 5.12
Change-Id: I8cd938a50eca2bf71e7bfb86768ee0c8431afdfa
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-09-01 02:48:40 +02:00
Tor Arne Vestbø
70def4341a Avoid inifinite recursion call in tst_Compiler::cxx11_noexcept
warning: all paths through this function will call itself [-Winfinite-recursion]

Change-Id: I70008710a7448ffd532bb6c3acb488fe439cb807
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-28 09:43:14 +00:00
Jonas Karlsson
3558704ed5 Use OpenType font weights
Task-number: QTBUG-42248
Change-Id: Icdb301b27d6699c2b842c4563fbef9df73c23cbc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-08-28 07:26:54 +02:00
Volker Hilsheimer
fab8933d5b Don't skip QFileDialog retranslatability test on macOS
The test explicitly asks for a non-native file dialog, which works on
macOS as well.

Change-Id: I964c6d98501b4207c2b6c2ce1df39f654c801a43
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-26 03:45:30 +02:00
Volker Hilsheimer
872e37b2ff Implement QAbstractFileIconProvider to use theme and mime databases
This doesn't give useful defaults on all platforms; icon themes are not
provided on platforms other than Linux, and the mime database doesn't
always return user-friendly names based on file names.

However, both icon themes and the mime database can be customized by
application developers by shipping a data file side-by-side with the
application, without the need for reimplementing the provider class.

Change-Id: Ie4b18ac1b861e2da64f01d1f209986b27fbe6bd5
Task-number: QTBUG-66177
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-08-26 01:13:19 +02:00
Alex Trotsenko
556a7e7318 QIODevicePrivate: rearrange class members
As this class is a subject of the library hook data, there must be a
solid understanding of the member's alignment and padding across
different architectures. By reordering the layout, this patch provides
a clearer way of adding new members to the class.

Bump the TypeInformationVersion field in qtHookData, to notify the
Qt Creator developers that the offset of QFilePrivate::fileName was
changed and dumpers should be adapted.

Change-Id: Ied8b69bdeb9da50ff05aba2107bc75509674b18e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-24 14:50:56 +03:00
Lars Knoll
1697fbdf05 Deprecate the static int based API in QMetaType
And remove one of the type id to name mapping that still
existed in QMetaType. QMetaTypeInterface can provide that,
so there's no need to have a second copy of the data.

qMetaTypeTypeInternal() can still map all the names of all
builtin types to ids. That functionality is for now still
required by moc and can't be removed yet.

Change-Id: Ib4f8e9c71e1e7d99d52da9e44477c9a1f1805e57
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-08-24 00:19:05 +02:00
Lars Knoll
0daa9dbfc4 Generate less code when creating QMetaTypeInterfaces
There is no need to generate wrapper functions for equals,
lessThan or debugStream for pointer types, as those can
easily be handled by a few lines of code in QMetaType itself.

Change-Id: If79b3bc3a629249c1d17c9e592202f08b59f80ef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-08-24 00:17:04 +02:00