summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* QTextureFileReader: backport ASTC supportEirik Aavitsland2019-08-155-1/+260
| | | | | | | | | | Add support for astc format files as an experimental feature. To enable, configure with "-feature-texture_format_astc_experimental" (Backported from commit 5a4db421bd94acd12a4ac1f77031996b95f85dbf) Change-Id: I9a2f7b1fa20ba344b79637bafb50ff2bd0596747 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Include buildAbi() in the shader cache directory nameLaszlo Agocs2019-08-141-1/+2
| | | | | | Task-number: QTBUG-64697 Change-Id: I8b81bce94c50464105a9a43086b06b841e4b8551 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Limit curve stroking threshold to reasonable rangeEirik Aavitsland2019-08-141-1/+1
| | | | | | | | | | | | | Avoid unreasonable threshold values for extremely wide pens, since that can lead to a very high processing cost. The rare usecases where this would make a noticeable difference will necessarily also be using scaling, and so is anyway depending on setting a suitable curve threshold manually. Fixes: QTBUG-77241 Change-Id: I27cea7d566d144389bb430739fde4f6033c4a28c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add nullptr guard to QHighDScaling::scaleAndOrigin(QPlatformScreen *)Morten Johan Sørvig2019-08-111-0/+2
| | | | | | | | | Commit b6ded193 added an unconditional dereference of the platformScreen pointer, for calls where nativePostion is non-nullptr. Change-Id: I4a6fbbd0337f91d4fcb76c17b4dc60e1b9ad10ed Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Refactor lockedAlphaMapForGlyphLars Knoll2019-08-083-38/+45
| | | | | | | | | | | | | | | Simply return a Glyph pointer and not a QImage to avoid allocating and deleting lots of d pointers for QImage when drawing text. Saves one new/delete pair per glyph drawn and speeds up text drawing by 10% for relatively large glyphs (probably more for smaller ones). The qtext::paintLayoutToPixmap() benchmark shows a 16% improvement in performance with this change. Renamed the method to glyphData(). Change-Id: I7a353de521e4f4321c770fb1ac6043d33f6f332c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Add attribution for AGLFNEskil Abrahamsen Blomfeldt2019-08-082-0/+43
| | | | | | | | We were missing attribution for the AGLFN tables. Task-number: QTBUG-70968 Change-Id: Ib84cbd25c9f7c49611761c9eba16624de5b77dd2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix crash in QTextDocument::clearUndoRedoStacks()Eskil Abrahamsen Blomfeldt2019-08-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | When calling QTextDocument::clearUndoRedoStacks() with UndoStack, there were two bugs: The first was that we were retrieving the item at "undoState" and deleting this. This is actually the upper limit of the for loop. If the stack does not contain any redos, then it would be == undoStack.size() and we would assert. If there were redos, then we would delete the item at undoState multiple times (actually undoState times). In addition, when the loop exited, we first removed the dangling pointers using remove() and then there was a weird resize() to the new size minus the old undoState. This would either assert because we tried to resize to a negative number, or it would arbitrarily remove items from the stack. [ChangeLog][QtGui][Text] Fixed a crash bug in QTextDocument::clearUndoRedoStacks(QTextDocument::UndoStack). Task-number: QTBUG-69546 Change-Id: I8a93e828ec27970763a2756071fa0b01678d2dcd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* eglfs: Fix raster windowsLaszlo Agocs2019-08-074-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | Also sanitize the initial WebAssembly hack. Both eglfs and wasm lack the concept of true raster windows. A QWindow with RasterSurface is rendered with OpenGL no matter what. The two platforms took two different approaches to work around the rest of the machinery: - wasm disabled the QOpenGLContext warning for non-OpenGL QWindows, - eglfs forced the QWindow surfaceType to OpenGLSurface whenever it was originally set to RasterSurface. Now, the latter breaks since c4e9eabc309a275efc222f4127f31ba4677259b7, leaving all raster window applications failing on eglfs, because flush in the backingstore is now checking the surface type and disallows OpenGLSurface windows. (just like how QOpenGLContext disallows RasterSurface windows) To solve all this correctly, introduce a new platform capability, OpenGLOnRasterSurface, and remove the special handling in the platform plugins. Change-Id: I7785dfb1c955577bbdccdc14ebaaac5babdec57c Fixes: QTBUG-77100 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* macOS: Don't require setting all three color buffer sizes in QSurfaceFormatTor Arne Vestbø2019-08-021-12/+0
| | | | | | Change-Id: Iaa6eb4d64f549a31aa5c53145e8b37facec4ea78 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix QPainter's ColorDodge and ColorBurn composition modesPavel Artsishevsky2019-08-021-6/+18
| | | | | | | | | | | Added checking corner cases (more specific formulas) in color_dodge_op()/color_dodge_op_rgb64() and color_burn_op()/color_burn_op_rgb64() to produce correct results for any input. Task-number: QTBUG-77231 Change-Id: I274f80b356bd4236a9176a84a95604c2eb01787a Reviewed-by: Konstantin Tokarev <annulen@yandex.ru> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QHighDPI: Fix broken scaling of QPoint(F)Friedemann Kleint2019-08-011-3/+17
| | | | | | | | | | | | | | For some reason, the overload resolution of the High DPI scale() functions introduced by b6ded193ee64ffe67df6d22e7a23aa1ea9e02ec7 chose the wrong overloads for QPointF and/or QPoint; it fell back to the generic template intended for qreal, QSize, etc, ignoring the origin. Remove the template and spell out all overloads. Fixes: QTBUG-77255 Change-Id: I5661f16f7326f65156f646f430f5a0c71d5302d2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Enable shader cache for ES2 when GL_OES_get_program_binary is presentMichael Brasser2019-07-253-3/+42
| | | | | Change-Id: I4fb71471a7dd22441def1eb837857d245c3e3c5a Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Make the warning in QBackingStore::endPaint() a little more helpfulShawn Rutledge2019-07-221-1/+1
| | | | | | | Amends 2aa9908e24611fa6d321e694b8415ba7e8d364b0 Change-Id: I2883ca27b06b2b414b4991b2dab3f84100b4c853 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Protect against integer overflow in painting transformed imagesAllan Sandfeld Jensen2019-07-191-5/+22
| | | | | | | | | Makes it safe to sample pixel coordinates above 32767. Fixes: QTBUG-76829 Change-Id: I5965afef1bd65106fcfc130dd37572309eacbe42 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Tie QPlatformOpenGLContext to its QOpenGLContext before initializingTor Arne Vestbø2019-07-171-1/+1
| | | | | | | So that the context can be referenced during initialization. Change-Id: I9ec69b2431ba1ac6256cb2e969a76f515497e247 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QPixmapCache: guard against usage from non-main threadsEirik Aavitsland2019-07-101-0/+33
| | | | | | | | | | | | | | | | | | | Depending on the active QPA plugin, QPixmaps may now be created and used also in non-main threads. But QPixmapCache is not designed to be used from such threads, so add guards to ignore such access attempts, both from application code and from Qt library code. Such unsafe access would often cause a cryptical "~QObject: Timers cannot be stopped from another thread" warning; that also disappears with this fix. [ChangeLog][QtGui][QPixmapCache] Ignore unsafe access from non-main threads Task-number: QTBUG-76694 Task-number: QTBUG-72523 Change-Id: Ia2db37e528aec08bfb48808630bdf5e543689039 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Doc: Fix incorrect enum value referenced in QImageReader::transformation()Topi Reinio2019-07-081-1/+1
| | | | | | | | And remove the \c command to enable auto-linking. Fixes: QTBUG-76878 Change-Id: Ia2352942c7e7040088347becbda07062a9544c98 Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
* Support pen color in QOpenGLTextureGlyphCacheEskil Abrahamsen Blomfeldt2019-07-052-3/+3
| | | | | | | | | This is an enabler for supporting pen color for color fonts in Qt Quick. Task-number: QTBUG-74761 Change-Id: I3e605f939e6677cbbd4a650ae7998dea8fd2d7a9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Support pen color with color fontsEskil Abrahamsen Blomfeldt2019-07-056-13/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Color fonts may also contain regular alphabet characters that should be rendered with the current pen. In Qt, however, these characters were drawn into the cache with a default pen color of black. Since all characters in a font is currently backed by the same cache, and it would require a lot of plumbing to get around this, a step in the right direction is to include the current pen color in the cache as long as it is an RGB cache. This means that drawing text with the color font with different pen colors will create different caches. There is no API to select font color on Freetype currently, but this problem has also not been observed there, as the fonts in question, with both regular and color glyphs, are not being detected as color fonts (so the text color will be correct). So Freetype will be left out for now. [ChangeLog][QtGui][Text] Fixed bug where regular text rendered with a color font would always display in black. Task-number: QTBUG-55096 Task-number: QTBUG-74761 Change-Id: Icc7dbf73241db1e7cc6a0de18c2de927aeecf713 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix crash with drag cursor handlingJoni Poikelin2019-06-281-5/+9
| | | | | | | | | 7a7c722782a435f7c01b94f48df7a5f4ff4d599e caused a regresssion in some cases. Change-Id: I1089a79534d811b195de663ff664d9ba5a6ac6c5 Fixes: QTBUG-74110 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Do not downscale png when the size is exactly rightAleix Pol2019-06-261-1/+1
| | | | | | | | | | | | | | Don't go through the doScaledRead path (i.e. calling read_image_scaled) when reading an image that the target size is the image of the file we are opening. This makes the loading of the file much faster while keeping the output correct. [ChangeLog][QtGui][QImage] Improve loading time when loading png files that have the same size as the target. Change-Id: I2a33c49fe1ce52ec296c2175ee542b5bcdec2c4b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix crash when setting QGuiApplication palette before app is availableTor Arne Vestbø2019-06-251-1/+4
| | | | | | Change-Id: Ia154f66a27cba970d179f100e66aa2daab01c9fa Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QHighDpi::fromNativePixels: use correct screenMorten Johan Sørvig2019-06-192-45/+42
| | | | | | | | | | | | | | | | Calls like QHighDpi::fromNativePixels(point, window) would return device independent coordinates outside any screen in cases where the window is spanning multiple screens and the native point was not on the main screen. Correct this by looking up the correct screen and use its scale factor and origin when scaling coordinates. Task-number: QTBUG-73231 Change-Id: I01a3a42f42121b8d9f4ced2bb0fb023d6ae6bfe7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix GCC 9's warning about deprecated violation of Rule of 5Thiago Macieira2019-06-232-6/+0
| | | | | | | | error: implicitly-declared 'QDistanceField& QDistanceField::operator=(const QDistanceField&)' is deprecated [-Werror=deprecated-copy] note: because 'QDistanceField' has user-provided 'QDistanceField::QDistanceField(const QDistanceField&)' Change-Id: Ie7ae7616eadf4035bec6fffd15aabc58e99632d9 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Release program when returning from QOpenGLTextureBlitter::create()Laszlo Agocs2019-06-191-0/+3
| | | | | | Change-Id: I27b9496f9a58ceabc613372463543068cb432bdc Fixes: QTBUG-60453 Reviewed-by: Johan Helsing <johan.helsing@qt.io>
* High DPI: Fix crash in QWindow::mapFromGlobal()Friedemann Kleint2019-06-191-1/+1
| | | | | | | | | | | With Web Engine, QQuickWidget or similar, the code can hit on the offscreen window, when its handle is null. Add a check. Amends 3af7b279177f7fb092f0e0fb9ffc8e8d846ed774. Fixes: QTBUG-76440 Change-Id: I123633d18386efd3dbfb22aad6072e4f0877a62e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add accessibility notification roleFrederik Gladhorn2019-06-122-0/+2
| | | | | | | | | | | On Linux this role is needed to make desktop notifications work. There is no equivalent for Windows, iOS or macOS. On these platforms the role will have no effect. Fixes: QTBUG-76333 Change-Id: I4ef3b3321f7a0e2c09c1ce432a668428d14c52b7 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* QVector3D: fix documentation spelling errorRichard Moe Gustavsen2019-06-191-1/+1
| | | | | | Change-Id: Id3b97ea3ce45452e0b59986bc4fd84fd9b0d3708 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QHighDpi: Replace fromNative()/toNative() with scale()Morten Johan Sørvig2019-05-141-209/+55
| | | | | | | | | | | | | | | | | | | | | | | | | We need one scale() function for each type: the scale factor can be inverted by the caller for the fromNative case. Add a generic templated implementation which will handle simple types. Add add specialization functions for compound types that don't have operator*(), as well as for position types (e.g. QPoint) which account for the origin. There's no need for fromNativePixels() and toNativePixels() overloads for each type; replace with generic implementations which call scale(). Do the same thing for fromNativeLocalPosition(). Some user code is calling fromNative()/toNative() directly, so leave a definition of those functions around for now. Also leave a couple of one-off scaling functions which do not fit the pattern. Also fix “narrowing conversion scaleFactor to int” warning for the QMargins scale function. Change-Id: Ia67accbb670a80dc1747c2e264b97aab75b1251b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix raster paint error in path joins of tightly bending bezier curvesEirik Aavitsland2019-06-141-1/+1
| | | | | | | | | | | | | | | | The code for generating round line joins is optimized with a shortcut for the inner, normally invisible joins. For certain joins of a tightly turning bezier, this optimization would lead to visible painting error. Fix by avoiding the optimization if the next control point is so close as to allow such tight turns. As a driveby, make the angle > 90 test cheaper, since absolute precision is not required in the optimization choice. Fixes: QTBUG-75008 Change-Id: I293e0776003310dc36fa7f43fbcd9c25f1f8fa5d Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Raster paint engine: optimize rect clippingLars Knoll2019-06-112-33/+54
| | | | | | | | | | | More aggressively skip processing empty spans. Tested with the qpainter benchmark on armv7; yields small but measurable improvement. Change-Id: Ie0ed0f824a0be7bcc2de3a9aa98ebccb0e8accae Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Generalize image file name @2x suffix handling to higher scale factorsEirik Aavitsland2019-06-141-4/+6
| | | | | | | | | @3x is in use on iOS already, so extend the handling in QImageReader to all single-digit factors, like QIcon does. Fixes: QTBUG-76273 Change-Id: Ic9442731c0549dbe8f797e1ddb1a09d8447e8441 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Don't count all engines as "in use" in cacheEskil Abrahamsen Blomfeldt2019-06-091-1/+1
| | | | | | | | | | | | | | | | | | | | | Back in 36cb3f3f655a9090c82de609010cbfb88651a0f3, we started properly reference counting font engines as they were entered into the font cache. Prior to this, ref.load == 0 would mean that the engine was essentially owned by the cache. When the change was made, the condition that an engine must be in use if its reference is != 0 remained, and the result of this was used to calculate the limit for when the cache should be flushed. Since this limit was miscalculated, the cache would keep growing, even if it only contained unused font engines. [ChangeLog][QtGui][Text] Fixed a bug which could cause the font cache to grow larger than it was supposed to. Task-number: QTBUG-76219 Change-Id: I4d1541756f3bdf5bd9b0301bf47c6db2e220716a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Fix: QTextDocument::find backward search crossing paragraphsEirik Aavitsland2019-06-041-0/+2
| | | | | | | | | | | | | If the start position of a backward string search was the at the start of a paragraph, the code would start searching at an illegal position (at the eol character) in the preceding paragraph. That caused that whole paragraph to be skipped, so any matches there would not be found. Fix by making sure the search starts at legal position. Fixes: QTBUG-48035 Change-Id: Id6c0159b6613ec75ec617a0a57096ceef2b4cbd0 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* doc: Correct several QEnterEvent accessorsShawn Rutledge2019-06-061-7/+7
| | | | | | | | | | | It's cursor position not widget position, pos() is relative to the widget, and 3 of these accessors return QPointF. Amends e6ddae07e1e571a7a6e0c531b961dbddcd217643. Task-number: QTBUG-36985 Change-Id: Ide437f7496824f8cdd0d03fa38ad7b573e30feaa Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* Work around crash where a destroyed window becomes focus_windowMorten Johan Sørvig2019-05-221-0/+6
| | | | | | | | | | Clear QGuiApplication::focus_window (again) in the QWindow destructor. Task-number: QTBUG-75326 Change-Id: Ief00b6adfb267fcc7e3881fd728e12df07fc1094 Reviewed-by: Christian Andersen <csandersen3@gmail.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Guard against numerical overflow when processing QPainterPathsEirik Aavitsland2019-05-151-19/+38
| | | | | | | | | | | | | Many operations on and with QPainterPaths do calculations on the path coordinates, e.g. computing the distance between points, which may cause numerical overflow for extreme coordinate values. This patch introduces a limit on the coordinate values and extends the previous check against nan/inf coordinates to also check against out of range coordinates. Fixes: QTBUG-75574 Change-Id: I3a2fa88bfc6a9f19934c43d3dbbfb41855c78107 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QDataStream: Fix inconsistent results of iostream with QPalette objectsRyan Chu2019-05-201-0/+5
| | | | | | | | | | | | The value of NColorRoles got changed since 5.11. It introduced one more role called "PlaceholderText" in the ColorRole enumeration. When using QDataStream (5.12) to read QPalette objects from a file written by 5.9 (<5.11), the processing results are inconsistent. Fixes: QTBUG-74885 Change-Id: I14d57f9603a26e5890b4fd57c7e464c5b38eb3f2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Write an anchor-type attribute when embedding images in an ODF documentAndrew den Exter2019-05-131-0/+1
| | | | | | | | Without this some readers will fail to display the image or position the image at the start of a paragraph rather than inline. Change-Id: I2b9257e3193e5e68eb20112017a0c23be1d06cb0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Avoid re-encoding embedded images when writing an ODF fileAndrew den Exter2019-05-131-19/+68
| | | | | | | | | If an embedded image is already encodeded as an png or jpg write the data as is instead of decoding to a QImage and re-encoding as a new image. Change-Id: I479ae1fddbf59900a500497dd1bdf7449c21f273 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QHighDpi: Remove fromNativePixels()/toNativePixels() overloadsMorten Johan Sørvig2019-05-221-116/+35
| | | | | | | | | | | | Replace QWindow / QScreen / QPlatformScreen overloads with template functions that take a generic context argument. The API now no longer supports implicit conversions from QPointer<QWindow> to QWindow *, add explicit data() call to usage in qxcbdrag.cpp. Change-Id: I63d7f16f6356873280df58f4e7c924bf0b0eca5b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QPA: Prevent QPlatformWindow::initialGeometry() from returning invalid ↵Friedemann Kleint2019-05-221-3/+9
| | | | | | | | | | | | | | | | | geometries When trying to find the screen, the function would always try to determine the screen by checking parents, despite QWindowPrivate::positionAutomatic being false. Determine the screen from the initial geometry when QWindowPrivate::positionAutomatic is false. Bail out when positionAutomatic and resizeAutomatic are false. Fixes: QTBUG-75940 Change-Id: I3cd1b16feab16c89d29856cf3e1bccf2c89280c7 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* QHighDpi: Simplify top-level window handling codeMorten Johan Sørvig2019-05-142-40/+29
| | | | | | | | | | | | | Introduce origin(QWindow *), which returns the point around which coordinates should be scaled: the screen origin for top-level windows, and (0, 0) for child windows. The code paths for top-level and child windows can then be combined. Change-Id: I6b9cdbd9e7c2d9406e9137e325c4eb5c79e3ac9a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QMenu: show shortcuts in context menus by defaultRichard Moe Gustavsen2019-05-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change c2c3452ba introduced a new API in Qt to let QPA inform whether or not shortcuts should be shown in context menus. This was set to false by default, since by observation, this seemed to be the most common behavior across platforms. The problem is that it left no way for the application to override it; The attribute Qt::AA_DontShowShortcutsInContextMenus simply doesn't work when shortcuts are always off. And for some application, showing shortcuts is not just a matter of look-and-feel, but also important information to be able to use the application the way intended. This patch reverts the behavior back to how it was in Qt-5.9, where shortcuts where shown by default (except on macOS where we still keep them off). It's no so much because the "always off" logic is wrong, but because there is no (easy) way/work-around for an app developer to switch them back on (until Qt-5.13, where a new API is introduced to fix the situation: b1a9a77). And this lack of API can be a show-stopper for some when upgrading from e.g 5.9 LTS to 5.12 LTS. This downside of this patch, OTOH, is that it can cause more change that what is normally wanted in a patch release. But out of two evils, this is the best option. Those that wan't to hide shortcuts can set AA_DontShowShortcutsInContextMenus to true, which now will work. [ChangeLog][QtWidgets][QMenu] Shortcuts are again shown by default in context menus, except on macOS. They can be forced off by setting AA_DontShowShortcutsInContextMenus to true. Fixes: QTBUG-69452 Change-Id: Ibcc371395944ac5b19b1d20889940da271bf73d5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Fix QRasterBuffer::scanLine miscalculation with big imagesJoni Poikelin2019-05-141-1/+1
| | | | | | | | | | scanLine is overflowing with big images. Similar change was made in 4f88475a962975ca45994cff9add350344fce4f9 to fix the same issue with QImage::scanLine. Fixes: QTBUG-75082 Change-Id: Ifedf28fa9a303c189dfcd12bd4ec11f438540c2e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix QWindow::mapToGlobal()/mapFromGlobal() for multi-screen windowsMorten Johan Sørvig2019-05-134-4/+56
| | | | | | | | | | | | | | | | | | Make these functions handle the case where a window spans multiple screens, and high-DPI scaling is enabled, and the local position (in the window) is not on the window primary screen (as returned by QWindow::screen()). This is done by detecting the case, and then calculating the correct position using the native coordinate system. [ChangeLog][QtGui] QWindow::mapToGlobal()/mapFromGlobal() now handle windows spanning screens correctly. Done-with: Friedemann Kleint<Friedemann.Kleint@qt.io> Task-number: QTBUG-73231 Change-Id: I3c31b741344d9e85e4f5d9e60bae75acce2db741 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add unvectorized fallback in case FP exceptions are not maskedAllan Sandfeld Jensen2019-05-101-0/+18
| | | | | | | | | | If an application enables FP exceptions our FP-based unpremul will raise the INVALID exception. Since disabling them locally might be slow just take a slow path when detected. Fixes: QTBUG-75592 Change-Id: Ie22a032a4f62229f68ad21ede359c62291adc9bf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix possible endless loop when stroking curvesEirik Aavitsland2019-05-081-3/+3
| | | | | | | | | | | The bezier shifting algorithm compared coordinates exactly, and so could end up in an endless loop when values were at the edge of the number resolution. Fix by using fuzzy comparison instead. Fixes: QTBUG-75522 Change-Id: I61346edbd87389f66965a906ac337fc1f5300e5c Reviewed-by: Robert Loehning <robert.loehning@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix swizzling when rendering QPainter on QOpenGLWidget with AngleDmitry Kazakov2019-05-071-13/+31
| | | | | | | | | | | | | OpenGLES specification does not support GL_TEXTURE_SWIZZLE_RGBA, it supports only per-channel calls. And since Qt supports QpenGLES, it should use the latter approach only. The regression was introduced in Qt 5.12 by commit ede3791df8330ed8daae6667d025ad40219a9f5f Task-number: QTBUG-74968 Change-Id: I9c531b248715992fb30df6af95dfa605e2ee2a25 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix QTextEngine::shapeText casing of surrogate pairsJüri Valdmann2019-05-071-1/+2
| | | | | | | | | The high part was not copied to output. Fixes: QTBUG-75559 Change-Id: I9350e52d256510f52b3fcc0015bf879d2c609532 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>