summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* Initialize some uninitialized member variablesHe MingYang2021-02-202-8/+10
| | | | | Change-Id: Ia8e06850a2288f40906602adfbe40abb0faf8057 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Add scaledPixmap() overrideMorten Johan Sørvig2021-02-192-0/+7
| | | | | | | | | | | | | | | | | QAbstractFileIconEngine implements the QIconEngine interface and creates a new interface where subclasses override the filePixmap() function. QIconEngine subclasses must now also override scaledPixmap(); add implementation which forwards to filePixmap(). (The intermediate implementation in QPixmapIconEngine is not used by QAbstractFileIconEngine.) Pick-to: 6.1 Task-number: QTBUG-91104 Change-Id: I229e3a003ad0c3fff768eac7e75c59fe7145fcaa Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Make constructing QFont from families explicitVolker Hilsheimer2021-02-181-1/+1
| | | | | | | | | Disallow implicit conversion from QStringList to QFont. Address API review comment. Pick-to: 6.1 Change-Id: I73eb3a49182865e050965e97d459463e73bcddfd Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Doc: Fix documentation warnings qtbaseNico Vertriest2021-02-181-4/+4
| | | | | | Task-number: QTBUG-90662 Change-Id: If31847f8f2b8b57a8a8624d0406a030b5752f1c8 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Use newlines more consistently in generate compile-test codeEdward Welbourne2021-02-152-48/+28
| | | | | | | | | | | The generated code contained many repeated blank lines. Most main()s were preceded by one, but not all. Only include blank lines for actual empty entries in lists, where configure.json specified them, plus one before main if anything else precedes it. Change-Id: I6e6c34940e08712a1aa848a3c9ad1b0fb5806d77 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Simplify test-snippets in configure.cmakeEdward Welbourne2021-02-152-64/+32
| | | | | | | | | The main(void) signature obviates the need for unused parameters and has existed since (at least) C89; so use that instead of the old-fashioned argc/argv arguments we don't use in any of these tests. Change-Id: Ibfe850a1fce378673c9781011475ea623fd75ad4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* QRectF/Documentation: Fix malformed tableFriedemann Kleint2021-02-151-1/+1
| | | | | | | | The colspan should be 2. Manifests as error in the Qt for Python documentation. Pick-to: 6.0 5.15 Change-Id: Idec8a2b62a3495e00b7f2b31e8ed9d04b551f22e Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* MinGW: fix warning in QMatrix4x4::map functionsMårten Nordheim2021-02-151-5/+5
| | | | | | | | | | | | | | | | The definitions get the following warning (treated as error): redeclared without dllimport attribute after being referenced with dll linkage [-Werror] I take it to mean that because they are labelled 'inline' the compiler disregards the 'dllimport', but that makes it inconsistent with the declaration. So we label the declaration inline as well. Pick-to: 6.1 6.0 5.15 Change-Id: I87bb42141a1086b2c565db881077f33acb4aab64 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Extend colorspace testing and fix bug it uncoveredAllan Sandfeld Jensen2021-02-132-1/+3
| | | | | | | | | | When changing transferfunction the look-up-tables needs to be regenerated. Pick-to: 6.1 6.0 5.15 Change-Id: I83ca5fe570f85d478a374f52c0a82db84e70c3b8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix Wacom Art Pen detection on xcbShawn Rutledge2021-02-122-3/+8
| | | | | | Fixes: QTBUG-91102 Change-Id: I6cd7af26153457609c1fa8fb0a9e167939d592fc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix QImage::fill with semi-transparent QColorAllan Sandfeld Jensen2021-02-121-11/+10
| | | | | | | | | A few formats were not treating the input QColor correctly. Fixed and added more exhaustive test. Pick-to: 6.1 6.0 5.15 Change-Id: I872aeeb45e518f9a34b4ac35642264821f9927f2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Revert "Remove the qmake project files" for snippetsNico Vertriest2021-02-121-0/+3
| | | | | | | | | | | This reverts a limited part of commit ad2da2d27a590333fc89a56fc58700a09c3017b3 that deleted .pro files for snippets compilation. Some .pro files which contain snippets used in the documentation itself should be restored. Task-number: QTBUG-90483 Change-Id: I1b03833c8ff17b5fca43a5b6c5417e8545b1711b Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QMatrix4x4: deprecate operator*(QVector3D, QMatrix4x4)Giuseppe D'Angelo2021-02-112-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The operation is sketchy for a number of reasons: 1) Mathematically, it doesn't make sense. The code interprets the QVector3D as a point, extending it with w=1, and uses it as a row vector. But similarly, the vector could be intepreted as a directional vector, with w=0. No semantic is "better" than the other. 2) QMatrix4x4 is not meant to be post-multiplied. Granted, one could use a QMatrix4x4 as arbitrary storage for 16 floats, but QMatrix4x4 builds itself to be always *pre* multiplied (e.g. translate changes the 4th column, not the 4th row). We can keep post multiplication for the general case if we do it against a QVector4D, but I don't feel that we should support it also for QVector3D. [ChangeLog][QtGui][QMatrix4x4] The multiplication operator (operator*) between a QVector3D and a QMatrix4x4 has been deprecated. User code needs to extend the QVector3D to a QVector4D first (by specifying the intended w coordinate), and then multiply the QVector4D by the matrix. Pick-to: 6.1 Change-Id: I41b64d8ab7eb6126dc4c49fe29cf3f1b7afc7987 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix mingw compiler warningsMårten Nordheim2021-02-113-32/+22
| | | | | | | | Mark overridden functions with override. Remove unused static function. Change-Id: I06bd52c66ac7b970dfced0e553eac9c4a4d44d79 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QMatrix4x4: deprecate operator*(QMatrix4x4, QVector3D/QPoint(F))Giuseppe D'Angelo2021-02-112-3/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | The operation does not make sense at the "fundamental" level for these classes (algebraic, in this case), so it shouldn't exist. It's also a semantic trap: * it interprets a _vector_ as a _point_ instead (the vector gets 1-extended in 4D) * after the multiplication, it gets perspective divided. These semantics do not belong to operator*. operator*(QVector3D/QPoint(F), QMatrix) will be tackled in a next commit; we don't have a straightforward replacement for it. Drive-by, document that map() interprets vectors as points. [ChangeLog][QtGui][QMatrix4x4] operator* between a QMatrix4x4 and a QVector3D, QPoint, or QPointF has been deprecated in favor of map() and mapVector(). Pick-to: 6.1 Task-number: QTBUG-89708 Change-Id: Iad78d6eb68cc8cdc3ac16b1635c4d3b522c95213 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Filter cosmetic lines using transformed, not world coordinatesEirik Aavitsland2021-02-101-4/+4
| | | | | | | | | Lines smaller than 1e-12 would not be drawn even when scaled up. Pick-to: 6.1 6.0 5.15 Fixes: QTBUG-75630 Change-Id: I8f261876c325b60f61e95ca2e5fde2cb227d4cba Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QTextureFileData: support key value metadataJonas Karlsson2021-02-094-3/+56
| | | | | | | Task-Id: QTBUG-76970 Pick-to: 6.1 Change-Id: I9dba1b373250cea4d0c806997290a7afcdc900d7 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Canonical pointer usageHou Lei2021-02-091-6/+6
| | | | | | | | Other affected rows have also been fixed. Change-Id: Ie0a32f724bd2e40e7bfacfaa43a78190b58e4a21 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Long live VK_KHR_display platform plugin!Laszlo Agocs2021-02-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Experiment with this once again, this time in a more forward looking manner: move the code previously placed into eglfs's eglfs_viv backend into its own plugin. Move our attention to devices like the Raspberry Pi 4, where VK_KHR_display has recently been introduced to the Mesa v3dv backend. This is not in Mesa 20.3.3, the latest release at the time of writing, but is available and functional when building master. This serves as the reference system for testing the plugin, because it looks like a fairly robust implementation. The sole thing the plugin enables at the moment is creating a QVulkanInstance and a QWindow with surfaceType VulkanSurface. This is sufficient to run plain QWindow+QRhi (with QRhi::Vulkan), Qt Quick, and Qt Quick 3D (with QSG_RHI_BACKEND=vulkan) applications. One display and mode is chosen, by default the first in the enumeration lists reported by the Vulkan extension. This can be overridden with QT_VK_DISPLAY_INDEX and QT_VK_MODE_INDEX (modeled after QT_VK_PHYSICAL_DEVICE_INDEX). The indices can be determined based on the logs printed to the debug output. Changing the mode seems to be working nicely with v3dv. Multiple screen setups, where there would be more than one VkDisplayKHR enumerated, have not been tested yet. Regardless, multiple screens (reporting more than one QScreen, with a different QWindow on each, eglfs style) are not currently supported. This may be improved later (while keeping in mind that VK_KHR_display does not have a fully-featured output management API). Multiple (non-fullscreen) windows and especially raster windows (QWidget) are not and will not be supported. Our single QWindow is always forced to fullscreen. When it comes to input, the level of support should match linuxfb and eglfs. Note that while mouse input is fully functional, there is no mouse cursor. (and this is unlikely to be implemented) [ChangeLog][Platform Specific Changes][Embedded Linux] Introduced a vkkhrdisplay platform plugin to run Vulkan-based applications in fullscreen, without a windowing system, on systems where VK_KHR_display and VK_KHR_display_swapchain are supported by the Vulkan implementation. Change-Id: I6388416f7fb2bfdc4b412a0a4971f25cc05d4668 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* egl: Add debug option to print all EGLConfigsLaszlo Agocs2021-02-081-0/+15
| | | | | | | | | QT_QPA_EGLFS_DEBUG=1 prints the attributes for the chosen EGLContext. Make QT_QPA_EGLFS_DEBUG=2 print the same for all EGLContexts. Pick-to: 6.1 Change-Id: Id161d04789fbd015e29e5a5a89a0901000096ea3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Handle macOS 11 issues in softHyphens testAllan Sandfeld Jensen2021-02-081-2/+8
| | | | | | | | | | Calculate the effective width of the hyphen better, and compare with ceiled sizes. Pick-to: 6.1 6.0 Fixes: QTBUG-90698 Change-Id: I7ed2eb44c54240ecb2f8a38e5acf1f32608b2bfb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Avoid C-style casts when possibleHou Lei2021-02-071-16/+16
| | | | | | | Other affected rows have also been fixed. Change-Id: I1d2c28eb37a9d259d3132156163d4135894c18c3 Reviewed-by: David Faure <david.faure@kdab.com>
* Clean up documentation in QVector[234]DEdward Welbourne2021-02-051-30/+50
| | | | | Change-Id: I13f04c06280b998e5489eb114977ec0ed37178b7 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Fix crash when requesting A32 glyph on WaylandEskil Abrahamsen Blomfeldt2021-02-051-1/+5
| | | | | | | | | | | | | | | | | | | | | | | On Wayland we aren't getting any information about the subpixel layout of the screen. On Freetype, this triggers an assert / memory corruption when explicitly requesting a subpixel antialiased glyph (via QRawFont) because it needs to know the layout to render the glyphs. It might be possible to get this information in the Wayland plugin, but at least we should have a failsafe which doesn't crash when the problem occurs. This simply falls back to using A8 antialiasing when it doesn't know the subpixel layout. [ChangeLog][Freetype] Fixed crash when calling QRawFont::alphaMapForGlyph() with subpixel antialiasing on Wayland. Fixes: QTBUG-90236 Pick-to: 6.0 Pick-to: 6.1 Pick-to: 5.15 Change-Id: Iddee2e171a81664ae9e3989115881f23262b2182 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* macOS: Don't assume NSEvent charactersByApplyingModifiers: produces characterTor Arne Vestbø2021-02-051-2/+5
| | | | | | | | | | In cases where the keyboard layout doesn't have a mapping for a given event and modifier combination the result will be an empty string. Fixes: QTBUG-90683 Pick-to: 6.0 Change-Id: Ice06241f0ae71a19cde041410818decc312bc630 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* macOS: Don't wrap key event keys in QCharTor Arne Vestbø2021-02-052-13/+17
| | | | | | | | | | | | | | | | | | | | | | | Key events have a wider range of possible values than the unicode range, as they also include all the special keys as defined in Qt::Keys. Instead of turning the argument to keyMapForKey into an integer, we can remove the argument completely, as it was only used as a fallback in the cases where UCKeyTranslate (or in the future, charactersByApplyingModifiers:), failed to map the virtual key and modifiers to a character. But in those cases we should not fall back to the Qt key from the key event, as that doesn't match what the keyboard layout defines. Most keyboard layouts explicitly define the base key as the key for these "undefined" mappings, but if the keyboard layout does not, we should not produce any input in the application, to match what AppKit does in this case. Fixes: QTBUG-90315 Pick-to: 6.0 Change-Id: Ib9ffd9521049ee8e4b103597c1d34cbe3d23dbdf Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* rhi: metal: Present drawables via addScheduledHandler instead of presentDrawableTor Arne Vestbø2021-02-051-3/+7
| | | | | | | | | | | | | | The former API is the recommended way to present drawables -- avoiding WindowServer submission throttling and potential issues with lock-ups when window are not serviced, are being moved to other screens, or users mistakenly call waitUntilCompleted. The scheduled block captures the drawable and retains it until the block is done executing. Change-Id: I99dca2db3bcfbea67c686dd5d97ba5011598997e Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* rhi: metal: Manually manage drawable lifetimeTor Arne Vestbø2021-02-051-3/+8
| | | | | | | | | | | | | | | | | | | The drawable returned from nextDrawable is autoreleased, which means unless we explicitly retain it we have no guarantee that it will stay alive long enough to be used again in endFrame(). For example, if the user had an autorelease-pool in their custom render code, where the call to beginPass() happens, the drawable would be released when that pool went out of scope. The only reason we didn't hit this yet is due to the default autorelease-pool being at the level of the runloop, so the drawable happened to outlive the rendering of a single frame. An advantage of manually managing the lifetime of the drawable is also that we can release it immediately after being done with it, instead of waiting until the autorelease-pool drains. Change-Id: Ie6fd271adbe1121eb947bb7075142f1a6c81175d Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QStandardItem(Model): refactor multiData supportGiuseppe D'Angelo2021-02-051-24/+23
| | | | | | | | | | | | | | | QSI(M) allow users to override their data() functions. This means that we can't have their data() implemented in terms of multiData(), or otherwise a subclass that overrides data() will fall out of sync with its multiData() implementation. We must keep multiData() implemented in terms of data() instead. While at it, document QSI::multiData(). Pick-to: 6.0 6.1 Task-number: QTBUG-89423 Change-Id: If30a980d8449135b516745fec73170d53367b4b7 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Make explicit that we expect co-ordinates to be finiteEdward Welbourne2021-02-042-52/+111
| | | | | | | | | | | | | | | | | | | The various spatial-vector, line, point, region and margin types have all long taken for granted that their co-ordinates are finite and, in particular, not NaN. Make this expectation explicit in the documentation. Added assertions where (chiefly) noexcept and (where the assertion would be a simple qIsFinite() call) constexpr didn't preclude doing so. Also assert against zero divisors that would lead to non-finite results. Make minor clean-ups to docs in the process. QMarginsF had several methods whose declaration, definition and docs weren't consistent in their parameter names. Task-number: QTBUG-89010 Change-Id: I601a830959d13a73dcb17ce31a1202a1486c8f7f Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Rationalize QVector[234]D's length-handlingEdward Welbourne2021-02-041-87/+28
| | | | | | | | Use qHypot() instead of casting to and from double so much, use qFuzzyCompare(_, 1.0f) rather than qFuzzyIsNull(_ - 1.0f). Change-Id: I70f38fe2d9aefe1ceb15e1a370f181a7856911b7 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Rationalize QQuaternion's length-scaling codeEdward Welbourne2021-02-041-56/+40
| | | | | | | | | | | | | | | | | | | | | Use qHypot() to implement length(), avoid duplicating its code and use its result more carefully, saving the need for casting to and from double. Subtracting a double from 1.0f still got a double, so the qFuzzyIsNull() checks were using double's tolerance, where the use of 1.0f indicates the float tolerance would have been more apt. Also, use qFuzzyCompare(_, 1.0f) instead of qFuzzyIsNull(_ - 1.0f). In getEulerAngles(), scale co-ordinates by length before multiplying (to ensure O(1) quantities) rather than scaling the products by the squared length (possibly after {ov,und}erflowing). Change-Id: Id8792d6eb047ee9567a9bbb246657b0217b0849f Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Add "we mean it" warning to private headerVolker Hilsheimer2021-02-031-0/+11
| | | | | | | Fix warning from configure. Change-Id: I12def11a4effb7298ec0501cfac4ffd37b777ff6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Optimize RGBA64PM->RGBA64 for SSE4Allan Sandfeld Jensen2021-02-033-56/+102
| | | | | | | | And remove direct conversion to take advantage of both the SIMD, but also threading on all platforms. Change-Id: I782ae7c80e82b694e23abee28d69cecd0d28c32f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rhi: gl: Attempt reading back floating point formatsLaszlo Agocs2021-02-032-9/+27
| | | | | | | | | ...in the hope that they may work. If not, that's it, but at least we tried. Task-number: QTBUG-76970 Change-Id: I134c5cc4cfb5ad1e6f9edbfcf506df20022e127a Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QGuiApplication: use global position to create local position for synthetic ↵Richard Moe Gustavsen2021-02-031-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | mouse events When QWidgetWindow handles a QTouchEvent, it will call updateTouchPointsForWidget() for each widget it tries to deliver the touch event to. This will make sure that the point's position() is updated to be local to the widget being processed. The problem is that we never reset this overwriting of local positions in the event after we're done. So if we later try to synthesize a mouse event from it, the local position in the fake mouse event will be based on the local position inside a random widget, and not the original local position sent from QPA. Rather than trying to store all the original local positions inside the event before going through this delivery logic, and reset it afterwards, we base the local position of the synthesized mouse event on the (unmodified) global position instead. Fixes: QTBUG-90033 Change-Id: I1588351482de7cce9c06d102db3686ea8dd0c118 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Improve and expand QShortcutMap debug outputMitch Curtis2021-02-031-4/+8
| | | | | | | | | | - Replace vague symbols with descriptive words. - Use qScopeGuard() to ensure that removeShortcut prints the number of removed shortcuts for all execution paths. Change-Id: I4d36366445756b41b1dc40bbb1e987dce669a723 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove false Q_UNREACHABLE from shaping codeEskil Abrahamsen Blomfeldt2021-02-031-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was added by 9ff76c27b9031ae7c49c4c9e8b5a3bea1e0e3c78 on the basis that it signifies a shaping error and would later assert or crash. But the line is easily reachable by user code. If Harfbuzz returns 0 glyphs, it just means it is unable to shape the string, for instance if the input string only contains default ignorables (like a ZWJ) and does not have any appropriate glyph to use for replacement. Qt expects there to always be at least one glyph in the output (num_glyphs == 0 is used to indicate shaping is not yet done), so to avoid asserts later on, we simply populate the output with a single 0 token, which is a required entry in the font that is reserved for representing unrepresentable characters. This also adds a test and therefore a zero-width joiner to the test font to reproduce the issue. [ChangeLog][QtGui][Text] Fixed a possible crash with certain fonts when shaping strings consisting only of control characters. Fixes: QTBUG-89155 Pick-to: 5.15 Pick-to: 6.0 Change-Id: Ia0dd6a04844c9be90dcab6c464bebe339a3dab11 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Optimize RGBA64->RGBA64PM for SSE2/AVX2Allan Sandfeld Jensen2021-02-034-50/+45
| | | | | | | | And remove the direct conversion so we can get both the SIMD optimization and threading applied. Change-Id: Id032ea91cc40c1cbf1c8a1da0386de35aa36cfb5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix inefficient use of qToBigEndianAllan Sandfeld Jensen2021-02-021-4/+1
| | | | | | | It can do unaligned access directly as well. Change-Id: I4046cf69e2ad8eb628b8b53bfa521800bb35dc6d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make setSelectionOnFocusObject() take native pixelsMorten Sørvig2021-02-021-5/+9
| | | | | | | | | | | | Change the setSelectionOnFocusObject() to take geometry arguments in native pixels, in order to be consistent with other QPlatformInputContext API. Calling code which pass non-native geometry must be updated (in practice only the Android platform plugin). Change-Id: I1c61b8cf583afe607567d6056ca7ff23cc3de3f3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix nullptr dereference on out-of-memory conditionsAllan Sandfeld Jensen2021-02-021-0/+2
| | | | | | | Fixes two static analysis warnings. Change-Id: Id4644d1944e97c9c53d2268a9a71e5f6347d3946 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Segment qimage conversion block irrelevant of depthAllan Sandfeld Jensen2021-02-022-5/+5
| | | | | | | | Always try segments from 64k to 128k pixels, this matches qimagescale logic, and gives a one percent speedup locally. Change-Id: I3ef468eac9dca4b84f04850e970f3d15a4f16255 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Support cubemap ktx filesJonas Karlsson2021-02-011-16/+36
| | | | | | Change-Id: I6905c393647d31fab958cdd9471bb0a6ffe83596 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Add geometry accessors to QPlatformInputContextMorten Johan Sørvig2021-02-012-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | Currently the platform plugins use the public QInputMethod API when querying geometry. However, QInputMethod returns geometry in device independent pixels, while the platform plugins require geometry in native pixels. Add new API to QPlatformInputContext which returns input geometry in the native window coordinate system: QRectF inputItemRectangle() QRectF inputItemClipRectangle() QRectF cursorRectangle() QRectF anchorRectangle() QRectF keyboardRectangle() These make the relevant QHighDpi calls internally, and such calls can then be moved out of the platform plugins. Disambiguate inputItemRectangle() in qandroidinputcontext.cpp by renaming it to screenInputItemRectangle(). Change-Id: I561745b64fb197d64e3dfddcf0751528bb8d0605 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Avoid int overflow in gradient drawingEirik Aavitsland2021-02-011-3/+6
| | | | | | | | | Fixes oss-fuzz 29348 Pick-to: 6.0 5.15 Change-Id: I3568a0a7a7e8d87881f5b052c6c00831b53b3842 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Robert Löhning <robert.loehning@qt.io>
* QMatrix4x4: implement operator*(QVector3D/QPoint(F)) in terms of mapGiuseppe D'Angelo2021-02-011-97/+97
| | | | | | | | Rather than the other way around, in preparation for deprecation. Change-Id: I001d7617425a24e960871925130c5314c393ea8c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Remove QObjectCompatProperty::operator= for safer usageAndreas Buhr2021-01-291-1/+1
| | | | | | | | | | | | | Introduction of QObjectCompatProperty requires every write to the property to be examined whether it is OK or should be replaced by a setValueBypassingBindings/markDirty combination. The existence of operator= make this difficult as it is easy to miss places where it is written. By not having operator=, we can help developers make sure they had a conscious decision about each write to the property. Change-Id: Ia61ea4722eb0bab26ce7684b85dd03d710cd1751 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Avoid overflow in text layoutEirik Aavitsland2021-01-281-0/+4
| | | | | | | | | Fixes oss-fuzz issue 29313. Pick-to: 6.0 5.15 Change-Id: Idbabd162fa9e0dbce687981bdbcc75be37189a61 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Robert Löhning <robert.loehning@qt.io>
* Doc: Fix CI warnings qtbaseNico Vertriest2021-01-271-2/+2
| | | | | Change-Id: I4e5a2d3494b86008bde234447ef701ea2d6447f6 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>