Commit Graph

14245 Commits

Author SHA1 Message Date
Mårten Nordheim
28693abb64 tst_QSslSocket: regenerate certificate used for setLocalCertificateChain
The certificate was using SHA-1 for signing its certificate, which is
considered 'not good enough' by some TLS libraries.
Regenerate it with SHA-512 and a larger RSA key.

Also include the files needed to generate it.

Pick-to: 6.4 6.3 6.2 5.15
Task-number: QTBUG-106018
Task-number: QTBUG-95123
Change-Id: I535e047d540e663c8cec334695196044173949fc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-09-02 22:39:22 +02:00
Mikolaj Boc
8e307a6cf9 Don't batch qmetaobject_compat
Batching the tests leads to one of the tests tst_qmetaobject and
tst_qmetaobject_compat not being registered in the batch. Attempts to
batch those together fail as batch test name is defined per-source,
which, in this rare case, is the same across the two targets.

Change-Id: I356931feabc004c39ba0b6863b5f64e06d739a58
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-09-02 19:22:32 +00:00
Timur Pocheptsov
d2544b3bb2 tst_QSslSocket::protocolServerSide - make it work with OpenSSL v3
OpenSSL v3 by default sets SECLEVEL = 2 unless overridden in conf files.
SECLEVEL >= 1 means TLS <= 1.1 is disabled. Remove cases that were
previously expected to work. Arguably, we should not test deprecated
protocols at all, but the cases expecting a failure still work
and logically correct.

Task-number: QTBUG-95123
Task-number: QTBUG-106018
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: Ifa59fa902b433338dbed7abf086cfdef9470384c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-09-02 21:02:27 +02:00
Shawn Rutledge
ef9b51ce99 Use testlib for multiPointRawEventTranslationOnTouchScreen events
It was an old test written in a very low-level way, which perhaps is ok
to be independent of testlib in a few tests; OTOH, it was blacklisted
on a couple of platforms. Perhaps doing touch events the standard way
could be more stable.

While we're at it:
- verify that the touch events are accepted, and thus verify the new
  bool return value from commit()
- implement paintEvent() to help understand the layout, and touchpoint
  locations
- remove repeated QCOMPARE lines
- skip the test if window positioning fails
- try to un-blacklist it, on the assumption that window positioning
  failure was the reason

Task-number: QTBUG-87025
Task-number: QTBUG-104656
Pick-to: 6.4
Change-Id: Ie22eb24abf95cd849990a56212be87d06ce8e574
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
2022-09-02 19:07:21 +02:00
Thiago Macieira
0380dd5051 QMetaObject: pass the QMetaTypes in variadic invoke/newInstance
[ChangeLog][QtCore][Meta Object] QMetaMethod::invoke(),
QMetaObject::invokeMethod(), and QMetaObject::newInstance() are no
longer limited to 10 arguments.

[ChangeLog][QtCore][Meta Object] The use of the Q_ARG macro is no longer
necessary when using QMetaMethod::invoke(), QMetaObject::invokeMethod(),
and QMetaObject::newInstance(). Types may now be passed
directly. Similarly, Q_RETURN_ARG can be replaced by the free function
qReturnArg().

[ChangeLog][Potentially Source-Incompatible Changes]
QMetaMethod::invoke(), QMetaObject::invokeMethod(), and
QMetaObject::newInstance() no longer support passing forward-declared
types in the argument list (it was possible to pass them by
const-ref). From Qt 6.5 onwards, all types in the argument list must be
fully defined.

[ChangeLog][Potentially Source-Incompatible Changes] Attempting to use
the internal types QArgument, QReturnArgument, QGenericArgument, or
QGenericReturnArgument directly with QMetaMethod::invoke(),
QMetaObject::invokeMethod() or QMetaObject::newInstance() may fail to
compile. Those are internal types that were never meant to be used
directly and will be removed in Qt 7. If really necessary, ensure all
arguments passed to those functions are directly using those classes and
not mixed with Q_ARG and Q_RETURN_ARG. Implementations of bindings to
other languages should contact the Qt development mailing list to
discuss options.

Change-Id: I36b24183fbd041179f2ffffd1701e3e8e47e0fba
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-09-01 21:29:04 -03:00
Eirik Aavitsland
54aa7e75b8 QVariant: fix conversions of Q_ENUM that are QFlags<> to string
The doc of QMetaEnum::valueToKey() says to use ::valueToKeys() instead
for flag types.

Pick-to: 6.4
Change-Id: I48e5ba47324137f2ce2710f1d876e93e7c562e9f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-09-01 20:48:49 +02:00
Timur Pocheptsov
8e21844683 tst_QSslKey - make OpenSSL v3 detection fully runtime
Otherwise, checks are useles in non-developer build.

Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-106036
Change-Id: I41b6d8f250021ff9fa4981f9df9244c269ed2999
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-09-01 20:10:03 +02:00
Laszlo Agocs
c681c7c23f rhi: metal: Add support for tessellation
Change-Id: Ie8d226a6a959aa5e78284ea72505fd26aec1e671
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-09-01 19:44:19 +02:00
Marc Mutz
812a0d3125 QAnyStringView: construct from any T implicitly convertible to QString/QByteArray
This includes QDBusReply, QProperty, and QStringBuilder expressions.

The new constructor subsumes the QStringBuilder case without requiring
jumping though hoops to delay the definition of the ctor the way we
had to for the explicit QStringBuilder constructor, so remove the
explicit QStringBuilder one again.

[ChangeLog][QtCore][QAnyStringView] Can now be constructed from
anything that implicitly converts to either QString or QByteArray.

Fixes: QTBUG-105389
Change-Id: I0e584dd3e20d591381609a3329ef47cec7356ecc
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-09-01 15:51:48 +02:00
Sona Kurazyan
50b05e3e2a Move qVersion() from qglobal.h to qlibraryinfo.h
Since qVersion() might be called also from C code, disable the parts of
qlibraryinfo.h that are relevant only for C++ code if __cplusplus is not
defined.

[ChangeLog][Potentially Source-Incompatible Changes] qVersion() is
moved from qglobal.h to qlibraryinfo.h, '#include <QtCore/QLibraryInfo>'
needs to be added where it's used.

Task-number: QTBUG-99313
Change-Id: I3363ef3fa4073114e5151cb3a2a1e8282ad42a4d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-09-01 13:26:30 +02:00
Sona Kurazyan
b077c419ea Move QMacAutoReleasePool from qglobal.h to qcore_mac_p.h
And include qcore_mac_p.h where needed.

Task-number: QTBUG-99313
Change-Id: Idb1b005f1b5938e8cf329ae06ffaf0d249874db2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-09-01 13:26:30 +02:00
Thiago Macieira
f123212880 RCC: fix zlib compression when --no-zstd was specified
Since we had code to default to zstd as the default algorithm instead of
"Best", we ended up not compressing anything.

[ChangeLog][rcc] Fixed a bug that caused rcc not to compress files with
any compression algorithm if the --no-zstd option was present.

Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-106012
Change-Id: Ic6547f8247454b47baa8fffd170fddae429f82d2
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-08-31 16:55:00 -03:00
Timur Pocheptsov
0f2397f03d QSslCertificate::toText(): add a file to compare against
With OpenSSL 3.0.5 we see X509_print giving us the text representation
not matching any of previous ones - mostly a question of spaces
and formatting. Let's add a proper version to compare against and
remove useless 0.9.8, 1.0.0, 1.0.1, - we don't support them anymore
and thus QSslCertificate::toText() will never give a match.

Pick-to: 6.4 6.3 6.2 5.15
Task-number: QTBUG-106017
Change-Id: Ida11321c23e74c7313acc682237ab78408cf2803
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-08-31 21:55:00 +02:00
Timur Pocheptsov
0206eb137f tst_QSslCertificate::pkcs12 - skip the test if OpenSSL version >= 3
leaf.p12 is using RC2 for encryption and it's disabled by default
in openssl v3.

Pick-to: 6.4 6.3 6.2 5.15
Fixes: QTBUG-106017
Change-Id: I4edd0d29506d1e50b2b618b6a00cceeb4b156204
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-08-31 21:55:00 +02:00
Alexandru Croitor
cd4a3a1dc7 CMake: Fix tst_qlibrary to work on macOS with debug builds
The test expects the helper libraries to contain the .dylib suffix
rather than .so.

Replace glob copying of the libraries (which depends on the underlying
shell) with manual copy calls.
This also ensures the libraries don't contain a _debug postfix in the
file name even in a debug build, which would break the tests.

Amends f8c1909320
Amends 1dff26dd95

Change-Id: I20361c33c4a1b9dd4b5273fcdb8cc79c9f266327
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-31 14:12:00 +02:00
Timur Pocheptsov
267d923ed9 tst_QDtls::verifyClientCertficiate - update certs for OpenSSL v3
Because this version does not seem to like MD5 which old cert was using.

Fixes: QTBUG-106019
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: Id354d1e32acb0528685b2788ee9c7326c43397bd
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-31 13:29:11 +02:00
Thiago Macieira
fe92b08065 QMetaObject: add a new, variadic invoke/invokeMethod/newInstance
[ChangeLog][QtCore][Meta Objects] The QMetaObject::invokeMethod() taking
a method name by string, QMetaObject::newInstance(), and
QMetaMethod::invoke() now support more than 10 arguments.

[ChangeLog][QtCore][Meta Objects] The use of the Q_ARG and Q_RETURN_ARG
macros is now optional with QMetaObject::invokeMethod(),
QMetaObject::newInstance(), and QMetaMethod::invoke(): the type name
will be obtained from the C++ type (the same as QMetaType). The function
qReturnArg() can be used in place of the Q_RETURN_ARG macro. The macros
are still useful in rare conditions where the type was typedef'ed from
its original name.

Change-Id: I36b24183fbd041179f2ffffd17022a2b48c7639b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-30 22:29:07 -03:00
Heikki Halmet
191419e980 Blacklist: tst_QGraphicsAnchorLayout::layoutDirection for Ubuntu 22.04
Task-number: QTBUG-87728
Pick-to: 6.4 6.3 6.2
Change-Id: Ic78a17146c265ffe6baf6f08a0f9c29750bd0d58
Reviewed-by: Liang Qi <liang.qi@qt.io>
2022-08-31 00:39:25 +03:00
Michael Weghorn
8b947bae72 a11y: Don't reassign unique ID to other object right away
For the case that a newly created and registered accessible
interface gets removed again from the cache before another one
gets registered, the next registered interface was
previously assigned the same "unique ID" again, which e.g. breaks
assistive technology when using caching
with AT-SPI, since that relies on the assumption
that the ID is actually unique for each object.
(But here, the new object was using the same object path
as the old one, so data from the old object would be
used for the new one.)

To prevent that from happening, increment the
counter for the next ID to try at the end of
QAccessibleCache::acquireId, so the next time
the method gets called, it doesn't try again
whether the same ID as used previously is
available again.

For consistency, also rename the variable used
for the counter from lastUsedId to nextId.

This also adds a corresponding test case.

Fixes: QTBUG-105962
Pick-to: 6.4
Change-Id: Iddf4f3b35c57895bcfbb623a5377edf8344ab6c2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-30 22:53:09 +02:00
Ivan Solovev
56ec6a392a tst_qguiapplication: guard the usage of deprecated signals
The paletteChanged() and fontChanged() signals were deprecated
in Qt 6.0, but the test was still using them unconditionally.

This patch guards the usage of the deprecated signals with
the usual QT_DEPRECATED_SINCE(6, 0) check, so that the test
can be built and run with QT_DISABLE_DEPRECATED_UP_TO >= 0x060000

This commit amends 68ea9c0227

Task-number: QTBUG-104858
Change-Id: Idb2da6d91afcdb664f325f23ec625947c9a7fac0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-08-30 22:46:35 +02:00
Ivan Solovev
2e69ef6af9 Rest of QtBase tests: port away from deprecated methods
Small changes to fix builds with
QT_DISABLE_DEPRECATED_UP_TO >= 0x060500

Task-number: QTBUG-104858
Change-Id: Ia531a3cee97f13827e36b3d63f28eed879fe9a40
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-30 22:46:35 +02:00
Ivan Solovev
95542b386a tst_qobject: port away from deprecated methods
The patch includes the following replacements:
* QMetaType::type("name") -> QMetaType::fromType<Type>().id()
* QMetaProperty::type() -> QMetaProperty::typeId()
* QVariant::Type -> QMetaType::Type
* qRegisterMetaType<T>("name") -> qResigeterMetaType<T>()
* The static QMetaType::{load,save} methods are replaced with
  non-static versions
* Replace QCOMPARE(property.type(), QVariant::UserType) with
  QCOMPARE_GT(property.typeId(), QMetaType::User), because the
  deprecated type() method was treating each custom type
  (id >= QVariant::UserType) as QVariant::UserType, while the
  typeId() method simply returns the actual id.

As a drive-by: remove unneeded QMetaType registration tests
as we have tst_QMetaType to check it.

Task-number: QTBUG-104858
Change-Id: Ia08e002efdf07ff83366a5193164dba96a956f9a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-30 22:46:35 +02:00
Ivan Solovev
ad12d779cc tst_qvariant: port away from deprecated methods
The most common changes are:
* guard the tests for deprecated APIs with QT_DEPRECATED_SINCE
* QVariant(QVariant::Type) ctor -> QVariant(QMetaType) ctor
* QVariant::type() -> QVariant::typeId()
* QVariant::canConvert(int) -> QVariant::canConvert(QMetaType)
* QVariant::convert(int) -> QVariant::convert(QMetaType)
* QVariant::Type -> QMetaType::Type

Task-number: QTBUG-104858
Change-Id: I00584acb24d29b461faa1115f8f8d36a0b443883
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-30 22:46:34 +02:00
Ivan Solovev
91eec59b87 tst_qmetatype: port away from deprecated calls
The most common changes are:
* Replace QMetaType::type("name") with QMetaType::fromName("name").id()
  or QMetaType::fromType<Type>().id()
* QMetaType::typeName(int) -> QMetaType(int).name()
* QMetaType::typeFlags(int) -> QMetaType(int).flags()
* QMetaType::metaObjectForType(int) -> QMetaType(int).metaObject()
* The static QMetaType::{load,save} methods are replaced with
  non-static versions
* The static QMetaType::{create,destroy,construct, destruct} methods
  are guarded by QT_DEPRECATED_SINCE calls. The tests are also
  extended with non-static calls where they were missing. Fixed
  potential memory-leaks in these tests.

Add separate unit-tests for deprecated APIs and guard them with
QT_DEPRECATED_SINCE

As a drive-by: use nullptr instead of 0 in some places

Task-number: QTBUG-104858
Change-Id: I4b0cdd29bc197c186b835002372240aae3098c33
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-30 22:46:34 +02:00
Mikolaj Boc
337a853cb5 Adapt tests/auto/wasm for batching
Use consistent defines across both tests in the directory

Change-Id: Idd84603135c8c164d09ae41d5faa7ca3a5fc7c3c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-08-30 22:27:07 +02:00
Thiago Macieira
db64694b4c tst_qlibrary.cpp: remove extraneous _data function
The test function itself is MIA.

Change-Id: Ie4bb662dcb274440ab8bfffd170a06fde5c1cd51
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-08-30 15:56:46 -03:00
Thiago Macieira
98e21f0979 QVariant: fix conversions of string keys to Q_ENUM that are QFlags<>
Since Qt 6.0, QMetaType stores the name obtained from the C++ compiler,
which means we know a type like Qt::Alignment by its proper, full name
of QFlags<Qt::AlignmentFlag>. However, the meta object records only the
bare name of the enumeration, not the full flags.

Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-105932
Fixes: QTBUG-96185
Change-Id: Ic6547f8247454b47baa8fffd170eab977e306377
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-30 18:56:46 +00:00
Timur Pocheptsov
9540a4eb90 QHttp2Configuration: in QNAM, use old, higher values in flow control
Initially, stream receive window's size was quite significant.
At some point when dealing with a server that did not want
our windows' sizes and was closing the connection (they only
accept 64K) we reduced this size, which ended in a regression
with download speed significantly throttled. We return the old
values (or even more, presuming we have 10 multiplexed streams
and not 100). And also making QNAM consistent with its documentation
(it was not updated).

[ChangeLog][QtNetwork] Stream receive window that HTTP/2 protocol in QNAM is using
increased to 214748364 octets (from the previous 64K) not to throttle download
speed. Clients, working with servers, not accepting such parameters,
must set HTTP/2 configuration on their requests accordingly.

Fixes: QTBUG-105043
Pick-to: 6.4 6.3 6.2
Change-Id: I252b6b5eefe92a7304dad15c67928d5a57d9597f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-08-30 20:20:38 +02:00
Tor Arne Vestbø
1bc7e9e77b Add QComHelper class for dealing with COM on Windows
Unifies our approach to calling CoInitializeEx and CoUninitialize,
removing a lot of boilerplate in the process, and also fixes a few
bugs where we would incorrectly balance our calls to CoInitializeEx
and CoUninitialize.

The optimistic approach of qfilesystemengine_win.cpp of calling
CoCreateInstance without initializing the COM library explicitly
has been removed, as calling CoInitializeEx should be a noop in
the situation where it's already been loaded.

Change-Id: I9e2ec101678c2ebb9946504b5e8034e58f1bb56a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2022-08-29 15:39:34 +02:00
Thiago Macieira
f039147165 tst_QMap: avoid tripping MSVC debug-mode iterator assertions
It does a check to ensure you aren't comparing outside the container.

Fixes: QTBUG-106001
Pick-to: 6.2 6.3 6.4
Change-Id: Ic6547f8247454b47baa8fffd170eef346b7f4f24
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-08-28 11:04:14 -03:00
Tor Arne Vestbø
2436e259ce Deprecate QApplication::setActiveWindow() and mark as internal
The function is used the internal window activation machinery and
should not be called by user code.

Many tests still use this function, and should be ported over to
QWidget::activateWindow(). For now they are using the private
helper in QApplicationPrivate, so that we can progress with the
public API deprecation.

Change-Id: I29f1575acf9efdcbae4c005ee9b2eb1bb0c8e5b5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-27 20:22:29 +02:00
Michael Weghorn
0c0eadc484 a11y: Prevent one case of losing a11y interface when setting event child
9a369a25dd added a
QAccessibleEvent ctor that takes a QAccessibleInterface*
instead of a QObject*.

Retrieving the QAccessibleInterface* later is done using the
interface's unique ID stored in the m_uniqueId member.

However, the fact that m_uniqueId is a member
of the union alongside with m_child means that setting
a child via QAccessibleEvent::setChild also overwrites
the stored unique ID, which breaks retrieving the accessible
interface later.

Fix this for the case where the QAccessibleInterface has
an associated QObject by assigning m_object in the ctor as well.
This means that a QAccessibleEvent created using either of the two
constructors (the one taking the QObject* and the one taking
the QAccessibleInterface* associated with the object) now behaves
the same.

Fixing the case where there is no associated QObject would require
further changes (e.g. adding a member for the QAccessibleInterface*
or making the m_uniqueId member a separate member instead of having
it in a union with m_child). However, I see no way to do so without
breaking the ABI, so that is left unchanged.

This also adds a corresponding test case.

Fixes: QTBUG-105988
Pick-to: 6.4
Change-Id: I71a548af0277a5034e9e207f066fa3e25c5393f3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-27 03:38:16 +00:00
Ivan Solovev
88974b0a3e tst_qscopedpointer: port away from deprecated APIs
The QScopedPointer::take() call in comparison() test was used to
avoid a double-deletion error, because the test is creating two
QScopedPointer instances referencing the same memory.

Avoid the take() call by providing a custom DummyDeleter and
managing the memory by the extarnal std::unique_ptr.

As the test now has no test-cases for QScopedPointer::take()
calls, create a new test for this deprecated API, and guard
it with QT_DEPRECATED_SINCE checks.

Task-number: QTBUG-104858
Change-Id: Iecc28d44d76c9ce5835e6b1a1df7db30e2a9ca25
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-27 02:07:54 +02:00
Ivan Solovev
378e2e1064 tst_qmap: port away from deprecated APIs
The most common changes are:
* removing the explicit tests for deprecated APIs
* QMultiMap::insertMulti() -> QMultiMap::insert()
* QMultiMap::insert(QMultiMap) -> QMultiMap::unite(QMultiMap)

Add separate tests for the deprecated APIs, and guard them
with QT_DEPRECATED_SINCE() checks.

Task-number: QTBUG-104858
Change-Id: Ifb79212d07f20028d93d75f2b32ec3785cc93b22
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-27 02:07:54 +02:00
Ivan Solovev
aafd2c3fba tst_qstring: port away from deprecated APIs
* QVariant::Type -> QMetaType::Type.
* Guard the test for deprecated fromUtf16(const ushort *) overload with
  QT_DEPRECATED_SINCE check.
* Use fromUtf16(const char16_t *) overload in other places.

As a drive-by: fix formatting in the affected lines.

Task-number: QTBUG-104858
Change-Id: I9fa3a935bca36e97f934f673e2fc07b451c72872
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-27 02:07:54 +02:00
Axel Spoerl
b48364d49b Replace logging category lcQpaDockWidgets in dock widget auto test
Logging category lcQpaDockWidgets was used in both dock widget test
and implementation. This dual use caused static builds to fail.

This patch replaces lcQpaDockWidgets with a test specific logging
category in tst_QDockWidget.

Pick-to: 6.4 6.3 6.2
Change-Id: I02cdfdaee9c1c1840126d803139b3d271aeac236
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-26 22:27:50 +02:00
Thiago Macieira
7deb49d886 QMetaObject: fix the consistency check for forward-declared builtins
For those, moc does know their type ID, and yet they may be still
forward-declared in the C++ side, so the meta object may have recorded a
null pointer in the metatype array.

Fixes: QTBUG-105832
Change-Id: Ic6547f8247454b47baa8fffd170dae07c0813dc7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-26 19:50:48 +02:00
Marc Mutz
24675d1a94 tst_QDir_10000: add sorted_byName benchmark
Pick-to: 6.4 6.3 6.2
Change-Id: Ic30a6353c356f6613f2ef3720b99ebb3b0a7968e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-08-26 17:50:47 +00:00
Axel Spoerl
0c54ac20eb Add QDockWidget save & restore auto test
Implement auto test for (de)serialization of dock widget properties.
Test settings compatibility by importing a hard coded byte array.
Test serialization format and sequence by comparing expected and real
serialization output.
Test dock widget closing behavior (QTBUG-103474) to ensure that
no closing inconsistency is caused by serialization incompatibility.
Extensively document/comment the test to ensure failures can be easily
interpreted in the future.

Task-number: QTBUG-103474
Change-Id: I3c1589c2c291b2ed56334d09b85536d4c7388f92
Pick-to: 6.4 6.3 6.2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-26 17:08:04 +00:00
Ivan Solovev
b057e32dc4 Port tests away from using q{Set}GlobalQHashSeed
These functions are marked as deprecated in future Qt releases.

Task-number: QTBUG-104858
Change-Id: I25d2932455d8c9e3e2d722b1c48fc2cfa2d1e679
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-26 14:15:24 +02:00
Ivan Solovev
804172f23c tst_qdtls: guard usage of the deprecated enum values
Guard the test that checks the deprecated protocol versions

Task-number: QTBUG-104858
Change-Id: I1b76e08d8fc985abf758bf86198fe3d33e5497d4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-08-26 14:15:24 +02:00
Lucie Gérard
75d2f167f4 Change the license of CMakeLists.txt file to BSD
This amends commit 32df595275

Task-number: QTBUG-105718
Change-Id: Ie3cadac4e424bfc26f3223dcee45491e3d6bd7e0
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-26 11:33:16 +00:00
Volker Hilsheimer
52f4d0b0d2 QAbstractItemDelegate: tolerate that editor gets reparented
An item delegate might override destroyEditor to merely reparent the
existing editor out of the item view for later reuse, rather than
actually destroying the editor.

As of d0dffdfc01, the code calling
closeEditor() - which calls destroyEditor - might explicitly set focus
back to the item view parent of the editor. This needs to handle that
the parent of the editor might no longer be valid after the closeEditor
call returns, and rather store the old parent widget explicitly.

Add a test case that segfaults with nullptr access without the fix.

Fixes: QTBUG-105231
Pick-to: 6.4 6.3 6.2
Change-Id: I04a355673823c4941865f7a575864e991ceeb5f0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-08-25 18:04:19 +02:00
Eskil Abrahamsen Blomfeldt
e8031906b5 Wayland: Skip test that queries window position
The client does not know its global window position on Wayland,
so testing for this will not work.

Pick-to: 6.4
Fixes: QTBUG-100888
Change-Id: Ibdfc84f1b33d25223dbd740603ce4783c21afc70
Reviewed-by: Inho Lee <inho.lee@qt.io>
2022-08-25 18:04:19 +02:00
Ivan Solovev
c6c41cc1a9 QtBase tests: remove QT_DISABLE_DEPRECATED_UP_TO defines
The value will be propagated from Qt build.

Task-number: QTBUG-104858
Change-Id: Iae2c32c3037438f41b92f9ee28004f30eb4e3210
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-08-24 22:08:49 +02:00
Ivan Solovev
373c7fe17e DBus tests: port away from deprecated APIs
Replacing QVariant::Type with QMetaType::Type

Task-number: QTBUG-104858
Change-Id: If03e2ad72b46c33f68f4382c7ed5c5801d2e70b2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-24 22:08:49 +02:00
Ivan Solovev
e5c184ecd1 tst_qshortcut: port away from deprecated APIs
Explicitly call QKeycombination::toCombined() instead of deprecated
implicit operator int().

Task-number: QTBUG-104858
Pick-to: 6.4
Change-Id: I46b0863eda445e832a9490bc2a3d05811c2df8c6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-24 22:08:49 +02:00
Ivan Solovev
6180e496c2 tst_qmessagebox: port away from deprecated methods
* Wrap some tests that specifically test deprecated APIs
  into #ifdefery
* Refactor some tests to use available methods

Task-number: QTBUG-104858
Change-Id: I03e318004ce1c2718ee574bf11e00df9bc04bcaa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-24 22:08:48 +02:00
Morten Sørvig
953272eb45 wasm: add manual auto-test for websockify-tunneled sockets
Test TCP sockets usage on the main thread, on secondary threads,
and with asyncify.

Pick-to: 6.4
Change-Id: I466df8c253c6a18a9c12d44fa8f53e76f81a0437
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-08-24 21:12:00 +02:00
Morten Sørvig
a2d0ce32cd wasm: add echo_server test TCP server
Test server for in-browser TCP usage.

Pick-to: 6.4
Change-Id: Ia1a29c0e14a6d2ee8075ce202c9f6998a3ccc4c9
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2022-08-24 21:12:00 +02:00
Mikolaj Boc
11f12521bc Resolve window focusing problems on WASM
- Moved the modal window resolution to
QWasmWindow::requestActivateWindow so that multiple async activation
events are not issued in unpredictable patterns.
- Request activation on added windows and on stack top in case of
window removal

Pick-to: 6.4
Change-Id: I6f02cf1b7e83abb7961caf311ffc83e91c8bf810
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-08-24 17:50:25 +02:00
Axel Spoerl
854cb55987 Make QHeaderView restore state from different stream versions
If restoring a QHeaderView state from a data stream with version Qt_5_0,
check alignment and resize mode properites for out-of-bound values.

If out of bounds, try QDataStream version Qt_6_0, which is used by KDE
apps compiled with 5.15.2 or 6.2.3.

QFileDialog stores settings in the same settings file across different
Qt versions, using different QDataStream versions. That makes
QFileDialog vulnerable to the issue (QTBUG-104962). A respective auto
test is added with this patch.

Fixes: QTBUG-104962
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-104425
Change-Id: I666207fca7ab837ad27a247e504a40757ee8afab
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-24 14:08:18 +00:00
Michael Weghorn
1f35be2f38 tests: Fix tst_qprinterinfo for CUPS printer instances
CUPS has a feature called printer instances that allows saving
different sets of default options for a single print queue,
s. section "Creating Saved Options" at [1].

A printer instance can be set up using e.g.

    lpoptions -p printer/instance -o name=value

The printer instance is then listed with the print
queue name and the instance name separated by a slash
in the 'lpstat -e' output.
Qt also supports CUPS printer instances and displays
them using the same as printer names.

However, tst_QPrinterInfo::getPrintersFromSystem was
previously truncating the printer name at the slash,
so the comparison of printer names on a system that
has CUPS printer instances set up would fail e.g. as follows:

    ********* Start testing of tst_QPrinterInfo *********
    Config: Using QtTest library 6.5.0, Qt 6.5.0 (x86_64-little_endian-lp64 shared (dynamic) debug build; by GCC 12.1.0), debian unknown
    PASS   : tst_QPrinterInfo::initTestCase()
    QDEBUG : tst_QPrinterInfo::testForDefaultPrinter() Test believes Default Printer                              =  "PDF"
    QDEBUG : tst_QPrinterInfo::testForDefaultPrinter() QPrinterInfo::defaultPrinter() believes Default Printer    =  "PDF"
    QDEBUG : tst_QPrinterInfo::testForDefaultPrinter() QPrinterInfo::availablePrinters() believes Default Printer =  "PDF"
    PASS   : tst_QPrinterInfo::testForDefaultPrinter()
    QDEBUG : tst_QPrinterInfo::testForPrinters() Test believes Available Printers                              =  QList("Canon_MX390_series", "PDF", "PDF", "PDF-5cm-margins", "dummy", "dummy-ricoh-c3000", "tofile-hp-officejet-8600", "tofile-ricoh-aficio", "tofile-ricoh-mufu", "tofile-samsung-m2875", "tofile-test-tdf106963", "tofile-xerox-phaser-6510")
    QDEBUG : tst_QPrinterInfo::testForPrinters() QPrinterInfo::availablePrinters() believes Available Printers =  QList("Canon_MX390_series", "PDF", "PDF-5cm-margins", "PDF/myinstance", "dummy", "dummy-ricoh-c3000", "tofile-hp-officejet-8600", "tofile-ricoh-aficio", "tofile-ricoh-mufu", "tofile-samsung-m2875", "tofile-test-tdf106963", "tofile-xerox-phaser-6510")
    FAIL!  : tst_QPrinterInfo::testForPrinters() Compared values are not the same
       Actual   (qtPrinters.at(i))  : "PDF-5cm-margins"
       Expected (testPrinters.at(i)): "PDF"
       Loc: [/home/michi/development/git/qt5/qtbase/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp(232)]

Fix this by adding the slash character to the regex.

[1] https://www.cups.org/doc/options.html

Change-Id: Id0dc27a8b4c592847ed364cebf277e988039cad4
Reviewed-by: Albert Astals Cid <aacid@kde.org>
2022-08-24 14:20:14 +02:00
Lucie Gérard
32df595275 Change the license of all CMakeLists.txt and *.cmake files to BSD
Task-number: QTBUG-105718
Change-Id: I5d3ef70a31235868b9be6cb479b7621bf2a8ba39
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-23 23:58:42 +02:00
Axel Spoerl
7c61eb101d Revert Q_DECLARE_EXPORTED_LOGGING_CATEGORY in tst_qdockwidget
Q_DECLARE_EXPORTED_LOGGING_CATEGORY is available from 6.5 only, hence
cherrypicking this solution fails.

Change-Id: Ib3351a8846bb5cf6047cd2d13c9f7cd242df9c93
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-23 20:49:47 +02:00
Tor Arne Vestbø
1ecfc4101c tst_qgraphicswidget: Avoid redeclaration of Size from MacTypes.h
If an included header brings in MacTypes.h it will cause issues,
so rename the enum to be on the safe side.

Pick-to: 6.4 6.3 6.2
Change-Id: I29ec795be74a65d4f2267d8121a514bf192cf969
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-21 14:40:38 +02:00
Volker Hilsheimer
3be99799a6 Don't access QObjectPrivate::declarativeData unguarded
The QObjectPrivate::declarativeData member is stored in a union with
currentChildBeingDeleted. The QObject destructor always sets the
currentChildBeingDeleted member of the union. It also sets the
isDeletingChildren bool, which is the only way to find out which union
member we can safely access.

While the QObject destructor is deleting children and isDeletingChildren
is set, we must not access the declarativeData member of the union.

Add a test case that initializes the function pointers for the
declarative handlers and constructs a situation where an object
emits a signal while it is destroying children.

Fixes: QTBUG-105286
Pick-to: 6.4 6.3 6.3.2 6.2 5.15
Change-Id: Iea5ba2f7843b6926a8d157be166e6044d98d6c02
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-08-20 03:55:12 +02:00
Mårten Nordheim
50f8a9578d QSslServer: Re-enable read notifications when a client times out
Otherwise new clients will not be handled when they try to connect

Amends 29a1fe72a0

Pick-to: 6.4
Change-Id: Ifff052d1bf27682df2782faa285a257c9b41d86f
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-08-19 23:53:11 +02:00
Ivan Solovev
3226c82740 Rename QT_DISABLE_DEPRECATED_BEFORE -> QT_DISABLE_DEPRECATED_UP_TO
The new name describes the behavior in a better way.

[ChangeLog][Build System] The QT_DISABLE_DEPRECATED_BEFORE macro is
renamed to QT_DISABLE_DEPRECATED_UP_TO. The old name is deprecated, but
is still recognized if it is defined during configuration and the new
name is not defined.

Task-number: QTBUG-104944
Change-Id: Ifc34323e0bbd9e3dc2f86c3e80d4d0940ebccbb8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-08-19 23:52:05 +02:00
Tatiana Borisova
6a3509baa2 Put code related to timezone functionality under QT_CONFIG(timezone)
Pick-to: 6.4 6.3
Change-Id: I0d1573dbb4ae4f9740fc19546950ae4316aa4c0c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-08-18 18:05:09 +00:00
Assam Boudjelthia
78c8561658 Android: skip tst_qvulkan vulkan11() and vulkanWindowGrab()
This fails on Android 12 in CI.

Task-number: QTBUG-105739
Pick-to: 6.4 6.3 6.2
Change-Id: Ibf3deb6b84564f12b5172f2522875fe70f8ce87b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-08-18 10:52:14 +00:00
Assam Boudjelthia
0fb59d68f7 Android: skip tst_qopengl::fboRenderingRGB30()
This fails on Android 12 in CI.

Task-number: QTBUG-105738
Pick-to: 6.4 6.3 6.2
Change-Id: I94fcefae3d88087cd96f4043b015f9469ed629a9
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-08-18 10:52:10 +00:00
Assam Boudjelthia
d1e97ada4e Android: skip tst_QPluginLoader::loadSectionTableStrippedElf()
... on Android 7+ because Android linker doens't accept missing or
bad section headers.

* https://android.googlesource.com/platform/bionic/+/refs/heads/oreo-r2-
release/android-changes-for-ndk-developers.md#missing-section-headers-
enforced-for-api-level-24

Pick-to: 6.4 6.3 6.2
Task-number: QTQAINFRA-4748
Change-Id: I37fcf7995bbfe7d258b92f7425baf4722b0ad4ab
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-08-18 13:52:06 +03:00
Assam Boudjelthia
cf4f147c23 Android: tst_QByteArray::base64_2GiB() times out or gets terminated
Android kills this test case which tries to use too much memory,
or it times out.

Pick-to: 6.4 6.3 6.2
Task-number: QTQAINFRA-4748
Change-Id: Ifce92533d50f4c463ee10fe80e7654ad16172a35
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-08-18 13:52:02 +03:00
Assam Boudjelthia
7c917a6dbf Android: skip crahsing tst_QFile's unixPipe() and socketPair()
... on Android 12.

Task-number: QTBUG-105736
Pick-to: 6.4 6.3 6.2
Change-Id: I1a67ef34e2f3918d96bdcfdcde48c1c14fe01c2e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-08-18 13:51:58 +03:00
Assam Boudjelthia
2c6e71e562 Android: fix Android filedialog and completer tests
* https://developer.android.com/training/data-storage/use-cases#opt-out-
in-production-app

Pick-to: 6.4 6.3 6.2
Task-number: QTQAINFRA-4748
Change-Id: If6abb48b730b9b33807f5f6648e1360defc090a6
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-08-18 10:51:54 +00:00
JiDe Zhang
a6b55b3c46 Allow specify distance to plane for QTransform
The default camera to plane distance is 1024, when rotating a big image
along the x or y axis, some areas of the screen may move above the
camera, causing the rotation to fail. A new rotation interface has been
added to allow users to specify the distance from the camera to the
plane themselves when rotating the QImage. Also, this support has been
added to QMatrix4x4::projectedRotate.

[ChangeLog][QtGui][QTransform] Added overloads to rotate() and
rotateRadians() that allow specifying of the distance to the rotation
plane.

Fixes: QTBUG-105088
Change-Id: I81f629916ddd9b6ab84e0282191e4284a88a85f5
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-08-18 10:40:42 +08:00
Volker Hilsheimer
371214dea7 Remove network dependency for tests with UNC paths
Windows VMs are provisioned with shared folders that are available as

\\${COMPUTERNAME}\testshare(writable)

so we don't need to access a remote SMB server over network anymore just
to test whether our string-parsing code handles UNC paths correctly.

Add a QTest::uncServerName() helper function to the shared filesystem.h
header and use that instead of QtNetworkSettings::winServerName. The
latter is now only used in tst_NetworkSelfTest::smbServer().

Pick-to: 6.4
Change-Id: Id0da66369ad0f4a980d612de2a31a391f1192253
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-08-17 23:48:00 +02:00
Mårten Nordheim
1ee75e4740 QSslServer: Make sure maxPendingConnections applies to all sockets
Not just the ones we added to the pending sockets list

Pick-to: 6.4
Change-Id: I0a0016fe39df7ca2fc3f0c4e4111195bc6d90198
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-08-17 21:55:19 +02:00
Mårten Nordheim
29a1fe72a0 QSslServer: Implement handshake timeouts
If a client doesn't send any data then we would leave the socket open
for as long as it needed, wasting resources. Add timeouts to limit the
amount of time this can happen for.

Since there is a limit on number of sockets that the server will have
queued, having idle sockets stick around forever is a vector for ddos.

Pick-to: 6.4
Change-Id: Ida6251c92c625eeadf2065861b840b14255654b8
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-17 21:55:19 +02:00
Mårten Nordheim
1b68e0b717 QSslServer: Check that first byte is ClientHello
SecureTransport ignores any content that comes in until it is large
enough to be a handshake. So a plaintext client may be left hanging
while it is waiting for a response.

Pick-to: 6.4
Change-Id: I501ae61d89d516765c7ba5f0d916d9246fde5d4d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-08-17 19:55:18 +00:00
Alexandru Croitor
9e3e167223 CMake: Add simple widgets qmake iOS build test
Build a simple widgets qmake project when targeting iOS in the CI.
This ensure we don't introduce basic regressions in the .pri / .prl
file generation.

Make sure to target the ios simulator, so we don't require any
code signing or provisioning profiles.

Pick-to: 6.4
Fixes: QTBUG-96058
Change-Id: I1a5564e838a5ce3cac89a37a5a4ddee74d3400f3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-17 21:21:57 +02:00
Sona Kurazyan
e684c25b85 QDomDocument: deprecate old setContent() overloads in favor of new ones
And use the new overloads in examples and tests.

[ChangeLog][QtXml][QDomDocument] Deprecated the old setContent()
overloads in favor of the new ones that take ParseOptions and
ParseError.

Task-number: QTBUG-104507
Change-Id: I61b37eba2fe3002c03bddc90f6877676d539f7ec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-08-17 17:02:27 +02:00
Morten Sørvig
4d6decf628 wasm: always build asyncify tests for eventloop_auto
Add a runtime test for asyncify availability; skip tests
if asyncify is not available. Add new build target which
builds with asyncify enabled.

Change-Id: Idaeff0a24aa01525927b012af2a0ba135c7839c3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-17 04:52:46 +02:00
Morten Sørvig
ad0cb1f32d wasm: add "skip" support to qtwasmtestlib
We're not looking to skip faulty tests, but there are cases
where we would like to indicate that a test function exists
but can't run because some precondition is not met.

Pick-to: 6.4
Change-Id: Ifaaafcfa7a55beaaf56d8b25fabbe3dc2566350f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
2022-08-17 04:52:46 +02:00
Morten Sørvig
f347682fd5 wasm: include asyncify support unconditionally
Emscripten's option for enabling asyncify (-sASYNCIFY) is a link-time
option, which means there is no requirement to have a separate asyncify
build, at least for static builds.

Replace the current QT_HAVE_EMSCRIPTEN_ASYNCIFY compile-time option
with a run-time option which checks if the asyncify API is available.

Keep support for configuring with "-device-option QT_EMSCRIPTEN_ASYNCIFY=1"
for backwards compatibility and for the use case where want asyncify
support to be on by default for a given Qt build.

Enable asyncify for the asyncify_exec example.

Pick-to: 6.4
Change-Id: I301fd7e2d3c0367532c886f4e34b23e1093646ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-17 04:52:46 +02:00
Alexandru Croitor
cf3535fdf2 CMake: Add manual test for various iOS asset handling
Includes:
- setting a custom Info.plist
- Bundling non-image assets
- Bundling image assets using asset catalogs
- Bundling app icons
- Bundling a launch screen

Projects added for both qmake and CMake.
The executable uses testlib to check that non-image assets,
icons and asset catalogs were successfully bundled upon deployment
to a device.

Task-number: QTBUG-104519
Change-Id: Iaab6112e31e1098dcd2548e18b58bed5b64e6f83
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-08-17 01:05:45 +02:00
Dimitrios Apostolou
753c352af0 Unblacklist tests that are no longer flaky
Couldn't reproduce flakiness on OpenSUSE KDE/X11 and can't see any
history of flakiness in the last 3 months in our testresults database.

Task-number: QTBUG-62967
Task-number: QTBUG-63262
Change-Id: Id50291798eda922283e04b45205ae9105e9fdab2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-17 01:05:45 +02:00
Dimitrios Apostolou
7524a36a26 Stabilize test by not activating window
Window activation is not working reliably on X11 when combined with
X11BypassWindowManagerHint, see QXcbWindow::requestActivateWindow().

The test itself counts repaints, so qWaitForWindowExposed() shouldn't be
needed.

This way we don't need to QSKIP() the test if window activation fails.

Fixes: QTBUG-98921
Change-Id: I849b7261c757fb7cbcde73f11bbe1a74a862cb9c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-17 01:05:45 +02:00
Dimitrios Apostolou
74f3bc263a Update BLACKLIST for tst_qgraphicsview
Removed entries that do not reproduce on OpenSUSE and that are no
longer flaky in our CI according to our testresults statistics database.

Adjusted entry for resizeAnchor testcase which has been seen flaky in
RHEL-8.4 and cursor2 which is very flaky on macOS.

Task-number: QTBUG-105249
Task-number: QTBUG-105247
Change-Id: I3e258f81d6bbf540a4b3dec763fdfd4bdc511847
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-17 01:05:45 +02:00
Dimitrios Apostolou
228ee98025 Unblacklist tests that are no longer flaky
Can't reproduce in OpenSUSE, and no flakiness has been seen in the past
6 months in our testresults statistics database.

Task-number: QTBUG-63260
Change-Id: I465aa4b9f82726e9685f64b0dc235d3235c4bd9c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-17 01:05:44 +02:00
Dimitrios Apostolou
dff9fa2ee1 Fix testcase that fails when run individually
Executing the tst_qgraphicsitem::sorting() testcase individually always
fails on my KDE/X11 desktop. The window never seems to have focus and
the call to qWaitForWindowActive() returns error after a few seconds.

It seems qApp->setActiveWindow(&view) never succeeds in giving focus to
the window containing the widget.

Fixes: QTBUG-105221
Task-number: QTBUG-74760
Change-Id: I148dab09d0fb592376b3902e4ed10799f9a52274
Done-with: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2022-08-17 01:05:44 +02:00
Thiago Macieira
e163c49435 qdbusxml2cpp: remove the old "In"-for-signal compatibility code
This led to an infinite recursion in case the annotation was completely
missing. Instead of trying to fix that, I'm simply implementing the
"### Qt6" request from c62f717226 .

[ChangeLog][qdbusxml2cpp] Removed the old compatibility code that
accepted "In" annotations for signal argument names, introduced in Qt
5.8.

Pick-to: 6.4
Fixes: QTBUG-104722
Change-Id: Ie4bb662dcb274440ab8bfffd1709bfc3daf0846d
Reviewed-by: David Faure <david.faure@kdab.com>
2022-08-16 16:05:25 -07:00
Mikolaj Boc
1007964f2d Maintain the window z-order properly in wasm compositor
The old stack structure used to keep track of windows has been improved
to conform to the actual windowing assumptions: there shall be one root
window, which is always at the bottom. The first created window
immediately becomes the root window. Should the root window be removed,
all windows are non-root, i.e. any of them can become the top-level window

Fixes: QTBUG-105094
Pick-to: 6.4
Change-Id: Ic553244fa9f5bc3ee590b702935e66cfc62d5f8f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-08-16 16:08:38 +00:00
Laszlo Agocs
2de14b81a9 rhi: tst_qrhi: Check for OpenGL cap on the platform
Running tst_qrhi -platform eglfs will pass on RPi4 / Mesa 22.
This does not test Vulkan of course since the platform plugin cannot
create a Vulkan instance.

Running tst_qrhi -platform vkkhrdisplay will enable Vulkan but will
still try OpenGL since the autotest does not query the platform
integration about OpenGL support. Make this nicer by skipping most of
the GL test if the platform integration we have cannot handle OpenGL
stuff anyway.

For some tests the data-driven approach has to be removed since doing
QFETCH without any rows will crash. These two OpenGL-specific tests
now check OpenGL support directly and QSKIP if needed.

While we are at it, fix up the Vulkan instance API version as well.

Pick-to: 6.4
Change-Id: I2891c04540bc2dfd0ccf475629bd23542bff15f5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-08-16 16:00:15 +02:00
Edward Welbourne
0ed8987078 Update QTimeZone benchmark's list of tested zones
It purports to be a list of those named in QDateTime's tests, but was
a bit out of date. In the process, sort them into somewhat coherent
order (to make it easier to verify whether one is missing next time I
check) and reformat.

Pick-to: 6.4 6.3 6.2
Change-Id: I16e7ded6f8b00e226513bd06d6174a79f7a0c675
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-08-16 15:02:22 +02:00
Marc Mutz
b5d5385201 tst_qbytearray: remove qCompress_data for QT_NO_COMPRESS
The _data function is useless without its test function (and it's not
used in other _data functions).

Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I7aa6006ed1a9d89008577b750af4ea717dae237f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-08-15 23:02:32 +02:00
Eskil Abrahamsen Blomfeldt
360f1547f7 Fix QFontDatabase::hasFamily() for ambiguous families
If a font family has several instances from different foundries,
we disambiguate this by adding the foundry name in brackets behind
the family. But QFontDatabase::hasFamily() would only check for
families().contains(familyName). So if the database contains e.g.
Foo [Bar] and Foo [Baz] then a check for hasFamily("Foo") would
fail.

So we need to actually check for the family name instead. In
doing this, we also skip the extra step of building the list
and then searching it, but just go directly to the source.

This removes the BLACKLISTing of Ubuntu and also introduces a
QSKIP on Unix-based platforms without fontconfig, since there
is no way to know which default fonts are acceptable on those
platforms.

Pick-to: 6.4
Fixes: QTBUG-86967
Change-Id: Id8ad80a1671daf1c14fbad8bb8f4c51ee1c59709
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-15 18:23:43 +02:00
Laszlo Agocs
5eacc974c7 rhi: d3d11: Enable tessellation and geometry with some caveats
The caveat being having to manually create HLSL versions of the hull,
domain, and geometry shaders in parallel with the Vulkan GLSL ones,
while keeping the interfaces intact (stage inputs and outputs, cbuffer
layouts, binding points/registers). This is not always trivial but
typically doable in not very complicated case after inspecting the
SPIRV-Cross-generated vertex/fragment code in the .qsb files. Once
written, the HLSL files can be injected into a .qsb file with qsb -r.
or the corresponding CMake syntax. Conceptually this is no different
from how samplerExternalOES support is implemented for Multimedia.
(there the problem is that the shaders cannot be compiled to SPIR-V
to begin with, here it is that we cannot translate from SPIR-V, but
in the end the workaround for both problems is effectively the same)

The manual tests demonstrate this, both the tessellation and geometry
apps work now with D3D out of the box.

On the bright side, the implementation here in the the D3D backend of
QRhi does not need to know about how the shaders got there in the
QShader. So none of the implementation is dependent on this manual
process. If some day qsb would start translating to these kind of
shaders as well, it would all still work as-is.

Change-Id: I32d9ab94e00174e4bd5b59ac814dfedef9f93ad1
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2022-08-15 10:51:17 +02:00
Edward Welbourne
45cbb1e31e Fix DeferredFlag implementation for QTestEventLoop
As discovered in the expanded testing of QTRY_COMPARE() using the same
class, the timer needs a context object and a slot to call.
This amends commit 35ad157d88

Pick-to: 6.4 6.3
Task-number: QTBUG-104441
Change-Id: I41fc23de84ce8c7d6608db0005276a2071974494
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2022-08-12 20:32:30 +02:00
Edward Welbourne
54bcefb25c Test QTRY_COMPARE() and expand testing of QTRY_VERIFY*()
In the process, simplify the latter while adding some actual
time-variation for the QTRY_* loop to navigate round - based on the
extendedcompare test's ClassWithDeferredSetter. Testing remains
primitive, but is at least a bit more thorough.

Pick-to: 6.4
Change-Id: I40be8fb485f3f18f0a4f4bc62ad36cccac691979
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2022-08-12 20:32:30 +02:00
Edward Welbourne
f5840692b0 Remove the stale expected_crashes_[345].txt
These contain output only ever sent to stderr, which tst_selftests no
longer looks at; it merely verifies stderr is empty for all tests
except those expected to produce stderr output, and ignores the stderr
output for these last.

Change-Id: I50fee445d84c2d125e6db5303fc389e87746455e
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-12 20:32:30 +02:00
Thiago Macieira
6234182d82 QMetaType: don't use global relocations to the lambdas and structures
The way the Qt 6.0 QMetaTypeInterface was designed, using a static
inline variable in a template, would normally require the linker and
dynamic linker to merge all copies and choose a single copy as the
official one. But because of hidden visibility and of Windows DLLs,
QMetaType already copes with multiple copies NOT getting merged. So we
may as well ask the linkers not to bother and use simpler, local
relocations to find those symbols.

They are all supposed to still be equivalent and it's an ODR violation
if they're not.

The Apple ld64 linker complains if you use this type of global
relocation:

 ld: warning: direct access in function
  [...]
   to global weak symbol
   'QtPrivate::QMetaTypeInterfaceWrapper<int>::metaType'

Fixes: QTBUG-93471
Pick-to: 6.3 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16f98a10aa719434
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-08-12 11:32:29 -07:00
Thiago Macieira
985e24dd5f QMetaType: add a test to confirm that types are equal across libraries
Because of the template shenanigans. This is just to make sure.

Pick-to: 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16f989e7d555894f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-08-12 11:32:29 -07:00
Mikolaj Boc
f8e460b915 Use the local file APIs to save/load files on WASM
QFileDialog::saveFileContent, QFileDialog::getOpenFileContent are now
using local file APIs to access files on any browser that passes a
feature check.
The feature is thoroughly tested using sinon and a new mock library.

Task-number: QTBUG-99611
Change-Id: I3dd27a9d21eb143c71ea7db0563f70ac7db3a3ac
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-08-12 20:32:29 +02:00
Dimitrios Apostolou
d68da61564 Wait for window focus instead of expose event
This fixes the flakiness seen in OpenSUSE KDE/X11 desktop.

Fixes: QTBUG-70590
Task-number: QTBUG-105177
Change-Id: I7c2431e58b2a60ea04e26d4e70c0f2867d544ff2
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2022-08-11 19:09:09 +02:00
Dimitrios Apostolou
5b2b30a9c7 Try to stabilize window activation on macOS
Use activateWindow() that is documented as the right way to raise a window.

Task-number: COIN-892
Change-Id: Ic9aadee0d3a526fd8e46e5b1099b5b0861700207
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-08-10 21:44:40 +02:00
Dimitrios Apostolou
c1e8c99464 Test is stable on OpenSUSE, un-blacklist it
Task-number: QTBUG-74760
Change-Id: I78ca3779407d1076a11d0a948b61f4438d1ab4cc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-10 21:44:40 +02:00
Dimitrios Apostolou
1aff079db5 Test is no longer flaky, unblacklist it
I can't reproduce the test failing after hundreds of iterations on
OpenSUSE, and the test hasn't flaked at all in our CI in the last 6
months according to our dashboards.

Fixes: QTBUG-70612
Change-Id: I2397f3db5caf97f674de7d75fd99bd14c14166a4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-10 21:44:39 +02:00
Dimitrios Apostolou
6ee0c79352 Test is not flaky any longer
I can't reproduce the issue after hundreds of iterations on OpenSUSE,
and the test hasn't flaked at all in the last 3 months according to our
dashboards.

Task-number: QTBUG-66371
Change-Id: I9c4daf851e09fbcb47a6ab39418e7b213ccd9dfe
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-08-10 21:44:39 +02:00