summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* QAnyStringView: fix code point -> code unit in the docsGiuseppe D'Angelo2022-01-161-1/+1
| | | | | | | | | | The docs are saying that QAnyStringView sizes are measured in terms of code units of the underlying encoding, not code points. Pick-to: 6.3 6.2 Change-Id: Ic72ffd122e45631e8626c9d57ec24ca348918424 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QtGui/math3d: Fix QQuaternion::getEulerAngles for GimbalLock casesYuya Nishihara2022-01-161-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is heavily inspired by the patch written by Inho Lee <inho.lee@qt.io>, which says "There is a precision problem in the previous algorithm when checking pitch value. (In the case that the rotation on the X-axis makes Gimbal lock.)" In order to work around the precision problem, this patch does: 1. switch to the algorithm described in the inline comment to make the story simple. 2. forcibly normalize the {x, y, z, w} components to eliminate fractional errors. 3. set threshold to avoid hidden division by cos(pitch) =~ 0. From my testing which compares dot product of the original quaternion and the one recreated from Euler angles, calculation within float range seems okay. (abs(normalize(q_orig) * normalize(q_roundtrip)) >= 0.99999) Many thanks to Inho Lee for the original patch and discussion about rounding errors. Fixes: QTBUG-72103 Pick-to: 6.3 6.2 5.15 Change-Id: I8995e4affe603111ff2303a0dfcbdb0b1ae03f10 Reviewed-by: Yuya Nishihara <yuya@tcha.org> Reviewed-by: Inho Lee <inho.lee@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QMutableEventPoint: turn into memberless structMarc Mutz2022-01-151-33/+4
| | | | | | | | | | | | | | | | ... as a befriendable namespace. This breaks all remaining users of QMutableEventPoint, thus forcing them to port to the new static-setter-only API that reliably avoids the UB that the old QMutableEventPoint::from(), in particular, depended on. Fixes: QTBUG-99615 Pick-to: 6.3 Change-Id: Id162cd98f13b52c4f491749ee73826b1c5755453 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QCSS: Support Qt 5-style integer property selectorsVolker Hilsheimer2022-01-154-35/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt 5 style sheets, objects could be selected by an enum-type property using the integer value of the enum value, e.g QToolButton[popupMode="1"] { ... } In Qt 6, the the new meta type system and QVariant implementation enabled QVariant::toString to return the string representation of the enum value instead for a property containing an enum. Since QStyleSheetStyle's attribute matching is string based, this breaks the Qt 5 style selector, and QCSS code instead needs to use e.g. QToolButton[popupMode=MenuButtonPopup] { ... } While the new syntax is arguably preferable, this is an unintentional change that silently breaks style sheet code (no error or warning at compile- or run-time). To support Qt 5-style selectors, we have to change the StyleSelector interface of the QCssParser API so that we can pass through what type of value the attribute extractor should return; if an integer string "1" is provided, then we need to compare the enum integer value; if the string provided does not represent a number, then we need to compare the name of the enum value. Since the pure virtual attribute() method that needs to be implemented to extract the attribute value of the node is implemented in modules outside qtbase, add a second virtual method that takes the entire QCss::AttributeSelector, which includes the value to match. Extractor implementations can use it to evaluate which type of data to return for an exact match. The default implementation calls the old attribute() method so that existing StyleSelector implementations continue to work. Make the respective change in the QStyleSheetStyleSelector, and simplify the surrounding code. Adjust other StyleSelector implemnentations in qtbase. As a drive-by, remove the superfluous virtual declaration from those overrides. Once submodules are adjusted to override this virtual function instead of the (now no longer pure) virtual attribute() method, that method can be removed. Pick-to: 6.3 6.2 Fixes: QTBUG-99642 Change-Id: I9a2b3498f77bf7cab5e90980b7dab2f621d3d859 Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix Pick Screen Color with multiple monitorsFawzi Mohamed2022-01-151-1/+3
| | | | | | | | | | | QScreen::grabWindow expects screen coordinates, not global ones, use QScreen::geometry() to compute them. Fixes: QTBUG-99472 Pick-to: 6.2 6.3 Change-Id: Ic4b99577b8cb394e6cd0a2d3f554bb3ec8250afa Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Zhang Hao <zhanghao@uniontech.com>
* tests: port to new QMutableEventPoint static APIMarc Mutz2022-01-151-0/+9
| | | | | | | | | | | | | | | | | | This code didn't actually use QMutableEventPoint::from(), so didn't run into the UB that from() depended on, but it's in the way of making QMutableEventPoint a befriendable namespace instead of a public subclass of QEventPoint. Replaced the QMutableEventPoint ctor that takes a timestamp, and therefore isn't compatible with the ctors on QEventPoint, with a static function that returns QEventPoint instead. Port QList initialization to braced-initialization as a drive-by. Task-number: QTBUG-99615 Pick-to: 6.3 Change-Id: If5a1dbea21cc31cdefdb640716793421c8ec0af4 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Prevent repeated instantiations of ↵Marc Mutz2022-01-153-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qRegisterNormalizedMetaType<QList<QModelIndex>>() This, finally, shows some expected results: Clang -ftime-trace: $ ClangBuildAnalyzer --analyze qtgui-spec-before.trace | head -n6 Analyzing build trace from 'qtgui-spec-before.trace'... **** Time summary: Compilation (523 times): Parsing (frontend): 665.7 s Codegen & opts (backend): 298.9 s $ ClangBuildAnalyzer --analyze qtgui-spec-after.trace | head -n6 Analyzing build trace from 'qtgui-spec-after.trace'... **** Time summary: Compilation (525 times): Parsing (frontend): 628.3 s Codegen & opts (backend): 301.0 s GCC 11 time (bash builtin): $ time for ((i=0; i < 3; ++i)) do touch ../qt5/qtbase/src/gui/painting/qpolygon.h ; ninja libQt6Gui.so; done [268/268] Creating library symlink qtbase/lib/libQt6Gui.so.6 qtbase/lib/libQt6Gui.so [268/268] Creating library symlink qtbase/lib/libQt6Gui.so.6 qtbase/lib/libQt6Gui.so [268/268] Creating library symlink qtbase/lib/libQt6Gui.so.6 qtbase/lib/libQt6Gui.so real 4m10,918s user 49m10,099s sys 3m11,719s $ git revert --no-commit HEAD $ time for ((i=0; i < 3; ++i)) do touch ../qt5/qtbase/src/gui/painting/qpolygon.h ; ninja libQt6Gui.so; done [268/268] Creating library symlink qtbase/lib/libQt6Gui.so.6 qtbase/lib/libQt6Gui.so [268/268] Creating library symlink qtbase/lib/libQt6Gui.so.6 qtbase/lib/libQt6Gui.so [268/268] Creating library symlink qtbase/lib/libQt6Gui.so.6 qtbase/lib/libQt6Gui.so real 4m18,630s user 51m11,491s sys 3m16,479s The technique in the comment in qmetatype.h doesn't work on Clang - it runs into -Winstantiation-after-specialization. The whole extern template stuff so miserably fails to meet the goals set out in N1448, not only for MSVC and class templates, but, it seems, on all compilers, and for function templates, too, that I'm giving up on it for now. Unfortunately, I'm not really seeing a way to hide this stuff behind a macro, yet. Task-number: QTBUG-97601 Pick-to: 6.3 Change-Id: I500fd04555e0bd76ac021f75582bd8d8cf339378 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtNetwork: Include moc filesMårten Nordheim2022-01-1523-0/+46
| | | | | Change-Id: I227a9541bf76c1c048a694f022b8fc419c0c2544 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Don't include qeventpoint_p.h from qevent_p.hMarc Mutz2022-01-1410-1/+10
| | | | | | | | | | | The header no longer uses QMutableEventPoint. Fix TUs that relied on the transitive include. Task-number: QTBUG-99615 Pick-to: 6.3 Change-Id: Iae4ff34ea708304fcd365fd763875dd4a97a1cf8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QFlatMap: don't sort already ordered dataMarc Mutz2022-01-141-1/+1
| | | | | | | Pick-to: 6.3 6.2 Change-Id: Id7ab2fe09c01500ca5bd23751ba29ed1394bb9b6 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix crash when text shaping failsEskil Abrahamsen Blomfeldt2022-01-141-0/+6
| | | | | | | | | | | | | | | | | | | | | | | If text shaping failed for some reason (for example if the string passed to Harfbuzz contains ignorables only), we would return a single glyph for the whole string. But we forgot to initialize the log clusters array, which could cause crashes later when this was read. We initialize a single cluster consisting of the "missing glyph" glyph to be consistent. Amends fccd419dd632306a4bd85928223e0a56a59510ef. [ChangeLog][QtGui][Text] Fixed a possible crash with certain fonts when shaping strings consisting only of control characters. Pick-to: 5.15 6.2 6.3 Task-number: QTBUG-89155 Fixes: QTBUG-92358 Change-Id: I1ec0237d99b48be2a8bb340f0feb056bca4fdffe Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QWindow: Remove unnecessary castVolker Hilsheimer2022-01-141-2/+1
| | | | | | | | | We already have a QMouseEvent, don't static_cast the QEvent again to the parent-class of QMouseEvent. Pick-to: 6.3 6.2 Change-Id: Ifd8a5a82d0a8ded564a68ec4f3ae877886c6e1c7 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QWindow: fix UB (invalid static_cast)Marc Mutz2022-01-141-1/+6
| | | | | | | | | | | | | | | | | | | Do the cast to QMouseEvent only after we determined that it's actually a QMouseEvent. Says ubsan: src/gui/kernel/qwindow.cpp:2558:27: runtime error: downcast of address 0x7fffca0e5af0 which does not point to an object of type 'QMouseEvent' 0x7fffca0e5af0: note: object is of type 'QShowEvent' ff 7f 00 00 b0 09 01 b8 61 7f 00 00 11 00 00 00 00 00 00 00 b3 8a b5 41 00 00 00 00 80 50 5a cc ^~~~~~~~~~~~~~~~~~~~~~~ vptr for 'QShowEvent' Only cast _after_ determining that `ev` is-a mouse event. Amends 3d71c4b740d23d5c3f380f495990f35ea17dc2a0. Pick-to: 6.3 6.2 Change-Id: I8455c998e2f4390a1483c1a097eb095358963ace Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix warning on macOS builds, unbreak -developer-buildVolker Hilsheimer2022-01-141-1/+1
| | | | | | | | | | | The mix of signed (qsizetype) and unsigned long when comparing breaks local -Werror,-Wsign-compare builds. Amends d83dbc3db2f305e745cd75a9fd9c97128eaac42f. Change-Id: I7910b7e2dfaaa01d8069ce52e97c0166e6d3fa30 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* convertDoubleTo: invert the condition so we catch NaNs earlyThiago Macieira2022-01-141-1/+1
| | | | | | | This is floating point, so De Morgan doesn't always apply. Change-Id: I89446ea06b5742efb194fffd16bb9e36025cb387 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* convertDoubleTo: move the precision upgrade test upThiago Macieira2022-01-141-4/+13
| | | | | | | | | | Hopefully, the compiler will realize that the suprema calculated below are actually bigger than these limits and make the appropriate dead code eliminations. Change-Id: I89446ea06b5742efb194fffd16bb99f78b26eb0e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Doc: Mark QSP::PublicShare, Templates for 6.4Kai Köhne2022-01-141-2/+2
| | | | | | | | | The commit missed the 6.3 branching / feature freeze. Task-number: QTBUG-86106 Task-number: QTBUG-78092 Change-Id: I1d6b1efe0d482b6fc1ff3cfbbb440856b8cf1856 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* qtpaths: Expose new PublicShareLocation, TemplatesLocationKai Köhne2022-01-141-0/+2
| | | | | | | | | | | | | These were added to QStandardPaths in commit 68c4669ce49aad21beff0e8ef0122a86d53b12e2 [ChangeLog][QtCore] PublicShareLocation, TemplatesLocation got added as known locations to QStandardPaths. Task-number: QTBUG-86106 Task-number: QTBUG-78092 Change-Id: I453b6a07dd7775f81f81a1b18fa95f5c1230cb1e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QGuiApplication: port the last user of QMutableEventPoint::from()Marc Mutz2022-01-143-44/+40
| | | | | | | | | | | | ... to the new static setter API, preventing the undefined behavior that from() depended on. Remove from() and constFrom(). Task-number: QTBUG-99615 Pick-to: 6.3 Change-Id: I69c52aa286eaf51303734e42184af36815cf828a Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QPathEdge: Fix array initializationIvan Tkachenko2022-01-141-5/+1
| | | | | | | | | | | | We had a copy-paste error there: not all array members were initialized. Pointed out by PVS-Studio static analysis tool: https://habr.com/ru/company/pvs-studio/blog/542760 Co-Authored-By: Marc Mutz <marc.mutz@qt.io> Pick-to: 6.3 6.2 5.15 Change-Id: I06a4f2cd928846eab6330af014981fd0a3170ba0 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Port the last user of QMutableSinglePointEvent::mutableEvent()Marc Mutz2022-01-142-3/+1
| | | | | | | | | | | ... to the static setters of QMutableEventPoint. Remove the mutableEvent() function. Task-number: QTBUG-99615 Pick-to: 6.3 Change-Id: If4d3decae67baff41e23e7e9eaed3f3035fab595 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QTlsBackend: Fix living QObjects after QCoreApplication shutdownMike Achtelik2022-01-132-6/+15
| | | | | | | | | | | | Since switching to the plugin bases system for the tls backends, Qt again retains some QObjects after QCoreApplication shutdown. This was previously fixed in QTBUG-84234, so make sure we destroy the newly introduced QObjects as well. Task-number: QTBUG-84234 Pick-to: 6.3 Change-Id: I1aaea2c90f7d55793c19259be4f9173b4befb246 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add porting instructions for using binary JSONSona Kurazyan2022-01-131-31/+34
| | | | | | | | | | | Also move the instructions for using the Qt5Compat module to a separate section, since they repeat in a few places. Pick-to: 6.3 6.2 Fixes: QTBUG-99771 Change-Id: Ib9a45043bd9aa462a767780c0986ebfb9a7b948d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't return an associated screen for embedded widgetsVolker Hilsheimer2022-01-131-0/+5
| | | | | | | | | | | | | | | Widgets embedded in a graphics view via QGraphicsProxyWidget don't have an associated screen, even though they are top level windows in the widget hierarchy. Their screen has to be based on the screen of the toplevel widget they are embedded in. This fallback is taken care of by QWidget::screen already. Task-number: QTBUG-20531 Pick-to: 6.3 Change-Id: I77af092b2f8e6322662499be464eec40cfd9ac1c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Properly detect and declare contiguous iteratorsGiuseppe D'Angelo2022-01-132-16/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recommended way to detect a contiguous iterator isn't to check the iterator_category; it's to use the iterator concepts. Similarly, the recommendation set in place by P2259 (for being backwards-compatible) is to declare a iterator_concept member, not to change iterator_category to a C++20 category, (also) because legacy code may be checking for equality against a specific category, rather than for convertibility. This is erroneous, but such code exists, alas. This is enshrined in C++20's stdlib: for instance, iterator_traits<Foo*> has random_access_category_tag as iterator_category, but contiguous_iterator_tag as its iterator_concept. Hence: 1) in QArrayDataOps use the concept, and not the category, to do the check 2) when declaring iterators, keep the category as random access, and introduce the concept alias (if supported). Pick-to: 6.2 6.3 Change-Id: Ib600da7331d687a15082becaa6be06aefc24bb9c Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Read QThreadPool::objectName thread-safeAllan Sandfeld Jensen2022-01-132-6/+10
| | | | | | | | | | QThreadPool allows method calls from any thread, but QObject does not so copy objectName so we may use it locally under our own lock. Pick-to: 6.3 6.2 Task-number: QTBUG-99775 Change-Id: Ib28910649f5d0f9ce698c7da495069635d608d03 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Allow reading QObject::objectName from other threads againAllan Sandfeld Jensen2022-01-131-0/+4
| | | | | | | | | | | | The new binding system made it impossible to read from non-owning threads, but we have code that did so with external locking. This patch makes it safe again, assuming all reads and writes are locked. This is left intentionally undocumented. Pick-to: 6.3 6.2 Task-number: QTBUG-99775 Change-Id: I845afa5d545ca0ac762ac369181b1497dac52195 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Tidy up macOS collation and add some assertionsEdward Welbourne2022-01-131-7/+9
| | | | | Change-Id: I7af21ce38f2f23498d7c8a7e027bfffb149a43e3 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix an assertion failure in massageAdjustedDateTime()Edward Welbourne2022-01-131-4/+4
| | | | | | | | | | | | | | The QDateTimeData &d it's passed is a copy that's about to be modified; before we do so, we haven't detached so its internals have a ref-count of two, contradicting an assertion in the non-const Data::operator->(); so just directly access d.d->m_timezone, since we know that spec == TimeZone implies !isShort(). Added test that triggered the assertion and now doesn't. Fixes: QTBUG-99668 Pick-to: 6.3 6.2 6.2.3 5.15 Change-Id: I07321ad91be5adce524be18e4ab82eee7110dc6a Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Make counts of various types of test result add up correctlyEdward Welbourne2022-01-134-27/+95
| | | | | | | | | | | | | | | | | | | | | | | | | Added tests for repeated skips and failures (from within void lambdas, to simulate skips and failures from within event handlers). These exhibit yet more ways to count more than one outcome for a test. The new QTest::failOnWarning() can also provoke more than one failure from a single test, and several existing selftests exhibited various ways for the Totals line's counts to add up to more than the number of actual tests run. Fixed counting so that only the first decisive incident is counted. Tests can still report later failure or skipping, but only the first is counted. Added a currentTestState in qtestlog.cpp, by which it keeps track of whether the test has resolved to a result, and clearCurrentTestState() by which other code can reset that at the end of each test. This brought to light various places where test-end clean-up was not being handled - due to failure or skipping in a *_data() method or init, or a skip in cleanup. Fixes: QTBUG-95661 Change-Id: I5d24a37a53d3db225fa602649d8aad8f5ed6c1ad Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Revise the explanation for leaving QTest::qWait() as it isEdward Welbourne2022-01-131-4/+6
| | | | | | | | | | | | | The recently aborted attempt to act on the comment's recommendation revealed a major performance regression, so mention that instead of the now historical compiler problem that used to be our reason for not simply calling qWaitFor(). Change-Id: I81714b556998217a833c21b4208118b7292b7a96 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* uic/Python: Import base class for flag valuesFriedemann Kleint2022-01-132-6/+22
| | | | | | | | | | | | | | Extend the logic extracting enum base classes to flags to handle things like QAbstractItemView::EditTriggers. Exclude the Qt namespace. Amends de15836dbf5007092c19bc9ab15ca3d1a36901ad. Fixes: PYSIDE-1773 Task-number: PYSIDE-1404 Pick-to: 6.2 6.2.3 6.3 Change-Id: Ib0cd0836a91f330e5bc3307690062a965abec7eb Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* QMetaType: Allow conversion of derived gadget types to their base typesUlf Hermann2022-01-131-5/+11
| | | | | | | | A derived gadget has an is-a relationship with its base type. It should be convertible. In fact, canConvert() already tells us it is. Change-Id: I71a5ac9afd78e88adb23b4d0e757f34077f63207 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: Fix snippet to match actual QFileInfo behaviorKai Köhne2022-01-131-1/+1
| | | | | | | | | | The documentation was already updated in abfac029ceaf6c3199694a50, but the snippet still incorrectly suggested QFileInfo::size would report the actual size of an .lnk file on Windows. Pick-to: 5.15 6.2 6.3 Change-Id: I03b96b2efcb713fbc4dd30fc526e1209806bf5cf Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* rhi: Add the basic infrastructure for tessellation supportLaszlo Agocs2022-01-139-48/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...but this will only be supported with Vulkan and OpenGL 4.0+ and OpenGL ES 3.2+ for the time being. Taking the Vulkan model as our standard, the situation is the following: - Vulkan is ok, qsb secretly accepts .tesc and .tese files as input already (plus QShader already has the necessary plumbing when it comes to enums and such) To switch the tessellation domain origin to bottom left we require Vulkan 1.1 (don't bother with VK_KHR_maintenance2 on top of 1.0 at this point since 1.1 or 1.2 implementations should be common by now). The change is essential to allow the same evaluation shader to work with both OpenGL and Vulkan: this way we can use the same shader source, declaring the tessellation winding order as CCW, with both APIs. - OpenGL 4.0 and OpenGL ES 3.2 (or ES 3.1 with the Android extension pack, but we won't bother with checking that for now) can be made working without much complications, though we need to be careful when it comes to gathering and setting uniforms so that we do not leave the new tessellation stages out. We will stick to the Vulkan model in the sense that the inner and outer tessellation levels must be specified from the control shader, and cannot be specified from the host side, even though OpenGL would allow this. (basically the same story as with point size in vertex shaders) - D3D11 would be no problem API-wise, and we could likely implement the support for hull and domain shader stages in the backend, but SPIRV-Cross does not support translating tessellation shaders to HLSL. Attempting to feed in a .tesc or .tese file to qsb with --hlsl specified will always fail. One issue here is how hull shaders are structured, with the patchconstantfunc attribute specifying a separate function computing the patch constant data. With GLSL there is a single entry point in the tessellation control shader, which then performs both the calculations on the control points as well as the constant data (such as, the inner and outer tessellation factors). One option here is to inject handwritten HLSL shaders in the .qsb files using qsb's replace (-r) mode, but this is not exactly a viable universal solution. - Metal uses a different tessellation pipeline involving compute shaders. This needs more investigation but probably not something we can prioritize in practice. SPIRV-Cross does support this, generating a compute shader for control and a (post-)vertex shader for evaluation, presumably in order to enable MoltenVK to function when it comes to tessellation, but it is not clear yet how usable this is for us. Change-Id: Ic953c63850bda5bc912c7ac354425041b43157ef Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QStandardPaths_win: Add mapping for DownloadLocationYuhang Zhao2022-01-131-8/+4
| | | | | | | | | Un-special-case for DownloadLocation. I assume the original code is written like that to be compatible with some really old versions of Windows. Change-Id: I643401910bae9a061f2e02c651971b4f2dd46901 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QApplication: port manual users of QMutableEventPointMarc Mutz2022-01-131-2/+2
| | | | | | | | | | | | | | ... to new static setter API, which doesn't depend on undefined behavior. These users didn't use QMutableEventPoint::from(), but static_cast<>, so they were only found when the non-static setters were removed, locally. Task-number: QTBUG-99615 Pick-to: 6.3 Change-Id: I37faf17b2b180e0f6e8bb4e5f46951a2cc29678d Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QStandardPaths: Remove old MinGW workaroundYuhang Zhao2022-01-131-11/+1
| | | | | | | | | | | | | | | | From the comments the workaround is for MinGW older than v7, now our CI has MinGW v9 trunk, it should be safe to drop this. The magic number is replaced by the official function, although it was introduced in Win8, Qt6's minimum supported platform is Win10, so it's also safe to do. As a drive-by, remove two unused includes. Change-Id: I891fe3883f17d4914932784868d7446299d32c65 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QStandardPath: fix typoYuhang Zhao2022-01-131-1/+1
| | | | | | Pick-to: 6.3 6.2 Change-Id: I12837ce614ea91a8a72191092dc8c835f74107cc Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QWindowSystemInterface: port to QMutableEventPoint static setter APIMarc Mutz2022-01-131-6/+6
| | | | | | | | | | | | | This code was actually ok (no UB), but it's in the way of making QMutableEventPoint a befriendable namespace, so port from using QMutableEventPoint to QEventPoint instances + QMutableEventPoint static setters. Task-number: QTBUG-99615 Pick-to: 6.3 Change-Id: I1f123837d62a2200e36faf89f6912ee59be2f915 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add a few explicit conversions back from intThiago Macieira2022-01-123-4/+4
| | | | | | | | | | Suppresses GCC's -Wconversion, which is not enabled by default. error: conversion from ‘int’ to ‘quint8’ {aka ‘unsigned char’} may change value [-Werror=conversion] Change-Id: I0e5f6bec596a4a78bd3bfffd16c998102bd51f7c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QString::compare: fix comparing a 4GB string to 1 QCharThiago Macieira2022-01-121-1/+1
| | | | | | | | | | If the size() was larger than INT_MAX, the result would be wrong (and UB). Pick-to: 6.2 6.3 Change-Id: I0e5f6bec596a4a78bd3bfffd16c99763e66c2013 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Q*Parser: Replace "data" with "contents" in stringsRobert Löhning2022-01-122-2/+2
| | | | | | | | | ...to be clearer and avoid confusion with "data section". Change-Id: I13319be0e3e12aecf1e0e86c256007dfe6cb98c6 Pick-to: 6.3 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QRollEffect: Remove assignments that have no effectIvan Tkachenko2022-01-131-2/+0
| | | | | | | | | | | Value of the member variable `done` will be overwritten after the end of each `if` block. Pointed out by PVS-Studio static analysis tool: https://habr.com/ru/company/pvs-studio/blog/542760 Change-Id: Icaf965aaebfa8a238dd3569689e1496a30d4b6d1 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QJsonObject: use the UTF-8 string comparator in sortingThiago Macieira2022-01-122-4/+2
| | | | | | | | | | No change, the two functions are identical for case-sensitive comparison. But this allows us to remove the comment that explained why we were abusing the Latin1 comparator. Change-Id: I0e5f6bec596a4a78bd3bfffd16c98bbcac6c9dc9 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QByteArray: remove left-over Q_NEVER_INLINE after we removed the tablesThiago Macieira2022-01-121-4/+0
| | | | | | | | | | | | | | | | | | The comment made a reference to the case tables that used to exist in qbytearray.cpp prior to commit 9dd8e655cdd26eeaae30645b7fe013d9a696547f ("Limit QByteArray's 8-bit support to ASCII"). Now that the parameter is a function pointer, not a table, inlining is actually beneficial: we definitely don't want the compiler to emit function calls via the function pointer. At least GCC 11 was already doing constant-propagation of the parameter: While it didn't inline the function, it cloned it and propagated the constant in each of the two clones. There were 4 copies of this function: const and non-const, upper and lower. Change-Id: I0e5f6bec596a4a78bd3bfffd16c912a16602e20a Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QMacStyle: fix a regression introduced by a button type changeTimur Pocheptsov2022-01-121-0/+7
| | | | | | | | | | | Since we (re)use NSButton to render tab items, the 'momentary push in' button type breaks the tab. Temporary restore the old 'push on/push off' type if rendering a tab. Pick-to: 6.2 6.3 5.15 Fixes: QTBUG-99743 Change-Id: I54b11c1a35373292ecf0bcd5cf7b4ea4203cc031 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QSslSocket (SecureTransport) add TLS 1.3 ciphersuitesTimur Pocheptsov2022-01-123-0/+82
| | | | | | | | | | | | | | | | | | | At some point we decided to support a custom set of ciphersuites specified by QSslConfiguration (which if you ask me was never a good idea). The law of unforseen consequiences bit us again: since we now give a set of ciphesuites to QSslConfiguration and set ciphesuites from the configuration a socket has, we are limited by the ciphersuites we know about at the moment of 'coding'. Meaning if an SDK was updated and CipherSuite.h later adds more ciphersuites, we miss them and 'don't support them', while we ... actually do. This patch tries to add some more ciphersuites introduced in TLS 1.3 (interesting, SecureTransport does not support TLS 1.3, but TLS 1.3 suites can be used in TLS 1.2 session). Pick-to: 6.2 6.3 5.15 Task-number: QTBUG-99368 Change-Id: I439b63845c4893e5621cffaf3bcaf62e2b643c74 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QVariant: fix incorrect warning about duplicated alias where there isn'tThiago Macieira2022-01-121-0/+1
| | | | | | | | | | | | | | We were always matching a type name to itself because we forgot to advance the iterator after we did match. The issue was introduced in commit 46dc8e453ae1d0c1eb749cfebe686995f3a6cfd0. Fixes: QTBUG-99620 Task-number: QTBUG-96916 Pick-to: 6.3 6.2 Change-Id: Ib42b3adc93bf4d43bd55fffd16c8a5df6306e404 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Jonas Kvinge <jonas@jkvinge.net>
* Doc: Replace "C:\Documents and Settings" pathsKai Köhne2022-01-124-6/+6
| | | | | | | | | | "C:\Documents and Settings" isn't a real path anymore since Windows Vista. Replace it by C:\Users, or - in the snippet for QDesktopServices that is for demoing a path with space - with C:\Program Files. Pick-to: 6.2 6.3 5.15 Change-Id: I1bef97b6482180a6467fffcd1d62d6c168bcb389 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>