summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* wasm: Improve wheel event handlingMorten Sørvig2022-05-241-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Always invert scroll deltas. This is what the code did before, expect for on non-Safari macOS. There is no need any "smart" code here: correct deltas are provided by the native API regardless of macOS scroll direction setting. Reading webkitDirectionInvertedFromDevice is still useful for certain use cases, such as 3D scene zooming or spinbox value change, where upwards motion on the trackpad should always correspond to "increment" regardless of scroll direction. Propagate this to Qt using one of the handleWheelEvent() overloads Finally, we were sending pixel deltas as angle deltas; fix by sending pixel deltas as well, but keep existing angle delta behavior for compatibility. Change-Id: I7a7104c30da057fefc0377816e551a9e7e2fa0e7 Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: David Skoland <david.skoland@qt.io>
* tst_QStringConverter: roll up independent tests to rows in othersThiago Macieira2022-05-231-59/+6
| | | | | | | | | Simplifies the test a little. Pick-to: 6.3 Change-Id: I77c8221eb2824c369feffffd16f0a7fc44215aaf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* tst_QStringConverter: implement the TODO of testing with flagsThiago Macieira2022-05-231-4/+81
| | | | | | Pick-to: 6.3 Change-Id: I77c8221eb2824c369feffffd16f0a7e428b23fb6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* tst_QStringConverter: improve the char-by-char UTF-8 testingThiago Macieira2022-05-233-63/+168
| | | | | | | | | | | | | | The utf8.txt file was only 21 bytes and contained exactly two non-ASCII characters. It wasn't very good. This commit brings back the UTF-8 test rows that existed before commit 18ec53156ee704fdb4977436fccfdc85333e614b deleted tst_Utf8. There's a lot of overlap with some of the other rows in this test, though. Pick-to: 6.2 6.3 Change-Id: I77c8221eb2824c369feffffd16f094619b69faef Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QStringConverter: use the QUtf8 codec when Windows is using UTF-8Thiago Macieira2022-05-231-14/+50
| | | | | | | | | | | | | | | | | | | | The QLocal8Bit implementation assumes that there's at most one continuation byte -- that is, that all codecs are either Single or Double Byte Character Sets (SBCS or DBCS). It appears to be the case for all Windows default codepages, except for CP_UTF8, which is an opt-in anyway. Instead of fixing our codec, let's just use the optimized UTF-8 implementation. [ChangeLog][Windows] Fixed support for using Qt applications with UTF-8 as the system codepage or by enabling that in the application's manifest. Discussed-on: https://lists.qt-project.org/pipermail/interest/2022-May/038241.html Pick-to: 6.2 6.3 Change-Id: I77c8221eb2824c369feffffd16f0912550a98049 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Network: update Public Suffix ListIvan Solovev2022-05-231-0/+0
| | | | | | | | | using the description from qtbase/src/network/kernel/qurltlds_p.h.INFO Task-number: QTBUG-103663 Change-Id: I543fa96d2538f5eb63b114fe6467fb5b0e891e3b Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix separate delete of window and windowcontainerAllan Sandfeld Jensen2022-05-231-2/+23
| | | | | | | | | | | | The documentation says we can change window parent to avoid the widget deleting the window. That didn't work as the widget didn't get the child-removed event as it wasn't the parent. This patch instead uses an event filter on the set parent. Pick-to: 6.3 6.2 Change-Id: I1f61d1832fcf3257722f305beeefd8f1abf1f656 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Android: Enable building of the QLocale test caseVolker Hilsheimer2022-05-231-4/+1
| | | | | | | | | | | Amends 2a893db48017a850044156442b93d935c78e941d, which changed the #ifdef'ery but didn't actually enable the building of the test on Android. Task-number: QTBUG-87414 Pick-to: 6.3 6.2 Change-Id: Id944dd3023da40ecbf4b8a324784409a63f94aec Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Compile-time generate a JNINativeMethod from a C functionVolker Hilsheimer2022-05-231-14/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a template function that allows us to get the method signature string from a free function, which are used as native callbacks methods from Java. Provide a macro that defines a signature object, and a JNINativeMethod object based on it, in an internal namespace so that we don't pollute the namespace with generated names. Add another macro to get the generated JNINativeMethod object based on the free function name. Lastly, add overloads to QJniEnvironment::registerNativeMethods that take a std::initializer_list of JNINativeMethods. We can now declare a free function to be a JNI native method: static bool callbackFromJava(JNIEnv *e, jobject /*thiz*/, jstring p1) { // ... } Q_JNI_DECLARE_NATIVE_METHOD(callbackFromJava); and register it with the JNI environment like this: QJniEnvironment jni; jni.registerNativeMethods(clazz, { Q_JNI_NATIVE_METHOD(callbackFromJava) }); removing a significant amount of boiler plate code. Change-Id: Ie4007b24125879fed3dae1f4d232b4aa95999b44 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Don't hide a widget that is swapped into a hidden splitterVolker Hilsheimer2022-05-231-0/+43
| | | | | | | | | | | | | | | | | When replacing a widget in a hidden splitter, then we only need to keep the new widget hidden if the previous widget was hidden. If the new widget is not explicitly hidden, and the splitter is already visible, then we need to explicitly show the new widget. Augment test case; the existing test cases already cover swapping out a collapsed or hidden widget. Fixes: QTBUG-102134 Pick-to: 6.3 6.2 Change-Id: I9b60711a5c1cab79777ce4183783114a16ac3394 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QMetaType: disable conversion from smart pointer<const QObject>Giuseppe D'Angelo2022-05-211-0/+17
| | | | | | | | | | | | | | | | | | | | | QMetaType can register a converter from a smart pointer class to QObject *. The code tries to do so even if the smart pointer is actually holding a pointer to a _const_ QObject (e.g. shared_ptr<const QObject>), causing a compile error: ../src/qt5/qtbase/build/include/QtCore/../../../src/corelib/kernel/qmetatype.h:1208:32: error: invalid conversion from ‘const QObject*’ to ‘QObject*’ [-fpermissive] 1208 | return p.operator->(); | ~~~~~~~~~~~~^~ | | | const QObject* Disable the conversion if indeed the source is const qualified. Change-Id: I9e9bc5992f74131e5cfd6ece9b83d4f26d370e92 Fixes: QTBUG-103741 Pick-to: 6.2 6.3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QtConcurrent: prevent conversion of ReduceOption to initial valueSona Kurazyan2022-05-202-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | QtConcurrent map- and filter-reduce functions take an initial value, which can be of any type that is convertable to the result type. The side-effect of this is that the enum values passed as ReduceOptions can be treated as an initial value (if they are convertable to the result type) which will result into a wrong overload call. To avoid this, added additional check to make sure that the initial value type doesn't match with ReduceOption enum. Note that this required including the qtconcurrentreducekernel.h header in qtconcurrentfunctionwrappers.h (which contains compiler checks for QtConcurrent) for accessing ReduceOption enum, so I had to get rid of qtconcurrentfunctionwrappers.h include from qtconcurrentreducekernel.h to avoid circular header includes. This, in turn, required moving the QtPrivate::SequenceHolder helper type to qtconcurrentreducekernel.h, which didn't belong to qtconcurrentfunctionwrappers.h anyway. Pick-to: 6.3 6.2 Fixes: QTBUG-102999 Change-Id: Ieaa8ef2e4bd82ce2ada2e0af9a47b87b51d59e87 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Fix crash in tst_qquicktext::implicitSizeEskil Abrahamsen Blomfeldt2022-05-202-40/+2
| | | | | | | | | | | | | This reverts commit 1e938c348b936328fafbcaae4c0c7d91003143e5 and bb2f4d08d9d138e4f70d6d6db46e24e34500becc. bb2f4d08d9d causes the crash, but 1e938c348b93 amends it, so this reverts both. When the cause of the crash has been determined and mitigated, the patches can be recreated. Fixes: QTBUG-103719 Change-Id: Ifc36b3771a96f6c85387a5306a0402d4c508d006 Reviewed-by: David Faure <david.faure@kdab.com>
* xcb: Delete touch points without target windowsTang Haixiang2022-05-202-2/+40
| | | | | | | | | | | | | | | | | | | | | | | | When XCB_INPUT_TOUCH_BEGIN closes a popup, we then receive XCB_INPUT_TOUCH_END, and cannot find a target window (because it's destroyed). If we don't deliver it, we need to at least clear the stored point from QPointingDevicePrivate::activePoints. Then when we deliver the next touch press, m_fakeMouseSourcePointId also needs to be reset. It's now even more paramount that autotests (and real-world touchscreens) must never omit any active touchpoint from a touch event. If a point doesn't move, it must be included in the QTouchEvent, with Stationary state. If not, QGuiApp::processTouchEvent() could generate multiple TouchBegin events in a row, which gets other bits of logic confused, here and there. Fixes: QTBUG-94557 Fixes: QTBUG-98519 Fixes: QTBUG-102751 Fixes: QTBUG-103706 Pick-to: 6.2 6.3 5.15 Change-Id: Ia95e410a2bb8bc7784aa5d296fac2b89e53a9f55 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Avoid ending Markdown fenced code blocks with gratuitous blank linesShawn Rutledge2022-05-203-6/+6
| | | | | | | | | | | | This caused unnecessary empty <pre> blocks when converting markdown to HTML, made code blocks too large using QSyntaxHighlighter to highlight the whole block, and caused assymmetry when rewriting markdown. Pick-to: 6.3 Fixes: QTBUG-101031 Change-Id: I08016577ccb92edb4afae31d7df3259cb011d5c8 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Convert <pre> to Markdown ``` and vice-versa with nonBreakableLinesShawn Rutledge2022-05-192-2/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The HTML parser calls QTextBlockFormat::setNonBreakableLines(true) when it sees a <pre> tag; so for symmetry, the markdown reader now does the same when it sees a fenced code block, and the markdown writer honors the nonBreakableLines property by writing a fenced code block. This preserves the meaning better when reading HTML and writing markdown or vice-versa, without modifying HTML reading or writing code. Added a test tst_QTextMarkdownImporter::fencedCodeBlocks() which unfortunately also highlights a known bug in the markdown reader: each fenced code block ends with an extra empty block. That can be fixed separately. tst_QTextMarkdownWriter::fromHtml(preformats with embedded backticks) that we re-enabled in 1abaf9d5d6ea9c6554362e851903ddd214a6f659 was not a very useful test: ``` with a space and some words but no newline is not a fence: it's just like a `monospace` span. We have had trouble with those in CI because of missing monospace fonts, or inconsistency when a supposedly mono font's QFontInfo::fixedPitch() returns false. So just test proper <pre>/fence conversion for now. Pick-to: 6.3 Fixes: QTBUG-100515 Fixes: QTBUG-100981 Task-number: QTBUG-101031 Change-Id: I88f0ede0810d8a9480b30eb0cd780e1af67cc5f2 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QTextDocument: add setLayoutEnabled()David Faure2022-05-191-0/+18
| | | | | | | | | | | This allows to set up everything first - without paying for layouting at every step - and only then trigger layouting. Same performance behavior as setTextWidth(0), but this is a more explicit/readable API. Change-Id: I044dbd8b1301b1c97a92f9a29ccde2baf27a7665 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* unblacklist passing tests 2022Anna Wojciechowska2022-05-186-23/+0
| | | | | | Pick-to: 6.2 6.3 Change-Id: I7d37dd58eaede1bd0d1b53fe264b45be83cbca57 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* qglobal.h: #include <stdbool.h> in C modeThiago Macieira2022-05-181-9/+0
| | | | | | | It's C99 and we require C11. Change-Id: Ieb9a2aa1ea914b1b956bfffd16eff4556b99f976 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Fix return value of qGlobalPostedEventsCount()Marc Mutz2022-05-181-11/+6
| | | | | | | | | | | | The unsigned return value was very un-Qt-ish, and, indeed, tst_QCoreApplication just stored the result in ints. Port to qsizetype, being the type of the expression that the function calculates. Task-number: QTBUG-103532 Change-Id: I95a81a686439b0686faad7a430adeaab66dc9e8d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make qGlobalPostedEventsCount() auto-test-exported-onlyMarc Mutz2022-05-182-0/+4
| | | | | | | | The only in-tree user outside QtCore is tst_QCoreApplication, guard the (single) test function there with QT_BUILD_INTERNAL. Change-Id: Ibc87ba76f2135cd8283acd75318f80a95e4b5c45 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove manual declarations of qGlobalPostedEventsCount()Marc Mutz2022-05-182-8/+1
| | | | | | | | | ... in favor of including qabstracteventdispatcher_p.h, where needed. Keeps the code DRY. Change-Id: I5bee2e653cb29ffac2601ff03c952a4b3adbdb9c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Un-blacklist markdown tests: QSKIP when fonts are scrambledShawn Rutledge2022-05-184-31/+92
| | | | | | | | | | | | | | | | | | | | | On QNX in CI we see system fonts: fixed: monospace 9; general: Sans Serif 9 and "monospace" isn't really a fixed pitch font. On B2Qt arm7 in CI we see system fonts: fixed: monospace 9; general Sans Serif 9 and Sans Serif is actually fixed pitch. So these tests can go wrong both ways; we need to skip them whenever the fonts would lead QTextMarkdownWriter astray. Pick-to: 6.3 6.2 Task-number: QTBUG-89819 Task-number: QTBUG-99676 Task-number: QTBUG-100515 Task-number: QTBUG-103484 Change-Id: I7b9adca967eaf9b8d33d1e03ef2627f70f375196 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Stylesheet: Another positioning fix for the menu indicatorVolker Hilsheimer2022-05-181-0/+12
| | | | | | | | | | | | | | | | | Draw tool button menu indicator relative to frame, not content, so that padding added in the stylesheet creates room between text and indicator. Also, prevent another double-arrow by ignoring menu indicator rendering when a menu button subcontrol is used, as the two are mutually exclusive. This amends 1c338e6d07a42631a6603c5bb0bc86f6806addd6. Add problematic case to stylesheet baseline test. Fixes: QTBUG-102866 Pick-to: 6.3 6.2 Change-Id: I5d79e65b33a2e41ac07c8efe0c15697c5be65201 Reviewed-by: Axel Spoerl <axel.spoerl@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Use QAbstractItemModelTester or QFileSystemModelAndreas Buhr2022-05-181-0/+35
| | | | | | | | | | | | This patch enables usage of QAbstractItemModelTester on QFileSystemModel. QAbstractItemModelTester called fetchMore() on all items. QFileSystemModel represents the whole file system. This led to very long test runs. To avoid this, this patch introduces a new feature in QAbstractItemModelTester, namely to disable calling of fetchMore(). Change-Id: Ie5d2e22fa4c143be7c080d9f79632cd2cbe07aac Reviewed-by: David Faure <david.faure@kdab.com>
* Fix memory leak in tst_qtreewidgetAndreas Buhr2022-05-181-0/+2
| | | | | | | | | | | Invalid inserts of items are tested. However, on an invalid insert of QTreeWidgetItem into QTreeWidget, the QTreeWidget does not take ownership of the to-be-inserted items. These items were leaked in the past. This patch introduces a scope-guard, so the items are not leaked. Change-Id: Ib53ac02605c3a3c0bd1ae69bbd0876f860d08093 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Make uic generate correct C++ commentsVolker Hilsheimer2022-05-1851-102/+177
| | | | | | | | | Revert the change to uic of 05fc3aef53348fb58be6308076e000825b704e58. Task-number: QTBUG-67283 Change-Id: Icfd83bb6d80b91d4e58f1be460f6772ba49a6921 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QtWidgets: restore Qt 5 compatibility for save/restore stateGiuseppe D'Angelo2022-05-181-5/+32
| | | | | | | | | | | | | | | | | | | | | | | Several classes in QWidget use QDataStream internally in order to save and restore state. These QDataStream usages were not versioned, meaning that if Qt changes the serialization for some datatype, then the data saved between different Qt versions becomes incompatible. Note that the save/restore API in question just produce opaque blobs as QByteArrays -- the user has no control over the QDataStream objects and thus versions. Fix by version the usages. In QHeaderView this has caused a regression because QBitArray *did* change version between Qt 5 and 6. In general, using QDataStream without explicit versioning is a mistake, so deploy the same fix elsewhere as well. Fixes: QTBUG-99487 Pick-to: 5.15 6.2 6.3 Change-Id: I82bb5c266f4e5dedc0887cbef855dccab1015e29 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: <doctor.whom@gmail.com>
* QTextDocument/QGraphicsTextItem: skip layout in setTextWidth(0)David Faure2022-05-172-2/+22
| | | | | | | | | | | | | | | | | | In a QGraphicsTextItem without a width yet, there's no need to do any layouting. The use case is obviously items with an app-defined size, not the default where text items adapt to their contents. Results: 0.065 msecs to create a QGraphicsTextItem with some text (layouted) 0.036 msecs to set everything up in a QGraphicsTextItem with 0 width QTextEdit was abusing the width 0 to mean "no wrap, width comes from contents", but since the value -1 means that already in QTextDocument, QTextEdit now uses a width of -1 for that meaning. Change-Id: I67ad59c305e5dd34830886e4e6c56dde03c93668 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Guard the use of QWinEventNotifier in testsAlexey Edelev2022-05-173-0/+6
| | | | | | | | | Add the Q_OS_WIN32 guard for the include of QWinEventNotifier. Change-Id: I7824b2ee236a370c83fd85a2f594a39cf36b36e6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QDBusArgument: ensure std::vector isn't seen as an associative containerDavid Faure2022-05-171-0/+3
| | | | | | | | | This broke compilation of qDBusRegisterMetaType<std::vector<MyStruct>> because std::vector<T> is in fact std::vector<T, std::allocator<T>>. Pick-to: 6.2 Change-Id: I6a13f5f0476a3faa3a43da54d90d652b4bdd8186 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Return specific types for frequently used Java objectsVolker Hilsheimer2022-05-171-0/+9
| | | | | | | | | | | | | | | | | | This allows us to specialize JNI type signature templates for e.g. the context object, which in Java signatures is "android/content/Context". Introduce a Q_DECLARE_JNI_TYPE macro that takes care of the plumbing. The types declared this way live in the QtJniTypes namespace, and transparently convert from and to jobject. Since jobject is a typedef to _jobject* we cannot create a subclass. Use a "Object" superclass that we can provide a QJniObject constructor for so that we don't require the QJniObject declaration to be able to use the macro. The APIs in the QNativeInterface namespace doesn't provide source or binary compatibility guarantees, so we can change the return types. Change-Id: I4cf9fa734ec9a5550b6fddeb14ef0ffd72663f29 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Fold methods for object return type into generic methodsVolker Hilsheimer2022-05-171-0/+31
| | | | | | | | | | | | | Since we know at compile time whether the return type is an object type, we can use 'if constexpr' and auto return type in the call(Static)Method and get(Static)Field functions to call the object-type methods. This makes the object-methods conceptually obsolete, but don't declare them as deprecated as long as they are still used in submodules to avoid warning floods and build failures in -Werror configurations. Change-Id: Ic3019ed990a9252eefcb02cdb355f8a6ed6bc2ff Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Stylesheet: fix toolbutton menu indicator renderingVolker Hilsheimer2022-05-161-0/+4
| | | | | | | | | | | | | | | | | | Turn off native indicators if we have custom rules, and if we drew natively, don't draw custom indicators. This amends ea0e0a865237983b484ed88447b9fc4c473e2759 which turned off custom drawing too aggressively, removing custom indicators also if no custom drop down arrow (which is only relevant for drop down menu buttons) was set. When then drawing the custom indicator, respect positioning rules in the style sheet. Extend baseline test. Fixes: QTBUG-102866 Pick-to: 6.3 6.2 Change-Id: I5ca353f42e704ec3f6e57677c35118a9cb358b0b Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161641-46398/+3455
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add QTextDocFragment::to/fromMarkdown() & QTextCursor::insertMarkdown()Shawn Rutledge2022-05-141-0/+222
| | | | | | | | | | | | | | | | | | | | | Also add the beginnings of an autotest for QTextCursor::insertHtml(), for comparison purposes. We can see that the block to be inserted is merged with an existing block by default rather than being inserted as a new one, with both HTML and Markdown insertions. So now we test for leading and trailing newlines in the markdown to be inserted, to determine whether we need a new block into which to insert, and to "hit enter" at the end of the insertion. QSKIP the toMarkdown() comparisons if GeneralFont is mono. This happens on Boot2Qt systems in CI. Task-number: QTBUG-76105 Task-number: QTBUG-94462 Task-number: QTBUG-100515 Task-number: QTBUG-103484 Change-Id: I51a05c6a7cd0be4f2817f4a922f45fa663982293 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add floating point color space conversionsAllan Sandfeld Jensen2022-05-141-0/+51
| | | | | | | | | | This allows color space conversions that produces values outside the 0.0->1.0 range, which is one of the intended functions of the floating point image formats. Change-Id: I63b37b0f6934d4382edafb4709486c785a637c67 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add override keyword to avoid warning from compilerOliver Eftevaag2022-05-131-1/+1
| | | | | | | | | A class that reimplements a virtual function isn't using the override keyword, which generates a warning during compilation. Pick-to: 6.3 Change-Id: Ic39ea24993e031f95ac9e61c3285d3be05fe6c34 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Add variadic template overloads for QJniObject/Environment methodsVolker Hilsheimer2022-05-132-17/+150
| | | | | | | | | | | | | | | | | | | | | | | | | This allows the compiler to deduce the template arguments based on the provided method parameters, which we can then pass to the methodSignature and fieldSignature helpers to generate the signature string completely at compile time. Since we can't partially specialize template member functions, replace the specializations for void methods with compile-time-if branches in the general templates. This variadic template now prevents implicit conversion from the LiteralStorage types to const char* signatures, so catch the case where such a type ends up in the parameter list. Due to overload resolution rules for constructors, we need to explicitly disable the constructor if any of the arguments is a string literal type, as we have to keep the old C-style variadic function working for such calls. Add variations that use the variadic templates to the unit tests. Change-Id: I8734664b38bae932369462330a9a03302254c33c Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Only configure one test for wasmDavid Skoland2022-05-121-0/+7
| | | | | | | | | | | | | | | Since we still don't support dynamic linking in wasm, we can't use it for tests, which forces us to use static linking, which is very slow (up to 30 seconds in some cases). The idea is to at least have one test run for wasm before expanding it later. Note that even with this change, QT_BUILD_MINIMAL_STATIC_TESTS=ON needs to be defined to skip the baseline test directory. Change-Id: I39aea22087211fb39f03dfb0b39c55f63a26d2a7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add BiC data for the new way to do BiC testingVille Voutilainen2022-05-124-0/+106940
| | | | | Change-Id: Id85fc21d4758eecc73b48f64370cc1479b618d81 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QMetaType: Fix normalization on MSVC if name contains enumFabian Kosmale2022-05-121-0/+6
| | | | | | | | | | | | | | | During type normalization, we remove the struct, class and enum keywords (see the skipStructClassOrEnum function). However, we only want to do that for actual keywords, not for a name that happens to start with e.g. "enum", as in "enumerationNameSpacce". Adjust the MSVC check to still require no identifier character after the keyword, while still allowing for some remaining characters. Fixes: QTBUG-97813 Pick-to: 6.3 6.2 Change-Id: I82b873d02ff454cce4b75f2814a52a66f2268208 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove remnants of the old Intel C++ compilerThiago Macieira2022-05-117-18/+6
| | | | | | | | | | | | | We don't support it any more. I don't think it has ever properly compiled Qt 6 (and it's no longer working for me against GCC 12's libstdc++ headers). If you report a bug against it, Intel support's first question is if you can try instead the new Clang/LLVM-based oneAPI C++ compiler. So we support only that one, which identifies itself as Q_CC_CLANG. Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16eb57a092c8439e Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Exclude network tests based on featureDavid Skoland2022-05-112-3/+5
| | | | | | | | | | | | Both tests in the conditional depend on the qnetworkinterface feature, and will fail to build if qt is configured without the networkinterface feature. Additionally, a missing system header in a test was added. Change-Id: Ife5989ee57675ebe117de2c92a4f96c7125cbab1 Pick-to: 6.3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Update shared-mime-info to the 2.2 releaseLiang Qi2022-05-111-5/+5
| | | | | | | | | This also includes the fix for x-objc++src mimetype. Fixes: QTBUG-70739 Pick-to: 6.3 6.2 5.15 Change-Id: I24f70fa5cea2e5b1a7877569be98d36878fcfe72 Reviewed-by: David Faure <david.faure@kdab.com>
* QPolygon: add toPolygonF()Marc Mutz2022-05-101-0/+12
| | | | | | | | | | | | | This was forgotten when implementing QTBUG-73160, but suggested in passing in QTBUG-64. [ChangeLog][QtGui][QPolygon] Added toPolygonF(). Task-number: QTBUG-73160 Task-number: QTBUG-64 Change-Id: I9b33cf47a0d432aa842ab0f8337001c66e4ca41c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QWidgetTextControl: port to new-style connects (faster)David Faure2022-05-101-0/+11
| | | | | | | | | | | | | | | This speeds up creating a QGraphicsTextItem by 14% in an optimized build Before: 0.070 msecs per iteration After: 0.060 msecs per iteration Those connects were showing up when profiling, because of the string parsing that is necessary when using SIGNAL/SLOT macros. The stacktrace was connect() => decodeMethodSignature() => argumentTypesFromString() => QArgumentType constructor => qMetaTypeInternal(const char*). Pick-to: 6.3 6.2 5.15 Change-Id: I3cf5655c5450f121005140bdb587fafa083cce6a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* wasm: add support for drag into browser windowLorn Potter2022-05-103-7/+83
| | | | | | | | | Drag and drop into the browser will work. Drag and drop out of the browser will not. Fixes: QTBUG-102242 Change-Id: Id9981ab6f9514535e1409bec18068790833a67a6 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* tst_qobjectrace: fix potential UB (something with pointers and new)Marc Mutz2022-05-071-11/+7
| | | | | | | | | | | | | | | | | | | | The current [basic.life] wording seems to cover the existing code, but IIRC, older versions of [basic.life] were not so relaxed. In particular, while not completely pertinent, the second placement new is awfully similar to http://eel.is/c++draft/ptr.launder#example-1 Just make all of this SEP and use std::optional. That way, the code gets simpler, too, plus we get rid of the last use of C++23-deprecated std::aligned_storage. The reset() before the 2nd emplace() isn't necessary, but, in a test, it doesn't hurt, either, and keeps code readers from guessing whether the first-emplaced object's dtor is actually properly run (it is). Pick-to: 6.3 6.2 Fixes: QTBUG-99122 Change-Id: If31a46f8be3a74499f1176133029d097faf7dfe9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Endian: Provide special integer bitfield unionsUlf Hermann2022-05-071-1/+105
| | | | | | | | | | | | | | | | | Our previous approach of creating a union from individual special integer bitfields leads to undefined values because only one member of a union can be active at any given time. Compilers have finally caught up with us on that and have started removing "no-op" writes to members. The primary user of the special integer bitfield unions is qv4compileddata_p.h in qtdeclarative. We want our on-disk format of QML compilation units to be platform agnostic and space efficient. Pick-to: 5.15 6.2 6.3 Task-number: QTBUG-99545 Change-Id: I24847bda2c364eb8ba75f074cde2a9bec25ced06 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>