summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* doc: Add missing override and remove redundant virtual for snippetsAlexander Volkov2018-08-1610-21/+21
| | | | | Change-Id: I2395fd01b93c4ea364225e0cf1a5f59908b691d0 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Fix potential crash when showing line/paragraph separatorsEskil Abrahamsen Blomfeldt2018-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | When showing line and paragraph separators at an offset from the start of the string, the end of string pointer would be incorrectly set, and we would read past the end of the string. If any part of this memory happened to match the line or paragraph separator, then we would overwrite it and have a crash. I couldn't find any reliable way to test this, since the crash depends on the contents of the memory after the string allocated by the algorithm. But with an overflow of 100 000 characters, I found that it crashed every time I ran the test. [ChangeLog][QtGui][Text] Fixed potential crash when using QTextOption::ShowLineAndParagraphSeparators. Task-number: QTBUG-69661 Change-Id: I17d1996b883560bacdc7ce114c8aeb2b0108faea Reviewed-by: JiDe Zhang <zccrs@live.com> Reviewed-by: Michal Lazo <xlazom00@gmail.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Add QPlatformScreen::windows() helper to return all windows on screenTor Arne Vestbø2018-08-062-9/+17
| | | | | Change-Id: Ib55b37b64ed0890ca777dfea8c4d702e267c34bf Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Use consistent naming of QPA screen change callbacks in QGuiApplicationTor Arne Vestbø2018-08-062-12/+12
| | | | | | Change-Id: I76be8a993e5d71e472faf9a5770b4c1128e8a4c6 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Doc: Fix wrong link in QFont documentationPaul Wicking2018-08-031-1/+1
| | | | | | Task-number: QTBUG-62072 Change-Id: I587534fc5723b3d198fe2065fbcf1bee4871a768 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
* Fix conversion from transparent indexed8 to RGB32Allan Sandfeld Jensen2018-08-031-2/+3
| | | | | | | | A typo meant the color-table was not fixed. For safety fallback colors are also made opaque. Change-Id: I3e609882177604910c4343c86f00221a89af9078 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Optimize blits of any compatible formatsAllan Sandfeld Jensen2018-08-032-2/+120
| | | | | | | | | | | The fast image blending is only used for SourceOver composition, but several of our embedded backends make heavy use of Source composition which doesn't have a short-cut. This patch adds a blitting short cut that works in those cases. Task-number: QTBUG-69724 Change-Id: Icc61a67cc27bc83863153d69cae60dd986d26f69 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add missing optimization for loading RGB32 to RGBA64 using NEONAllan Sandfeld Jensen2018-08-031-0/+61
| | | | | | | | | | The rest of the RGB64 routines were optimized, but the loading of RGB32 was not as it was originally not used much, but with ARGB32 using the RGB64 backend, it is essential for decent performance. Task-number: QTBUG-69724 Change-Id: I1c02411ed29d3d993427afde44dfa83689d117e0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix crash in qppmhandler for certain malformed image filesEirik Aavitsland2018-08-031-1/+1
| | | | | | | | | | The ppm format specifies that the maximum color value field must be less than 65536. The handler did not enforce this, leading to potentional overflow when the value was used in 16 bits context. Task-number: QTBUG-69449 Change-Id: Iea7a7e0f8953ec1ea8571e215687d12a9d77e11c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* HiDPI: Fix calculating window mask from pixmap on drag and dropBłażej Szczygieł2018-08-021-1/+8
| | | | | | | | | | | Use platform window directly for setting a mask to prevent bitmap scaling if pixmap and window DPR are the same. Amends: 42f788ffe26d67864d569c3a3044619d49fc693a Task-number: QTBUG-61948 Change-Id: I5eec85c01f20bdefff7343e83ff10cbcb2c79508 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Doc: Remove typo and add line breaks after \internalPaul Wicking2018-07-262-4/+10
| | | | | | | | | In an unrelated change, it seems \internal \obsolete can cause unexpected behavior when generating the documentation. Adding this line break should fix that. Change-Id: I95eceb109faaf89be8f258fba8c31008fdc4ca57 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Replace 0 with nullptrAlbert Astals Cid2018-07-195-5/+5
| | | | | | | | So if people are using the -Wzero-as-null-pointer-constant don't get a warning when using these private QPA includes Change-Id: I6deb089b17a844680db24998d60c94de7a1227b1 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* Fix incorrect warning message in QOpenGLBufferTakumi ASAKI2018-07-171-1/+1
| | | | | | Change-Id: I932aa10814049e78da35ea12b7552bf676545c89 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix: png handler returning Mono QImage with color table < 2 itemsEirik Aavitsland2018-07-161-1/+1
| | | | | | | | | | A bit depth 1 png image may contain a single color table item. The png handler would in such cases reduce the size of the QImage color table to 1, which could easily lead to crashes later on. Task-number: QTBUG-69256 Change-Id: I01d78977c121bacc44b823231d8f32ca63d8a98c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix the copyright year of the qgrayraster.c dependencyNicolas Ettlin2018-07-101-1/+1
| | | | | | | | | | The copyright year of the qgrayraster.c dependency was incorrectly set to “2006-2015”, instead of 2000-2016 (as stated in the file’s header comments). This commit solves this issue. Task-number: QTBUG-69261 Change-Id: I307b6eabdd133fe4f8371b963577b59af8620838 Reviewed-by: hjk <hjk@qt.io>
* Fix: bad-looking scaled rendering of painterpath in OpenGL paint engineEirik Aavitsland2018-06-281-21/+17
| | | | | | | | | | | | | | | For performance, the triangulation of a painter path is stored for reuse. Re-triangulation was only done if the path was to be painted at a significantly different scale AND it contained a curve (bezier) element. But also the triangulation of a path with only straight lines can lose precision if rendered at a small scale, and so look bad when used at a higher scale factor. Fix by removing the mentioned curve element condition. Task-number: QTBUG-68873 Change-Id: Id3492514e9382a5828377b7bafea8cfac7b850a6 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* ItemModels: Cache last-known child indexErik Verbruggen2018-06-272-11/+25
| | | | | | | | | | | | | | | Instead of caching the last index of a search for a child item, cache the index of the child in the child item. When the item model is not changed, the index is valid. Otherwise, the index can only change when items get inserted or removed before the child. So in that case, start searching in the vicinity of the previously known index. As an example: a selectAll() on the view will always hit the cached index, so no search is performed for any item in the model/view. Task-number: QTBUG-61368 Change-Id: I85d085299987237fae23451d9e8bbb6060464ef2 Reviewed-by: David Faure <david.faure@kdab.com>
* ItemModels: search for the child index in 2 directionsErik Verbruggen2018-06-271-7/+29
| | | | | | | | | | | | | | | Previously, the search for the index of a child was done by searching forwards (minus 2) from the last search, and subsequently backwards when it wasn't found. This would cause quite some searching in models with lots of items, and where the child lay before the last search. We still assume that subsequent searches for children are "nearby" the previous search, but instead of first searching forwards and then backwards, do the search in both directions. Task-number: QTBUG-61368 Change-Id: Idb549c2d02840632cd658f906816ce911f3ff8bc Reviewed-by: David Faure <david.faure@kdab.com>
* Doc: Fix typoPaul Wicking2018-06-261-1/+1
| | | | | | Task-number: QTBUG-69093 Change-Id: Ica63482251b2a614a17a996fac9bcc16b96c200f Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Fix the qHash implementation for QMatrix / QTransformGiuseppe D'Angelo2018-06-212-15/+15
| | | | | | | | | | | | | | | The order of the arguments of QHashCombine::operator() was accidentally swapped -- the first is supposed to be the accumlated value, the second the new value to combine. [ChangeLog][QtGui][QMatrix] The qHash() implementation for QMatrix has been changed. [ChangeLog][QtGui][QTransform] The qHash() implementation for QTransform has been changed. Change-Id: Iba13f76ff734a2184c96184ee0e5748c05db07fa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Add missing full stops in briefsPaul Wicking2018-06-215-5/+5
| | | | | | Task-number: QTBUG-68933 Change-Id: I3f2a9f8c562f9a44bb32bddd31d75abbfe6de04d Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Merge remote-tracking branch 'origin/5.11.1' into 5.11Qt Forward Merge Bot2018-06-191-3/+11
|\ | | | | | | Change-Id: I9a4571ccf826a86e055dfbba23b5e5cbd8ea55e8
| * Merge 5.11 into 5.11.1Oswald Buddenhagen2018-06-075-11/+12
| |\ | | | | | | | | | Change-Id: I28f48e980a9e23ddde5251608dd9d1d83df65392
| * | Ignore XDG_SESSION_TYPE=wayland on gnome-shellJohan Klokkhammer Helsing2018-06-051-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][Wayland] In Qt 5.11.0, support for selecting a platform plugin based on the XDG_SESSION_TYPE environment variable was added. On gnome-shell, however, bugs—in both Qt and gnome-shell—made many widget applications almost unusable. So until those bugs are fixed XDG_SESSION_TYPE=wayland is now ignored on gnome-shell. Task-number: QTBUG-68619 Change-Id: I902acd1c4fc996f46e8431c12c0a5cdbab883abf Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Fix black border around main widget with non-integer scalingAllan Sandfeld Jensen2018-06-071-1/+1
| |/ |/| | | | | | | | | | | | | | | All the other highdpi scaling uses rounding, and not using it here may offset the compositing by a line. Task-number: QTBUG-67994 Change-Id: I2f5f328c091d0e85c40b1663e22c82f364df65e5 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | Fix build for Android with android-clang in r17Liang Qi2018-06-063-7/+7
| | | | | | | | | | | | Task-number: QTBUG-67464 Change-Id: Ib971a5da82b31bce9ac1c9ac623ad7d5302cfaec Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Fix HDR format in QOpenGLFramebufferObject::toImage()Allan Sandfeld Jensen2018-06-061-2/+5
| | | | | | | | | | | | | | | | If the fbo had samples > 0 set, it would use a temporary fbo with a default configuration losing the HDR precision. Change-Id: I7e9966165b3100f148c4ad24738f3ee71273f29a Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Fix QTransform::transposed() result having wrong transformation typeEirik Aavitsland2018-06-061-2/+0
|/ | | | | | | | | | The implementation of QTransform::transposed() had a wrong assumption about the type of the result. Task-number: QTBUG-68630 Change-Id: Ia5ce794efe773d74fb5fdaff3da8cae2b452e7e5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Reduce recent performance regressionAllan Sandfeld Jensen2018-05-301-2/+2
| | | | | | | | | | | | | | The change to fix 16-bit integer overflow used two floor operations when only one is necessary. With floor being rather expensive on x86 without SSE4.1 this caused a performance regression in ARGB32 smooth perspective transforms. This eliminates one of the floor operations which is unnecessary as the number is always positive in this case and thus truncation will yield the same result faster. Change-Id: Iaae76820d4bc2f368e49ed143130b5075fc760a2 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QOpenGLTexture: Enable multisample 2D textures on GLES 3.1+Laszlo Agocs2018-05-301-0/+6
| | | | | | Task-number: QTBUG-68510 Change-Id: Ib224189906b595bbae5aab95c888dd13e94171aa Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Make sure we can build with -no-feature-draganddropJoerg Bornemann2018-05-2923-315/+410
| | | | | | | | | We move QInternalMimeData to a separate file, because this class is used, even if draganddrop is disabled. From now on, include qinternalmimedata_p.h instead of qdnd_p.h for QInternalMimeData. Change-Id: I594e08e2e90d574dc445119091686b4b69e4731b Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Fix potential 16-bit integer overflowAllan Sandfeld Jensen2018-05-231-4/+4
| | | | | | | | | | | When multiplying a float in [0;1[ with (1<<16), with rounding, it might end up being rounded to 65536 even if the input was under 1. This patch uses a floor operation to make sure the value can be in a ushort, and cleans up the surrounding code so it is clearer what it does. Task-number: QTBUG-68360 Change-Id: I2d566586765db3d68e8e7e5fb2fd1df20dabd922 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Documentation: Fix URLs to GL(ES) functionsFriedemann Kleint2018-05-181-358/+358
| | | | | | | | Replace the XML pages which are typically displayed as broken by the XTHML pages. Strip some suffixes. Change-Id: Idf2b9706f169484c659582a1a2d38904d5dd81aa Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QtGui: Enable synchronous delivery for QWSysIf:::WindowScreenChangedEventFriedemann Kleint2018-05-082-2/+4
| | | | | | | Task-number: QTBUG-67777 Change-Id: I6d52b650fb33283010ef06259da83cdb2fd3483f Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QShortcutMap: print ambiguous shortcuts when DEBUG_QSHORTCUTMAP is definedMitch Curtis2018-05-071-0/+13
| | | | | | | | | | | | | This is useful to see why shortcuts (in Qt Widgets and Qt Quick) are not behaving as expected. For example: The following shortcuts are about to be activated ambiguously: - QKeySequence("Esc") (belonging to QQuickShortcut(0x7fcd4c8e6a70, name = "exploreViewBackOrCloseShortcut")) - QKeySequence("Esc") (belonging to QQuickPopupItem(0x7fcd4c8e5110)) Change-Id: Id20a3017d69cfe417c2286dccf46b3d5ff0b31b2 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix for mouse with modifiers handlingKarim Pinter2018-05-022-23/+2
| | | | | | | | | | | | Modifier keys are saved in qinputdevicemanager such way that both evdev and libinput can use it the same way, it is also handling the repeating modifier key events. Evdev support is important for VxWorks support because it is using it. Task-number: QTBUG-60694 Change-Id: I49038cb7fe2ad5134b3a37167c19953867ea31c3 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Don't crash on <br> following a <table>Allan Sandfeld Jensen2018-04-251-4/+6
| | | | | | | | A <br> has a new-line but no text, so be able to handle no lines. Task-number: QTBUG-60853 Change-Id: I3d4dbd529114bbe8afe760c3622b52446202ec7c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix division by zero in radial gradiants with NEONAllan Sandfeld Jensen2018-04-241-0/+5
| | | | | | | | | The NEON implementation uses rsqrt and thus can not be taken on 0, so replace the minimum with something close to zero instead of zero. Task-number: QTBUG-59961 Change-Id: Ia39e45be675b056c1e22900495ce9ba4e8b70e5f Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* QStyleHints: emit correct signal when calling setMouseQuickSelectionThresholdAkihito Izawa2018-04-131-1/+1
| | | | | | Change-Id: Ieb76ecc406c25ca11a108775ebd46a8e597401b5 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
* PDF engine: handle abnormally long string casesEirik Aavitsland2018-04-121-5/+10
| | | | | | | | | | The output routine used a fixed size scratch buffer, with no attempt to handle overrun. Add a simple fallback code path for such (extremely rare) cases. Task-number: QTBUG-66788 Change-Id: I52531b829baeaa48a8fb5a637a020ee9f89d270a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Fix crash if QPixmap::defaultDepth() is called when no QGuiApplicationEirik Aavitsland2018-04-121-1/+7
| | | | | | | | | | This static method can be called before QGuiApplication is created. At that point there is yet no primary screen, so the implementation needs to guard against dereferencing a nullptr. Task-number: QTBUG-67309 Change-Id: I6b7b9e97b1c3c79bf2f9c6d6247c3b10f39f7a55 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove last uses of interpolate_4_pixels_16 on SSE2 and NEONAllan Sandfeld Jensen2018-04-112-53/+52
| | | | | | | | | | | | With SSE2 or NEON interpolate_4_pixels is faster than interpolate_4_pixels_16, and using it saves a branch of duplicated code. Similar changes had already been done other places it was used, those have been updated to follow a similar logic. Change-Id: I040d96480f7f925f659602f66f931d28b59312a5 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Enable BuiltIn input in the shader graph builderJuan Jose Casafranca2018-04-102-0/+5
| | | | | | | | BuiltIn inputs shouldnt be translated into a code input. We comment the input line for this variables Change-Id: I3b7d2fd06afc6a122d90a999fc5a5246fc93234e Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* configure: make plain -xcb switch effectiveOswald Buddenhagen2018-04-101-1/+1
| | | | | | | | | | | the option is a quad enum, with "yes" meaning "either system or qt". the distinction is made only in the "system-xcb" feature, while "xcb" itself must be forced on in the "yes" case. Task-number: QTBUG-67251 Change-Id: Ib706e79a902ae0f1b64ca6d4611c9214b7b7e928 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Fix integer overflow (1 << 31)Mikhail Svetkin2018-04-091-1/+1
| | | | | | | | | | On platforms where integer by default is int32(max is 2147483647) and (1 << 31) will be 2147483648 Change-Id: I59ccb5344d5ad7d085f01bbc7cebdf6152ff7755 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QOpenGLTexture: Set wrap mode if NPOT textures are not fully supportedJohan Klokkhammer Helsing2018-04-061-0/+12
| | | | | | | | | | | | | | | | | | The OpenGL wrap mode defaults to GL_REPEAT although it is not supported for non-power-of-two textures on hardware that only has limited support. I.e. the following would create a texture with an invalid wrap mode: auto *t = new QOpenGLTexture(QOpenGLTexture::Target2D); t.setSize(123, 456); This patch adds a check in QOpenGLWindow::setSize to see if it's called with a non-power-of-two size on hardware without full support, and if so sets wrapMode to ClampToEdge (which should work on devices with limited support). Task-number: QTBUG-67418 Change-Id: I56e9f4383dbf5430c2bc5e4e9e585712b3603c13 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Pass on local html links with a fragment to openUrl()Andy Shaw2018-04-061-2/+5
| | | | | | | | | | | | If a file link to a html file has a fragment part included then this will be lost when passed to QDesktopServices::openUrl() as this is not kept in the conversion of the QUrl. So by checking the filename in the case of a fragment existing in the url, we can be sure that the information is passed on correctly for html files. Task-number: QTBUG-14460 Change-Id: I8167d8c164713dd999603ba9e74150f4f1a4abea Reviewed-by: David Faure <david.faure@kdab.com>
* Fix visual artifacts in diffuse image dithering (the default)Eirik Aavitsland2018-04-061-4/+8
| | | | | | | | | | The distributed error fractions in the Floyd-Steinberg dithering algorithm were not computed precisely. In particular, rounding errors could be accumulated, leading to visual artifacts. Task-number: QTBUG-67425 Change-Id: I77b48c3cab3e66ca161721d14b58fcc4188e74a8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Doc: Remove section about Qt Gui in Qt 4 from overview pageKai Koehne2018-04-061-13/+0
| | | | | | | | | | Qt 5 is now old enough that the delta to Qt 4 doesn't need to be on the central module page anymore. This is best left to https://doc.qt.io/qt-5/portingguide.html Change-Id: If65ef91765e1aca37fd7f107c2334ac65e403cd3 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Parse XDG_SESSION_TYPE and use that to determine default platformAllan Sandfeld Jensen2018-04-041-0/+15
| | | | | | | | Makes Qt application try to launch using wayland in a wayland session, even if it was a default desktop build. Change-Id: Ib7d4a79fbe777527d1862bd775627afae10b1e9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>