summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* tst_qtextboundaryfinder: Remove full copies of data filesIevgenii Meshcheriakov2022-05-243-9541/+0
| | | | | | | | | | There are no commented out test cases remaining, so the normal test vectors are identical to full test vectors. Fixes: QTBUG-97537 Pick-to: 6.3 Change-Id: I987f178f192e1c8e2d998d36499fdce84f237e77 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUnicodeTools: Fix line breaking before open parenthesesIevgenii Meshcheriakov2022-05-242-28/+42
| | | | | | | | | | | | | | UAX #14, revision 45 (Unicode 13) has changed rule LB30 to only trigger if the open parentheses is non-wide: (AL | HL | NU) × [OP-[\p{ea=F}\p{ea=W}\p{ea=H}]] This fixes the remaining 24 line break tests. Task-number: QTBUG-97537 Pick-to: 6.3 Change-Id: I9870588c04bf0f6ae0a98289739bef8490f67f69 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Unicode: Extract EastAsianWidth propertyIevgenii Meshcheriakov2022-05-244-9761/+12606
| | | | | | | | | | This property is needed to properly implement the line breaking algorithm from UAX #14. Task-number: QTBUG-97537 Pick-to: 6.3 Change-Id: Ia83cc553c9ef19fae33560721630849d2a95af84 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUnicodeTools: Fix line breaking for potential emojisIevgenii Meshcheriakov2022-05-242-1/+12
| | | | | | | | | | | | | | Implement part of LB30b introduced by UAX #14, revision 47 (Unicode 14.0.0): [\p{Extended_Pictographic}&\p{Cn}] × EM This fixes one line breaking test. Task-number: QTBUG-97537 Pick-to: 6.3 Change-Id: I3fd2372a057b7391d8846e9c146f69a54686ea61 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUnicodeTools: Fix interactions of WB3d and WB4 rulesIevgenii Meshcheriakov2022-05-242-3/+8
| | | | | | | | | | | Word breaking rule WB3d should not be affected by WB4. This fixes the remaining word break test. Task-number: QTBUG-97537 Pick-to: 6.2 6.3 Change-Id: I99aee831d7c54fafcd2a9d526a3e078b12c5bfad Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUnicodeTools: Handle WB3c word break ruleIevgenii Meshcheriakov2022-05-242-11/+21
| | | | | | | | | | | | | | | Adjust handling of WB3c rule to UAX #29, revision 33 (Unicode 11.0.0). The rule reads: ZWJ × \p{Extended_Pictographic} This fixes 9 word break tests. Task-number: QTBUG-97537 Pick-to: 6.2 6.3 Change-Id: I818d4048828e6663d5c090aa372d83f5099fdffe Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Unicode: Remove obsolete word break classesIevgenii Meshcheriakov2022-05-244-45/+25
| | | | | | | | | | Remove E_Base, Glue_After_Zwj, E_Base_GAZ, and E_Modifier obsoleted by UTS #29, version 33 (Unicode 11.0.0). Task-number: QTBUG-97537 Pick-to: 6.2 6.3 Change-Id: If5dc36ae17cd8746bbe81b73bbcc0863181e4a7a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUnicodeTools: Adjust properties of WSegSpace word break classIevgenii Meshcheriakov2022-05-243-60/+60
| | | | | | | | | | | | | | | | | | Disable break between sequences of WSegSpace characters (rule WB3d, introduced in UAX #29, version 33, Unicode 11.0.0). Also disable breaks between WSegSpace and (Extend | Format | ZWJ) due to rule WB4. Adjust "words4" test to take the above changes into account (space character belongs to WSegSpace). Mention the full class name in a comment inside the word break table. This fixes 34 word break tests. Task-number: QTBUG-97537 Pick-to: 6.2 6.3 Change-Id: I7dfe8367e45c86913bb7d7fe2adb053711978487 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUnicodeTools: Fix handling of LB22 line break ruleIevgenii Meshcheriakov2022-05-242-39/+39
| | | | | | | | | | | | | | This rule was simplified in version UTS #14 version 45 (Unicode 13.0.0) to read: × IN Re-enabled 28 fixed line break tests. Task-number: QTBUG-97537 Pick-to: 6.2 6.3 Change-Id: I1c5565a8c1633428c22379917215d4e424ff0055 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUnicodeTools: Remove ZWJ data from the line break tableIevgenii Meshcheriakov2022-05-241-38/+37
| | | | | | | | | | | ZWJ is handled separately by rule LB8a. The code for rule LB10 was adjusted to handle ZWJ as AL as required by the specification. Task-number: QTBUG-97537 Pick-to: 6.2 6.3 Change-Id: I814cbb4a26f2994296767cca0443d8a1a1aaf739 Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QUnicodeTools: Fix handling of ZWJ for line breaksIevgenii Meshcheriakov2022-05-242-12/+11
| | | | | | | | | | | | | | | Adjust implementation of rule LB8a of UAX #14. The rule was changed in version 41 (corresponding to Unicode 11.0.0): ZWJ × (ID | EB | EM) ⇒ ZWJ × Fixing this rule fixes 9 line break tests. Those are re-enabled. Task-number: QTBUG-97537 Pick-to: 6.2 6.3 Change-Id: I1570719590a46ae28c98ed7d5053e72b12915db7 Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Refactor if-else snake into switch statementVolker Hilsheimer2022-05-241-19/+20
| | | | | Change-Id: I597d5cbdddf4a2fbbe8b9de2ae252cdeadce9d11 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* Make sure the correct context is current when invoking resizeGLLaszlo Agocs2022-05-241-0/+3
| | | | | | | | | | | | | | | After the 6.4 changes for QRhi-based compositing in widgets there is now a good chance that a different context is current after recreateFbo in case it actually created a new texture and fbo. This is not great if we immediately call resizeGL() afterwards since the contract for the reimplementable functions is that the QOpenGLWidget's context is current. Make sure this contract is followed. Fixes: QTBUG-103319 Change-Id: I59a5fa9500df34b86787927e1114d0a80297678a Reviewed-by: Christian Strømme <christian.stromme@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* rhi: Fix texture format doc typo and rephraseLaszlo Agocs2022-05-241-3/+3
| | | | | Change-Id: Ica4cc0fcea642eccfff7b53a65e7d1a428fd4dad Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Enable text layout drawing on coordinates outside QFIXED_MAXEirik Aavitsland2022-05-241-5/+12
| | | | | | | | | | | | | | | In an earlier commit, painting on such coordinates was rejected, since it would overflow the internal calculations using QFixed. Instead, avoid the overflow by translating the painter to avoid the huge coordinate values. Also reduce the max value somewhat, so that pos stays well away from QFIXED_MAX, to avoid overflows in the other QFixed variables that have values offset from pos. Fixes: QTBUG-103745 Pick-to: 6.3 6.2 Change-Id: Iebdec32bed57fe8e65551c7d278da9fd6c041b37 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix race conditions in moveToThreadFabian Kosmale2022-05-243-33/+135
| | | | | | | | | | | | | Amends ba6c1d2785ca6d8a8b162abcd9d978ab0c52ea2d, which made m_statusOrPendingObjects already atomic, but did not handle concurrent deletion/push_back of the pendingObjects vector correctly. We use the existing lock in QThreadPrivate to prevent data races. Pick-to: 6.2 6.3 Fixes: QTBUG-101681 Change-Id: I0b440fee6ec270d762e6700a4fe74f28b19e75e8 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Update qt_attribution for harfbuzzEskil Abrahamsen Blomfeldt2022-05-241-1/+1
| | | | | | | | | | | | | | | Amends d88da0b2b0a8abaaa521bef864378fe1dbf86709 where I forgot updating the attribution. Note that the original change was never picked to 6.2 after all, since that is on an even older version of Harfbuzz, therefore this one is only picked to 6.3. Given the phase 6.2 is in, I decided it was better to leave it, since it didn't get the 3.0.0 update either. Pick-to: 6.3 Task-number: QTBUG-103603 Change-Id: Ie323d931b49158776c2b9fcc4835b69ca4e2f905 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix QWidget::metric to use widget screen dpr instead of app-dprThorbjørn Lund Martsum2022-05-241-13/+4
| | | | | | | | | | | | | Use the widget screen dpr in calculations rather than qApp->devicePixelRatio(). The screen may have been directly set (without the window handle being initialized) Task-number: QTBUG-103309 Task-number: QTBUG-49663 Task-number: QTBUG-101947 Task-number: QTBUG-102982 Change-Id: I2af2073640b171baf68575e3bc93b29b6a9a471d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* wasm: move CTRL <-> META comment into right placeMorten Sørvig2022-05-242-2/+3
| | | | | | Change-Id: I9f95542fd6a0326985744503a71e36448961d6fc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: David Skoland <david.skoland@qt.io>
* wasm: Improve wheel event handlingMorten Sørvig2022-05-242-17/+15
| | | | | | | | | | | | | | | | | | | | | | | 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>
* wasm: remove debug codeMorten Sørvig2022-05-241-8/+0
| | | | | | | Accidentally added with commit d4905016. Change-Id: Ie896dc79218f5778be552114d9e896fea8c80ed8 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* wasm: use correct geometry when drawing window decorationsMorten Sørvig2022-05-241-3/+3
| | | | | | | | | | | | | | We were drawing window decorations at an incorrect location in cases where the QScreen was not at (0,0) (i.e. at an offset on the web page). Window content was placed correctly. Correct canvas geometry can be fond by offsetting window geometry by the negative screen position. Implement this for drawWindowDecorations(), and also simplify the existing code in drawWindowContent(). Change-Id: I1347d325a58dae5e2bb950b93902123f64199ee8 Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: David Skoland <david.skoland@qt.io>
* wasm: update m_normalGeometry on setGeometry()Morten Sørvig2022-05-241-0/+2
| | | | | | | | | If we don't do this then applyWindowState() will apply the original window geometry from QWasmWindow::initialize(). Change-Id: I4a0fb7aa7984ba21c64364e0bf00d70513232d5d Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: David Skoland <david.skoland@qt.io>
* QAuthenticator: allow to set custom SPN for Windows clientIvan Solovev2022-05-241-3/+27
| | | | | | | | | A new option is added for SPNEGO/Negotiate authentication with SSPI backend to customize the SPN that is used during the procedure. Fixes: QTBUG-88869 Change-Id: If034ef451a61593445d8e79e7f82b9d3610ed653 Reviewed-by: Mårten Nordheim <marten.nordheim@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-233-18/+82
| | | | | | | | | | | | | | | | | | | | 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>
* QVector: make sure the forwarding headers for the Java iterators existThiago Macieira2022-05-232-1/+6
| | | | | | | | | | | | | | They used to in Qt 5. And now they do again: $ grep . include/QtCore/Q*Vector* include/QtCore/QMutableVectorIterator:#include "qvector.h" include/QtCore/QVector:#include "qvector.h" include/QtCore/QVectorIterator:#include "qvector.h" Pick-to: 6.2 6.3 Fixes: QTBUG-103742 Change-Id: I77c8221eb2824c369feffffd16f128a983f4866c Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* StackTraceHandler: call the debugger directly, instead of via /bin/shThiago Macieira2022-05-231-14/+29
| | | | | | | | | | | | | This removes one middle-man and a 512-byte variable in favor of a simple 32-bit enum. This was done in a way so we can extend to use either gdb or lldb in any OS. I've renamed the debuggerPresent() function to make its meaning clearer. Pick-to: 6.3 Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16eba561628ff89b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* StackTraceHandler: simplify the gdb and lldb commandsThiago Macieira2022-05-231-11/+2
| | | | | | | | | | Instead of piping stuff via the shell into them, just use batch mode. And also take the opportunity to tell them not to read their user- provided configuration files. Pick-to: 6.3 Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16eba21e71afaefa Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix CLDR version in qt_attribution.jsonIevgenii Meshcheriakov2022-05-231-2/+2
| | | | | | | | | CLDR was updated to version 41 in 59860685a19017b50e8fd54c3397a190585c8ebc but this file was not updated. Task-number: QTBUG-103663 Change-Id: I163a4a3f6ce16d611c013656fa569be01880e72c Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Network: update Public Suffix ListIvan Solovev2022-05-233-4384/+4463
| | | | | | | | | 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>
* Update Harfbuzz to version 4.2.1Eskil Abrahamsen Blomfeldt2022-05-23188-6081/+13697
| | | | | | | | | | | [ChangeLog][QtGui][Text] Updated the Harfbuzz code included with Qt to version 4.2.1. Pick-to: 6.2 6.3 Fixes: QTBUG-103603 Change-Id: I45fdde8fd0772e4470304c5f6f5a876666356d04 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix separate delete of window and windowcontainerAllan Sandfeld Jensen2022-05-233-8/+53
| | | | | | | | | | | | 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>
* qmake: iOS: Don't pass -fobjc-nonfragile-abi -fobjc-legacy-dispatchAlexandru Croitor2022-05-231-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to latest clang source code (llvm-14.0.3) non-fragile ABI is default for everything but i386 which means we can stop passing the -fobjc-nonfragile-abi option. See https://github.com/llvm/llvm-project/blob/llvmorg-14.0.3/clang/lib/Driver/ToolChains/Darwin.h#L245 This gets rid of the following warning when building a qmake project for iOS, while targeting the iOS simulator: clang: warning: argument unused during compilation: '-fobjc-nonfragile-abi' [-Wunused-command-line-argument It only happens for the simulator case because Xcode adds the -fobjc-abi-version=2 option, thus the qmake one gets ignored. As a drive-by also remove the usage of the -fobjc-legacy-dispatch option. According to clang sources it should be implicitly used on iOS. See https://github.com/llvm/llvm-project/blob/llvmorg-14.0.3/clang/include/clang/Basic/ObjCRuntime.h#L100 Amends d788f636691df5cae59d44a3828a0ddd58c343d0 Pick-to: 6.2 6.3 Fixes: QTBUG-103001 Change-Id: I06f8e46e40a1f04c5bbc4f177afa035e525dfed6 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Ensure proper quoting when calling otool in objc_namespace scriptTor Arne Vestbø2022-05-231-3/+3
| | | | | | | Pick-to: 6.2 6.3 5.15 Change-Id: I0c7fc40d321277103f6e80f221884cd87df6f930 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Fix QMenu size on first showThorbjørn Lund Martsum2022-05-231-0/+9
| | | | | | | | | | | | QWidget::metric is used to calculate the size of the menu, but it only respects a sceen from a Window handle, so we need to make sure such a thing is created. Task-number: QTBUG-103309 Pick-to: 6.2 6.3 Change-Id: Ie73e362cdcb3b59f46ad51c4901fdbeda7258baa Reviewed-by: Morten Kristensen <me@mortens.dev> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@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-233-14/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-232-2/+53
| | | | | | | | | | | | | | | | | 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>
* qglobal: resolve one Qt6 TODOYuhang Zhao2022-05-231-12/+4
| | | | | | | | Tested with MSVC 2022 locally and this change doesn't break the bootstrapped builds. Change-Id: Ieeb9a77035d889b9c1ed0c0c3488ac8802879282 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Implement in QLocalTime the offset functions V4 Date needsEdward Welbourne2022-05-222-0/+56
| | | | | | | | | | | | Prepare to replace a large pile of #if-ery-laden tangled mess from the implementation of V4 Date by implementing a cleaned-up version of one of its offset calculations and using a recently refactored API of QDTP to implement the other. Task-number: QTBUG-95993 Change-Id: I469f67fb384543abeece9ce8b14bb294c8613033 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QAbstractItemModel: Fix Qt::TextAlignmentRole when metatype is uintJonas Kvinge2022-05-221-4/+8
| | | | | | | | | | | When combining text alignment flags, it no longer works since the metatype for example QVariant(Qt::AlignRight | Qt::AlignVCenter) is uint, not int. Fixes: QTBUG-103576 Pick-to: 6.2 6.3 Change-Id: If0291b99606787081c4bc26fd00431f8a17a61a2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QMetaType: disable conversion from smart pointer<const QObject>Giuseppe D'Angelo2022-05-212-1/+18
| | | | | | | | | | | | | | | | | | | | | 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>
* FatalSignalHandler: chain back to the original crash handlerThiago Macieira2022-05-201-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | If a previous handler was already installed, ensure it is called, because there may be a reason why it was there. For example, the Android ART adds a signal action to every fatal signal for logging purposes. We do that by restoring the signal handler we had and re-raising the signal. If our handler was overridden by something else, then that handler was already called, but will get uninstalled after our code runs. It won't be a problem, because the application is exiting anyway. [ChangeLog][QtTest][Behavior Change] On Unix, the QtTest code to handle Unix/POSIX fatal signals will now call back to the original handler that was installed, if there was one. This allows logging frameworks (such as Android ART's), for example, to log the crash too. Additionally, if there was no handler, the application should exit with the correct signal instead of SIGABRT. Fixes: QTBUG-97652 Pick-to: 6.3 Change-Id: Ifc4fca159b490d8d0b614d736e46caefcb903a4c Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* FatalSignalHandler: remember the previous signal's handlerThiago Macieira2022-05-201-41/+23
| | | | | | | | | | | | And only restore those signals, instead of iterating over all possible signals, instead of attempting to restore to SIG_DFL. Also, as a consequence, we will install our handler even if there was already a handler installed for the signal. Pick-to: 6.3 Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16eb756685f4e8b8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* FatalSignalHandler: simplify SA_RESETHAND codeThiago Macieira2022-05-201-13/+6
| | | | | | | | | And remove the unreachable code after std::abort() that was meant to mimic that in INTEGRITY. The next commit will fix this properly. Pick-to: 6.3 Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16eb772018add694 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* FatalSignalHandler: simplify the SA_SIGINFO handlingThiago Macieira2022-05-201-9/+10
| | | | | | | | | The #if around the function declaration was ugly. Pick-to: 6.3 Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16eb7540f5da080f Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* FatalSignalHandler: use std::optional instead of QScopedPointerThiago Macieira2022-05-201-2/+4
| | | | | | | | We get stack space reserved instead of using the heap. Pick-to: 6.3 Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16eb73fff0174150 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>