summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* QFlags: add test(Any)Flag(s)Giuseppe D'Angelo2021-05-151-0/+58
| | | | | | | | | | | | | | | QFlags was lacking a named function for testing whether a QFlags object contains _any_ of the bits set by a given enumerator/other QFlags. Drive-by, add testFlags taking a QFlags, not just an object of the enumeration; and simplify the implementation of testFlags to more closely follow what its documentation says it does. [ChangeLog][QtCore][QFlags] The testFlags, testAnyFlag and testAnyFlags functions have been added. Change-Id: Ie8688c8b0dd393d34d32bc7786cdcee3eba24d1c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add tests for QAndroidApplication's sdkVersion and activityAssam Boudjelthia2021-05-137-6/+129
| | | | | | | While at it, move tst_android under corelib/platform/android. Change-Id: Icf91cd75cb5e04d03fe6a81d52fba52a485ca41f Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Rejig native interface plumbingTor Arne Vestbø2021-05-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The initial approach for providing public access to native interfaces via T::nativeInteface<I>() was based on the template not being defined, and then having explicit instantiations of the supported types in a source file, so that the accessors were exported and available to the user. This worked fine for "simple" types such as QOpenGLContext and QOffscreenSurface, but presented a problem in the context of classes with subclasses, such as Q{Core,Gui}Application. To ensure that a native interface for QCoreApplication was accessible both from QCoreApplication and its subclasses, while at the same time preventing a native interface for QGuiApplication to be accessible for QCoreApplication, the nativeInterface() template function had to be declared in each subclass. Which in turn meant specializing each native interface once for each subclass it was available in. This quickly became tedious to manage, and the requirements for exposing a new native interface wasn't very clear with all these template specializations and explicit instantiations spread around. To improve on this situation, while also squashing a few other birds at the same time, we change the approach to use type erasure. The definition of T::nativeInteface<I>() is now inline, passing on the requested interface to a per type (T, not I) helper function, with the interface type flattened to a std::type_info. The type_info requested by the user is then compared to the available types in a single per-type (T) "switch statement", which is a lot easier to follow for someone trying to trace the logic of how a native interface is resolved. We can safely rely on type_info being stable between the user application and the Qt library as a result of exporting the type info for each native interface, by explicitly ensuring they have a key function. This is the same mechanism that ensures we can safely dynamic_cast these interfaces, even across library boundaries. The use of a free standing templated helper function instead of a member function in the type T, is to avoid shadowing issues, and to not pollute the class namespace of T with the helper function. Since we are already changing the plumbing for how a user resolves a native interface for a type T, we take the opportunity to add a few extra safeguards to the machinery. First, we add a static assert in the T::nativeInteface<I>() definition, that ensures that only compatible interfaces, as declared by the interface themselves, are allowed. This ensures a compile time error when an incompatible interface is requested, which improves on the link time errors we had prior to this patch, and also offsets the one downside of type erasure, namely that errors are only caught at runtime. Secondly, each interface meant for public consumption through T::nativeInteface<I>() is declared with a revision, which is checked when requesting the interface. This allows us to bump the revision when we make breaking changes to the interface that would have otherwise been binary incompatible. Since the user will never see this interface due to the revision check, they will not end up calling methods that have been removed or renamed. One advantage of moving to a type-erased approach for the plumbing is that we're not longer exposing the native interface types as part of the T::nativeInteface symbols. This means that if we ever want to rename a native interface, the only exported symbol that the user code relies on is the type info. Renaming is then possible by just exporting the type info for the old interface, but leaving it empty. Since no class in Qt implements the old native interface, the user will just get a nullptr back, similarly to bumping the revision of an interface. Change-Id: Ie50d8fb536aafe2836370caacb22afbcfaf1712a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QPropertyBinding: Do not reevaluate if not installed on propertyFabian Kosmale2021-05-121-0/+27
| | | | | | | | | | | | | | | | | | | | | | Since we changed binding evaluation to be always eager, we notify and evaluate all bindings as soon as any dependency changes. This includes bindings which have been initially installed on a property, but which were later removed. With lazy evaluation, we would only notify those bindings and mark them as dirty, which is unproblematic. With eager evalution, we attempt to evaluate the binding, though. While that part is still fine, afterwards we would attempt to write the new value into the property. However, there is no property at that point, as the binding is not installed. Instead of adding a check whether the propertydataptr is null, we skip the reevaluation completely by removing the bindings observers - and thus the cause for the binding function's reevaluation. As soon as the binding is set, we reevaluate the function anyway, at which point we also capture the observers again. Task-number: QTBUG-89505 Change-Id: Ie1885ccd8be519fb96f6fde658275810b54f445a Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Blacklist tst_qnetworkreply::ioHttpRedirectMultipartPost on LinuxAllan Sandfeld Jensen2021-05-121-2/+1
| | | | | | | | | | Already blacklisted on the other linux versions, but is failing on SLES now in 5.15 Pick-to: 6.1 5.15 Change-Id: I267908adf94ede51e5520aa2cb806b394fb0438e Reviewed-by: Tarja Sundqvist <tarja.sundqvist@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QProperty: Cleanup QPropertyAlias leftoversFabian Kosmale2021-05-111-84/+0
| | | | | | | | | | | | | | | This removes traces of QPropertyAlias which is internal API which is a) not really working even before this change (no compatibility with QBindableInterface due to QPropertyAlias not being derived from QUntypedPropertyData) b) not used anywhere For BIC reasons, we need to keep some methods still around until Qt 7, though. Change-Id: I5bb4735a4c88cba275dc2cc6e29a46ca09622059 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* QSFPM: make filterRegularExpression and filterCaseSensitivity bindableIvan Solovev2021-05-112-0/+99
| | | | | | | | | | | | | | | | | This takes care of the last two QSFPM properties. They were postponed because of the tricky relation between them and some bugs in handling the changes. The bug was fixed in bcbbbdb2d640c059c19e9337c7418b83b1b7e4ea and now the behavior is well-determined: updating filter regexp does trigger case sensitivity change and vice versa. However updating only regexp pattern (via QString overload or setFilterFixedString or setFilterWildcard) does not change case sensitivity. Task-number: QTBUG-85520 Change-Id: Idc41cf817de9e6263ed65a80fa40fc8415c8c856 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QSortFilterProxyModel: port to new property systemIvan Solovev2021-05-113-3/+78
| | | | | | | | | | filterRegularExpression and filterCaseSensitivity will be handled in a separate commit Task-number: QTBUG-85520 Change-Id: I848c5c6cbe8642efa156f4f5d33467976bbf0351 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
* Fix QStandardItemModel signals on takeChildLuca Beldi2021-05-111-1/+48
| | | | | | | | | | takeItem and takeChild do not signal the change correctly to the external world, this change fixes the problem Fixes: QTBUG-89145 Pick-to: 6.1 5.15 Change-Id: Ib4844ace53007068a2cd62eba64df99e6e45fdc0 Reviewed-by: David Faure <david.faure@kdab.com>
* Do not remove non-widget items when removeWidget() called with nullptrPiotr Srebrny2021-05-111-0/+24
| | | | | | | | | | | child->widget() returns null if the layout item is not a widget. Thus, calling removeWidget(nullptr) will remove all non-widget items such as layouts or strechers. Change-Id: I772c1158d0f7e8e2850b6e571b0405a2896f09b8 Pick-to: 6.0 6.1 5.15 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: David Faure <david.faure@kdab.com>
* CMake: Resurrect test_import_plugins cmake build testsAlexandru Croitor2021-05-1117-59/+194
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we run tests for static Qt builds in the CI, it makes sense to restore the CMake build tests that check that static plugin importing works correctly. Resurrect the previously commented out test_import_plugins project and port the mockplugins qmake projects to CMake. mockplugins is a CMake project that uses the internal Qt CMake API to build and install some Qt modules and plugins. test_import_plugins depends on that test (via a CMake fixture) to build public projects that use those plugins. The installation of the mockplugins modules pollutes the Qt install prefix, but in the CI that only happens on the test VM, which means the release packages are not affected. Locally on a developer machine the Qt install path will be polluted, but it's not that much of a big deal. We could try and address that in a future change by using the QT_ADDITIONAL_PACKAGES_PREFIX_PATH functionality added for Conan to allow the installation of Qt packages into a non-standard prefix. Task-number: QTBUG-87580 Task-number: QTBUG-92933 Change-Id: I0841064a60a5ffba5118640d3197527a38ba6c30 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Skip building CMake build tests in a prefix in-tree configAlexandru Croitor2021-05-111-0/+16
| | | | | | | | | | | | The Qt CMake packages are not installed yet, so the CMake build projects can't find Qt and fail to configure. Skip the CMake build tests in a prefix in-tree configuration and issue a warning for informational purposes. Change-Id: Ie5cb5b9f6f1d8ec258b70528680e31c711c20f85 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Check scrollbar visibility when computing QListView marginsChen Bin2021-05-111-0/+54
| | | | | | | | | | | | | | | | | When the listview setWordWrap is true and ScrollBarPolicy is ScrollBarAsNeeded, if the text needs a newline display and the vbar is not shown, the width of the item was subtracted from the width of the scrollbar. In most cases, the listview needs to reserve the size of the scrollbar. But if the flow is TopToBottom and the vertical scrollbar is not visible, the width of the vertical scrollbar cannot be reserved. Fixes: QTBUG-92366 Pick-to: 5.15 6.0 6.1 Change-Id: I73cce691099a253d409019dbb3fe9a16e1830bb1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix QSaveFile and QTemporaryFile issues with windows network sharesKarsten Heimrich2021-05-114-1/+28
| | | | | | | | | | | | | | | | | | | The commit amends commit 3966b571 to take UNC prefix into account as well. Fixes the weird file name output as reported in QTBUG-74291 and QTBUG-83365. Replace manual separator normalizing in qt_cleanPath(), this is another spot where UNC prefix handling needs to be applied. Also make QTemporaryFile operate on '/' as file separators to fix creating both file types with native path separators on network shares. Fixes: QTBUG-74291 Fixes: QTBUG-76228 Fixes: QTBUG-83365 Pick-to: 5.15 6.0 6.1 Change-Id: Iff8d26b994bf4194c074cd5c996cda3934297fa5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QtX11Extras into QtGui as private APITor Arne Vestbø2021-05-104-0/+401
| | | | | | | | | | | from qt/qtx11extras 0e67fb41cfc4b4bfbaa7dc75f8ddebdf5a08e836. The plan is to expose these as native interfaces, so this is a first step. Task-number: QTBUG-83251 Change-Id: Iecba8db9a4f616a08a3750ddaae08cc30ec66f89 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Allow background inheritance between non-body block elementsAllan Sandfeld Jensen2021-05-081-1/+27
| | | | | | | | | | | Most nested block elements are merged together, so while we shouldn't do real inheritance we need to do it when block elements are combined. Pick-to: 6.1 Fixes: QTBUG-91236 Change-Id: I9e37b15f705db92c79a620d0d772f25d0ee72b8d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QMetaMethod: Store method constness in metaobject systemFabian Kosmale2021-05-071-2/+23
| | | | | | | | | [ChangeLog][QtCore][QMetaMethod] It is now possible to query the constness of a method with QMetaMethod::isConst. Change-Id: I8a94480b8074ef5b30555aeccd64937c4c6d97d4 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* tst_qlibrary: don't use absolute paths for symlinksSamuli Piippo2021-05-072-5/+5
| | | | | | | | The libs and symlinks are in the same directory, no need to have absolute paths. Change-Id: I22dab933b1f3bdf244b0953c6bb7caaeedef5697 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QTabBar: take a style sheet's font into account when laying out tabsVolker Hilsheimer2021-05-061-0/+67
| | | | | | | | | | | | | | If a tab has a font assigned to it through a style sheet, then take the font size into account when calculating the contents rectangle. Add a test, which hardcodes the windows style to avoid flaky behavior when e.g. macOS lays tabs out in the center. Fixes: QTBUG-92988 Pick-to: 6.1 Change-Id: Ifb0ac97db7647cc25367972737be8878e50f6040 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QMdiArea: Fix top level window title when using ↵Friedemann Kleint2021-05-061-1/+42
| | | | | | | | | | | | | | DontMaximizeSubWindowOnActivation When trying to find the original window title, check for another maximized sub window and use its title. Protect the calls to setWindowTitle to prevent the original title from being cleared. Pick-to: 6.1 5.15 Fixes: QTBUG-92240 Change-Id: I55175382ab261b4cf8b5528304adaaec4fbe2c31 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* tst_moc: Use qtpaths instead of qmakeFabian Kosmale2021-05-051-2/+2
| | | | | | | | | We only need to the location of certain paths for the test. For that, qtpaths is sufficient. Change-Id: I5af0d56b548629edc48949150ed8fbd408b617a6 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Remove Qt6 switches from QtGuiAllan Sandfeld Jensen2021-05-052-8/+0
| | | | | | | Removing now dead code Change-Id: I021539da6517fdb8443f8ae9431fc172b7910cfc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Write out the HTML correctly for nested listsAndy Shaw2021-05-051-0/+58
| | | | | | | | | | | | | | When we are having nested lists then we need to ensure that the HTML is outputted correctly so that the closing list and item tags are placed in the right order. [ChangeLog][QtGui][QTextDocument] The output of toHtml() now handles nested lists correctly. Fixes: QTBUG-88374 Pick-to: 6.1 5.15 Change-Id: I88afba0f897aeef78d4835a3124097fe6fd4d55e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Unit test for checking text-decoration in html exportOliver Eftevaag2021-05-051-0/+57
| | | | | | | | | | | This unit test is related to the parent commit. Html export used to omit the text-decoration for the default font, this unit test ensures that this property is added to the exported html. Fixes: QTBUG-91171 Change-Id: Ib68bec27f9963cdcac5c553b2c07557717b1c22e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Export text-decorationAllan Sandfeld Jensen2021-05-051-2/+2
| | | | | | | | | It used to be ignored because we couldn't disable it, but that works fine now. So re-enable it. Fixes: QTBUG-91171 Change-Id: I4cf966211bb200b73326e90fc7e4c4d3d4090511 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix assertion on matchingLocales(Abhkazian, Any, Any)Edward Welbourne2021-05-051-1/+7
| | | | | | | | | CLDR v39 has no locales for Abkhazian, so the locale_index[] entry for it actually indexes the last entry before the next language up the enum. This has m_language_id less than Abkhazian. Change-Id: If8b88f30476a981b3ee00ff8760a46ede0b7aab7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix set*Field JNI template callsAssam Boudjelthia2021-05-052-0/+164
| | | | | | | | | | | The calls were trying to pass a JNIEnv* from a QJniEnvironment using conversion operator which was removed, and weren't detected since they are templates and were missing tests. This fix that and add test cases for setField() and setStaticField() calls. Pick-to: 6.1 Change-Id: I6e1e6b7f557bbc664248ad364c48d63f58b70756 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add new app permissions API under QCoreApplicationAssam Boudjelthia2021-05-051-2/+2
| | | | | | | | | | | | | | | | | | | | | The API allows users to request and check the status of various permissions. A predefined enum class of the common permission types on different platforms is used to allow requesting permission with a common code. Platform specific permissions are defined only on their relevant platform. For permissions that are not predefined, they can be requested via a string variant of this API. This adds the Android implementation only. [ChangeLog][QtCore] Add new API for handling app permissions with an initial implementation for Android. Task-number: QTBUG-90498 Change-Id: I3bc98c6ab2dceeea3ee8edec20a332ed8f56ad4f Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QAbstractProxyModel: port to new property systemIvan Solovev2021-05-042-2/+33
| | | | | | | | | | | | | | The biggest trick here is the getter (QAbstractProxyModel::sourceModel), which is returning nullptr, while internally using a global staticEmptyModel() instance. This lead to inconsistency while binding to a proxy model without source model. The bound object would point to staticEmptyModel() instance, while sourceModel() getter returns nullptr. To solve this issue a custom QBindableInterface is implemented. Task-number: QTBUG-85520 Change-Id: I597df891c7e425d51b55f50ccbacabdfe935cbac Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Blacklist and skip failing tests on macOS ARMTor Arne Vestbø2021-05-043-0/+7
| | | | | | Task-number: QTQAINFRA-4431 Change-Id: I4ae47bb461634d524995077501b54322f6beccf3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* tst_moc: fix returning-reference-to-local warningMårten Nordheim2021-05-041-2/+2
| | | | | | | | | | | Although the code is never executed compilers still throw a warning because it's compiled. Amends 12b8283f899ebcf401d974927314b9531334a56e Pick-to: 5.15 6.1 Change-Id: Ib790d4bcb33c4b9f2a55a784b852275b59debde9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Test at some Android DPIs in additionMorten Johan Sørvig2021-05-041-4/+9
| | | | | | | | | | | | | Currently, we test at 1x, 2x, and mixed typical desktop DPI values. Add android DPI values, with scale factors in the 2.5 - 3.75 range. This test currently uses 96 as the base DPI (and so does the Android platform plugin), so we normalize the values to use that base DPI. Change-Id: I25b66f5e16d37c01758d5623b805e4141247a74a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove setting of Qt 5 high-dpi attributesMorten Johan Sørvig2021-05-041-10/+0
| | | | | | | This test is for Qt 6 now. Change-Id: I839c2733d505cb4119b1fe3ad85d3c8d94a6c964 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Ensure setDateTime clears status also when shortEdward Welbourne2021-05-041-0/+7
| | | | | | | | | | | Previously, if multiplication overflowed when trying to set the date and time of a formerly short-form QDateTime, its status didn't get set to reflect the failed validity check. Added a test that now correctly detects that it's produced an invalid date-time on overflow, where previously it produced a wrong valid date-time. Change-Id: Id46ca34d1e32e9b9b0630f3723cefd1c13b5761e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Moc: parse trailing return typeMårten Nordheim2021-05-044-0/+180
| | | | | | | Pick-to: 5.15 6.1 Fixes: QTBUG-71123 Change-Id: I1c3749f0892fddcc433c9afcb1d6d7c30c97c9d9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_QProcess: increase wait time and remove ill-advised QCOMPAREThiago Macieira2021-05-031-2/+1
| | | | | | | The QCOMPARE made dead code of a more verbose QVERIFY2 below Change-Id: I26b8286f61534f88b649fffd166b67d8603280a7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Q(Untyped)Bindable: Print warnings when operations failFabian Kosmale2021-05-031-0/+22
| | | | | | | | | Instead of silently failing, we now print an explanatory warning to aid with debugging. Task-number: QTBUG-89512 Change-Id: I36dd2ce452af12d0523c19286919095e366bd390 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QJniObject: add callStatic[Object]Method overloads for jmethodIDIvan Solovev2021-05-031-0/+167
| | | | | | | | | | | | This patch extends the QJniObject::callStatic[Object]Method functions with the overload which accepts a jmethodID parameter. This can be convenient when the method id is already cached and you do not want to query the method by its name and signature. Task-number: QTBUG-92952 Change-Id: Ib0852a5a27da2a244ac63112784751ef9e32cfa5 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QJniEnvironment: extend APIIvan Solovev2021-05-032-0/+74
| | | | | | | | | | | | | | This patch adds some convenience methods to QJniEnvironment API: * an overload of registerNativeMethods() that accepts jclass instead of const char *className. * a findMethod() function is added to query a methodID of a static or nonstatic method by its name and signature. Task-number: QTBUG-92952 Change-Id: Ib1bc892decea97e625c4822888b6183af6edd6dc Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QSqlTableModel::orderByClause(): Quote the table nameFriedemann Kleint2021-05-031-24/+26
| | | | | | | | | | | This ensures correct handling of names with special characters. Pick-to: 5.15 6.1 Fixes: QTBUG-92584 Change-Id: I95c7c54d9c7ee00b221a55f3d07ef1ec3a3bd217 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Extend QT_SCREEN_SCALE_FACTORS testMorten Johan Sørvig2021-05-031-14/+39
| | | | | | | | | Test the name=factor format and various incorrect spec strings. We expect that the screen DPI is used if the scale factor specification is incorrect. Change-Id: Ia990e70cf71e370dd2bb4b1047a101dfe9e59cb0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Port QVariantAnimation to the new property systemSona Kurazyan2021-04-302-0/+31
| | | | | | | | | | | | | | Skipped startValue/endValue properties, since they are computed and writable, which is not supported at the moment. Skipped currentValue, since its setter might be called inside the getter, which is not recommended. Task-number: QTBUG-85520 Change-Id: I1f872b4fcc7227ed91b6915891bbc66019151826 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QSFPM: fix filterCaseSensitivityChanged signal emission logicIvan Solovev2021-04-301-0/+19
| | | | | | | | | | | | | | | | | | This patch amends bcbbbdb2d640c059c19e9337c7418b83b1b7e4ea. It fixes the logic of filterCaseSensitivityChanged signal emission. The call to QRegularExpression overload of setFilterRegularExpression could change the filterCaseSensitivity, but the signal was never emitted. [ChangeLog][QtCore][QSortFilterProxyModel] A call to QRegularExpression overload of setFilterRegularExpression now emits a filterCaseSensitivityChanged signal, if required. Pick-to: 6.0 Pick-to: 6.1 Change-Id: Id4ef04227c1f8ed98153fa5107ec3fbe4c0c77fb Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Let the h2 test server both send and receive DATA framesMårten Nordheim2021-04-302-6/+17
| | | | | | | | | And use this in the authenticationRequired test. Pick-to: 6.1 6.0 5.15 Change-Id: I18e991eb67168214c2c4f829afaca5018568e989 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* uic/Python: Add comments for mypy to ignore star importsFriedemann Kleint2021-04-291-3/+3
| | | | | | | | | | Amends 2f975b39a967cd2ac1c234a200eb6b9c11d8b5b2. Pick-to: 6.1 5.15 Fixes: PYSIDE-1404 Change-Id: I534d78bdf44eb02bf80831a3d6c1d080a4e08698 Reviewed-by: Christian Tismer <tismer@stackless.com> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* Revert "Add grabber context pointers"Shawn Rutledge2021-04-292-2/+2
| | | | | | | | | | | This reverts commit 40330b8f0a717098982d1f54f34a18a8262b1f55. It was a bad idea to use QFlatMap here, because it is a sorted map, but we need to keep the passive grabbers in the same order as the grabs happened. So need to go back to an earlier version of the patch that uses two parallel QLists. Pick-to: 6.1 Change-Id: I9e6013c2565986fe1eb9fd754f8259766f83bee5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use a more forgiving threshold for qFuzzyIsNull(qfloat16)Edward Welbourne2021-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analysis of problems with the new test for qFuzzyIsNull() revealed that, where its version for double uses approximately 4500 * epsilon and for float used 84 * epsilon as threshold, the qfloat16 version's value was barely more than epsilon, with the result that the test had to use a different value than the threshold to pass. (Converting the threshold from float to qfloat16 and back made it bigger; in effect, the threshold value was not <= itself.) Furthermore, comparison with qFuzzyCompare() implied a value of 1/102.5 should be used, roughly 10 * epsilon, for consistency. When 1/102.5 is rounded to three significant digits (the precision we use in QTest::toString(), for example), to give 0.00976f as threshold, we get a value that, after conversion to qfloat16 and back to float, does give a result <= what we started with. So change qFuzzyIsNull() and its test to use this as qfloat16's threshold value. [ChangeLog][QtCore][QFloat16] The qfloat16 threshold value for qFuzzyIsNull() has changed from 1e-3 to 9.76e-3, almost a factor of ten increase, for consistency with qFuzzyCompare()'s tolerance. Values between these would previously have had qFuzzyIsNull(f) false despite qFuzzyCompre(f, 1+f) being true. Change-Id: I35816dce78da34a3e2339c8bc42d5bd03714a3f6 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add tests for qFuzzyIsNull() to tst_QNumeric and tst_QFloat16Edward Welbourne2021-04-293-2/+69
| | | | | | | | | | | | | They were missing. I also wanted to verify that it's true for sub-normal values. At the same time, relocate qfloat16's implementation of qFuzzyIsNull() to between those of qFuzzyCompare() and qIsNull(), since its apparent absence initially confused me. Change-Id: I9637c0070e754d16744c76fc9f846596257c6a63 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revert early return from QTimeZone on invalid IDEdward Welbourne2021-04-291-1/+1
| | | | | | | | | | | | | | This reverts commit ec8808c3020abbc436f1a2d90fecf3245fd6417b but retains its test, as the problem it fixed is now solved by having the TZ backend validate the ID it's passed, so that it now only accepts valid POSIX zone-descriptions and valid IANA IDs. The former were being excluded by this check. Amended a POSIX test to fail with the check in place; it passes now. Change-Id: I0d5e8c6e0a315ac2509f3d23bebb52aede8f79d0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Robert Löhning <robert.loehning@qt.io>
* HTTP/2 authentication requiredMårten Nordheim2021-04-293-0/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | With Qt 6 we made HTTP/2 default, which exposed missing handling of 401 Unauthorized (and 407 Proxy Authentication Required). In HTTP/1.* we would handle this after the response had finished, while handling the status code. For h2 this path isn't used since it is heavily reliant on the structure we have for HTTP/1.* (one request per channel). So we must handle the status code and header directly. Having that part fixed exposed another issue - when resetting/rewinding uploaded data we were not resetting the 'totallyUploadedData' counter in the reply (this, in turn, exposed another small issue). Because of that we did not actually send any data on the retry, only sending the content-length followed by no data. Finally, the small issue mentioned in the previous paragraph was how we check if we have uploaded all our data. It was only checking if the byte-device was atEnd(), which it was. But only because it had not yet prepared any data for us. Fixes: QTBUG-91284 Pick-to: 6.1 6.0 5.15 Change-Id: I798d105b02688b18a02897cc476f19f57a47f98f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>