summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* rhi: metal: Add support for tessellationLaszlo Agocs2022-09-0127-11/+355
| | | | | Change-Id: Ie8d226a6a959aa5e78284ea72505fd26aec1e671 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QAnyStringView: construct from any T implicitly convertible to ↵Marc Mutz2022-09-011-0/+10
| | | | | | | | | | | | | | | | | | | | | 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>
* Move qVersion() from qglobal.h to qlibraryinfo.hSona Kurazyan2022-09-014-0/+4
| | | | | | | | | | | | | | | 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>
* Move QMacAutoReleasePool from qglobal.h to qcore_mac_p.hSona Kurazyan2022-09-0110-0/+19
| | | | | | | | 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>
* RCC: fix zlib compression when --no-zstd was specifiedThiago Macieira2022-08-311-1/+11
| | | | | | | | | | | | | 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>
* QSslCertificate::toText(): add a file to compare againstTimur Pocheptsov2022-08-315-150/+9
| | | | | | | | | | | | | 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>
* tst_QSslCertificate::pkcs12 - skip the test if OpenSSL version >= 3Timur Pocheptsov2022-08-311-0/+5
| | | | | | | | | | 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>
* CMake: Fix tst_qlibrary to work on macOS with debug buildsAlexandru Croitor2022-08-312-20/+40
| | | | | | | | | | | | | | | | 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 f8c1909320313c8a9c03661d8fe77728bde6556a Amends 1dff26dd9539feb40767b7761c5339085ad74dbf Change-Id: I20361c33c4a1b9dd4b5273fcdb8cc79c9f266327 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* tst_QDtls::verifyClientCertficiate - update certs for OpenSSL v3Timur Pocheptsov2022-08-312-88/+84
| | | | | | | | | | 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>
* QMetaObject: add a new, variadic invoke/invokeMethod/newInstanceThiago Macieira2022-08-303-24/+631
| | | | | | | | | | | | | | | | | [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>
* Blacklist: tst_QGraphicsAnchorLayout::layoutDirection for Ubuntu 22.04Heikki Halmet2022-08-311-0/+1
| | | | | | | Task-number: QTBUG-87728 Pick-to: 6.4 6.3 6.2 Change-Id: Ic78a17146c265ffe6baf6f08a0f9c29750bd0d58 Reviewed-by: Liang Qi <liang.qi@qt.io>
* a11y: Don't reassign unique ID to other object right awayMichael Weghorn2022-08-301-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* tst_qguiapplication: guard the usage of deprecated signalsIvan Solovev2022-08-302-3/+10
| | | | | | | | | | | | | | | | 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 68ea9c022701359b447be076888331a4f9d9085b Task-number: QTBUG-104858 Change-Id: Idb2da6d91afcdb664f325f23ec625947c9a7fac0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Rest of QtBase tests: port away from deprecated methodsIvan Solovev2022-08-304-24/+14
| | | | | | | | | | 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>
* tst_qobject: port away from deprecated methodsIvan Solovev2022-08-302-29/+17
| | | | | | | | | | | | | | | | | | | | | | 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>
* tst_qvariant: port away from deprecated methodsIvan Solovev2022-08-302-152/+184
| | | | | | | | | | | | | | 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>
* tst_qmetatype: port away from deprecated callsIvan Solovev2022-08-304-156/+304
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Adapt tests/auto/wasm for batchingMikolaj Boc2022-08-301-1/+0
| | | | | | | Use consistent defines across both tests in the directory Change-Id: Idd84603135c8c164d09ae41d5faa7ca3a5fc7c3c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* tst_qlibrary.cpp: remove extraneous _data functionThiago Macieira2022-08-301-7/+1
| | | | | | | The test function itself is MIA. Change-Id: Ie4bb662dcb274440ab8bfffd170a06fde5c1cd51 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QVariant: fix conversions of string keys to Q_ENUM that are QFlags<>Thiago Macieira2022-08-301-0/+5
| | | | | | | | | | | | | 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>
* QHttp2Configuration: in QNAM, use old, higher values in flow controlTimur Pocheptsov2022-08-301-0/+7
| | | | | | | | | | | | | | | | | | | | | 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>
* Add QComHelper class for dealing with COM on WindowsTor Arne Vestbø2022-08-292-13/+6
| | | | | | | | | | | | | | | 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>
* tst_QMap: avoid tripping MSVC debug-mode iterator assertionsThiago Macieira2022-08-281-1/+6
| | | | | | | | | 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>
* Deprecate QApplication::setActiveWindow() and mark as internalTor Arne Vestbø2022-08-2779-309/+426
| | | | | | | | | | | | | | 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>
* a11y: Prevent one case of losing a11y interface when setting event childMichael Weghorn2022-08-271-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 9a369a25ddfac9352cabde65c8476c7433dc6c3a 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>
* tst_qscopedpointer: port away from deprecated APIsIvan Solovev2022-08-271-20/+48
| | | | | | | | | | | | | | | | | 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>
* tst_qmap: port away from deprecated APIsIvan Solovev2022-08-271-70/+110
| | | | | | | | | | | | | | 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>
* tst_qstring: port away from deprecated APIsIvan Solovev2022-08-272-14/+29
| | | | | | | | | | | | | | * 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>
* Replace logging category lcQpaDockWidgets in dock widget auto testAxel Spoerl2022-08-261-41/+37
| | | | | | | | | | | | 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>
* QMetaObject: fix the consistency check for forward-declared builtinsThiago Macieira2022-08-263-0/+55
| | | | | | | | | | | 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>
* tst_QDir_10000: add sorted_byName benchmarkMarc Mutz2022-08-261-0/+9
| | | | | | Pick-to: 6.4 6.3 6.2 Change-Id: Ic30a6353c356f6613f2ef3720b99ebb3b0a7968e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add QDockWidget save & restore auto testAxel Spoerl2022-08-261-0/+160
| | | | | | | | | | | | | | | | 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>
* Port tests away from using q{Set}GlobalQHashSeedIvan Solovev2022-08-268-13/+38
| | | | | | | | 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>
* tst_qdtls: guard usage of the deprecated enum valuesIvan Solovev2022-08-261-1/+9
| | | | | | | | 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>
* Change the license of CMakeLists.txt file to BSDLucie Gérard2022-08-261-1/+1
| | | | | | | | This amends commit 32df595275f5d50ab4458620808f80121bb9c6a0 Task-number: QTBUG-105718 Change-Id: Ie3cadac4e424bfc26f3223dcee45491e3d6bd7e0 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* QAbstractItemDelegate: tolerate that editor gets reparentedVolker Hilsheimer2022-08-251-0/+70
| | | | | | | | | | | | | | | | | | | 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 d0dffdfc012574da4a75241097b667d09bb39ba2, 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>
* Wayland: Skip test that queries window positionEskil Abrahamsen Blomfeldt2022-08-251-2/+3
| | | | | | | | | | 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>
* QtBase tests: remove QT_DISABLE_DEPRECATED_UP_TO definesIvan Solovev2022-08-2416-30/+0
| | | | | | | | | 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>
* DBus tests: port away from deprecated APIsIvan Solovev2022-08-245-38/+38
| | | | | | | | | | 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>
* tst_qshortcut: port away from deprecated APIsIvan Solovev2022-08-241-37/+37
| | | | | | | | | | 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>
* tst_qmessagebox: port away from deprecated methodsIvan Solovev2022-08-241-12/+14
| | | | | | | | | | * 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>
* wasm: add manual auto-test for websockify-tunneled socketsMorten Sørvig2022-08-243-0/+404
| | | | | | | | | 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>
* wasm: add echo_server test TCP serverMorten Sørvig2022-08-242-0/+141
| | | | | | | | Test server for in-browser TCP usage. Pick-to: 6.4 Change-Id: Ia1a29c0e14a6d2ee8075ce202c9f6998a3ccc4c9 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Resolve window focusing problems on WASMMikolaj Boc2022-08-241-32/+13
| | | | | | | | | | | | - 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>
* Make QHeaderView restore state from different stream versionsAxel Spoerl2022-08-241-0/+42
| | | | | | | | | | | | | | | | | | | 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>
* tests: Fix tst_qprinterinfo for CUPS printer instancesMichael Weghorn2022-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Change the license of all CMakeLists.txt and *.cmake files to BSDLucie Gérard2022-08-231179-1179/+1179
| | | | | | | 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>
* Revert Q_DECLARE_EXPORTED_LOGGING_CATEGORY in tst_qdockwidgetAxel Spoerl2022-08-231-0/+6
| | | | | | | | 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>
* tst_qgraphicswidget: Avoid redeclaration of Size from MacTypes.hTor Arne Vestbø2022-08-211-29/+29
| | | | | | | | | 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>
* Don't access QObjectPrivate::declarativeData unguardedVolker Hilsheimer2022-08-201-0/+77
| | | | | | | | | | | | | | | | | | | | | 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>