summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* Improve support for QImages in QDataStream read transactionsEirik Aavitsland2018-10-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | QImage's operator>>(QDataStream&) did not set an error mode on the stream on read failures. That would break QDataStream transactions. Since the current QImage serialization cannot differentiate between truncated and corrupted data, we set the ReadPastEnd error as expected by the transaction system. Also specify the expected file format on decoding QImage from stream, to avoid all the format handlers' canRead() being invoked. This is necessary since some of them may call ungetChar(), which fails when the stream is in a transaction. Also add testing of this feature to the QDataStram transaction autotest. That required a slight rewrite of the fake sequential QIODevice subclass. The previous implementation had incorrect behavior of peek(), which is required by QImage decoders. Task-number: QTBUG-70875 Change-Id: If3f1ca7186ad1e6ca0e6e8ea81d2b2fbece6ea01 Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* wasm: fix wasm shader compileLorn Potter2018-10-152-2/+20
| | | | | | | | This fixes qopenglwindow shader in the triangle Task-number: QTBUG-67338 Change-Id: I8552183bf9ca45e9b56760b340d014ddd34c21f4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QImageReader: add tracepoints for image loadingGiuseppe D'Angelo2018-10-142-1/+16
| | | | | Change-Id: I5fe25793eeda01a4fa1658091890af23f66b7089 Reviewed-by: Rafael Roquetto <rafael@roquetto.com>
* QImageWriter/QPNGHandler: Quality option should be CompressionRatioAlexandra Cherdantseva2018-10-141-19/+31
| | | | | | | | | | | Wrong option was used to set zlib compression level for png setCompression with negative value uses default compression setCompression with value between 0-100 converts to zlib compression level 0-9 setCompression with positive value overrides Quality option Change-Id: Ic4b048a1e30d6940019c2a00a6c24d0c11e3f821 Reviewed-by: Alexandra Cherdantseva <neluhus.vagus@gmail.com> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* QCss: properly parse functions which contains additional spacesChristian Ehrlicher2018-10-121-1/+3
| | | | | | | | | | | | When there were additional spaces between the function definition and the first parameter, the parser failed to parse it when it contained another function (e.g. 'qlineargradient(... rgb() ...)'). The reason for this was that ::until() needs the function at index-1 so it can correctly count the opening parenthesis. Fixes: QTBUG-61795 Change-Id: I992f556e7f8cd45550f83bc90aa8de2b4e905574 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QPixmap: use rvalue moreAnton Kudryavtsev2018-10-101-3/+2
| | | | | Change-Id: Ifb8c014abf6e02dc782fab2d653e4edfc4972125 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add missing null checks after detachAllan Sandfeld Jensen2018-10-101-2/+14
| | | | | | | | | A few places we didn't check if detach() succeeded including in reinterpretAsFormat(), where it can be undone. Task-number: QTBUG-70785 Change-Id: Ibcc8e26e2961f6288eb7a045ae1cb28e59213a49 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Add NEON optimized ARGB32 unpremultiply routinesAllan Sandfeld Jensen2018-10-093-27/+158
| | | | | | | | Mirroring similar routines recently added for SSE4.1 Change-Id: Ibb9d10cc34655ce1dc0e97fdff4e4f6a81d47d05 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-10-081-8/+6
|\ | | | | | | | | | | | | Conflicts: src/corelib/tools/qtimezoneprivate.cpp Change-Id: Icbb5999d378711ce3786a4fe0aba176a45ac702c
| * fix HTML subset documentation is not very readable on smaller screensAndrew O'Doherty2018-09-301-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When viewing "Supported HTML Subset" documentation in Qt Creator (in QTextBrowser), the first table that lists all tags is quite unreadable (see images). It happens because there is a code snippet in Comment column for tag "meta" that uses pre-formatted text. Because it should not be wrapped automatically, it ends up pushing first 2 columns into their minimum size, which mostly makes them take a single letter per row. Task-number: QTBUG-64126 Change-Id: I08bf6f61806d52e7a2f47bdbed1b5950825ce739 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* | Optimize gamma-table lookup on SSE2 and NEONAllan Sandfeld Jensen2018-10-051-34/+122
| | | | | | | | | | | | | | Speeds up gamma-corrected text rendering. Change-Id: I38c12ff52f4601853c3f3524de2761a932111160 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
* | QLineEdit: Disable input methods for password unless IME supports hidden textFriedemann Kleint2018-09-293-15/+19
| | | | | | | | | | | | | | | | | | | | Move the checking logic from QGuiApplicationPrivate::_q_updateFocusObject() to QInputMethodPrivate::objectAcceptsInputMethod(), which is also called from QWidget::updateMicroFocus() via QInputMethod::update(). Fixes: QTBUG-56767 Change-Id: Ia4cce5e7e766008df891537048d5daf739c010ff Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* | QOpenGLShader: report geom. and tess. on GLES 3.2+Laszlo Agocs2018-09-281-44/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also fix up the docs. To make everything more complicated, OpenGL ES 3.2 does not support default tessellation levels. Therefore the related functions remain OpenGL 4.0+ only. [ChangeLog][QtGui] QOpenGLShader has been fixed to expose geometry and tessellation evaluation/control shaders with OpenGL ES 3.2. Task-number: QTBUG-66074 Change-Id: I2e4277912800d8302824e3fb74f61ec16f4b341d Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Merge "Merge remote-tracking branch 'origin/5.11' into 5.12" into ↵Liang Qi2018-09-271-0/+2
|\ \ | | | | | | | | | refs/staging/5.12
| * | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-09-271-0/+2
| |\| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qconfig-bootstrapped.h src/widgets/util/qcompleter.cpp Change-Id: I4f44f0f074982530f2f2e750ce696230b2754cf3
| | * Disable RGB64 backend for ARGB32 when it will be very slowAllan Sandfeld Jensen2018-09-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a speed regression on ARGB32 painting on low end hardware introduced when it was switched to using the RGB64 raster routines. It turns out several of our embedded QPA targets use ARGB32 as native format. Task-number: QTBUG-69724 Change-Id: I6d7993c12da46a85b8354eb905930dae9602b5e6 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | Fix crash when detaching dangling QTextCursorEskil Abrahamsen Blomfeldt2018-09-271-1/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a QTextCursor survives its QTextDocument, the internal QTextDocumentPrivate pointer is set to null. There are checks for this in all the QTextCursor functions to skip out early if such a QTextCursor is used. However, when executing the "if (d->priv)" condition in setters, this will access the non-const operator->() of QSharedDataPointer and detach the QTextCursorPrivate, and in the copy constructor of this class, there was an unprotected call into priv->addCursor(). In theory, we could cast all the checks for d->priv to avoid detaching, but in practice this doesn't matter, since the setters will typically detach anyway later on. [ChangeLog][QtGui][Text] Fixed a crash that can happen when calling a setter on a QTextCursor after its QTextDocument has been deleted. Task-number: QTBUG-70293 Change-Id: I8f6dc5bb344d1d824f673c0c220b68b7fee237a8 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | Fix typos in the documentationAleix Pol2018-09-252-2/+2
| | | | | | | | | | | | | | Returnes -> returns Change-Id: I52372488a16d7c13e85fca0e11eaab738db9355d Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
* | More fixups for GL_CONTEXT_LOSTAllan Sandfeld Jensen2018-09-253-3/+30
| | | | | | | | | | | | | | | | | | | | Fixes the rest of the places we use the pattern of emptying the OpenGL error stack to be able to handle GL_CONTEXT_LOST, and adds a note about it in the documentation. Change-Id: I7eb97dbca45f39295b832d44937023b538b19947 Reviewed-by: David Edmundson <davidedmundson@kde.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | Android: add support for custom buttons in native MessageDialog helperShawn Rutledge2018-09-252-3/+56
| | | | | | | | | | | | | | | | | | New API in QMessageDialogOptions and implementation on Android. Task-number: QTBUG-35545 Change-Id: I59567251199f220862d01ba76979266379eecd86 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | QImageWriter: Fix default compressionratioEirik Aavitsland2018-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Before asking a image format handler to save an image, QImageWriter sets the value of all supported options. For options like quality and gamma, the default value is an illegal value (-1 and 0.0 resp.), effectively telling the handler that the application has not requested any particular value. But in the case of compressionratio, the default was 0, a legal value. Fix by changing it to -1. Change-Id: Iad6d4c2dbe269b25863e7d4967aa9ed2a7d1247f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | QPainter cosmetic stroker: Fix painting error for FlatCap linesEirik Aavitsland2018-09-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initialize the lastDir properly, to avoid the stroking algorithm doing direction-change handling for a single line. That could cause a cap to be painted for a single FlatCap line. Also fixes a bug in tst_qpainter, revealed by the above fix. The result drawPolyline was erroneously compared to the result of drawing the lines individually, for a case where the former correctly paints the pixel of the join point in the corner, while the latter by coincidence used to paint the same pixel as a cap because of the bug above. Task-number: QTBUG-70101 Change-Id: Ie20eda33214cfe9e7627f17ef4c7a5b3835c9c24 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-09-141-0/+2
|\| | | | | | | Change-Id: Ic4c1a8041dcfd143861c39e0014fbdaaa3fb25c6
| * bmp image handler: check for out of range image sizeEirik Aavitsland2018-09-111-0/+2
| | | | | | | | | | | | | | | | Make the decoder fail early to avoid spending time and memory on attempting to decode a corrupt image file. Change-Id: I874e04f3b43122d73f8e58c7a5bcc4a741b68264 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Fix spelling mistake in qimage.hTor Arne Vestbø2018-09-131-1/+1
| | | | | | | | | | | | Change-Id: I2138318894587cc0b5f03af14a57b2a39509f0da Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Texture file support: add mipmap reading to ktx handlerv5.12.0-alpha1Eirik Aavitsland2018-09-121-10/+20
| | | | | | | | | | Change-Id: Ic2c10b3e64d63d2272a8a3922d2b3f99dfd45bdb Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | QVulkanWindow: Fix some load/store ops in the default renderpassLaszlo Agocs2018-09-121-2/+2
| | | | | | | | | | | | | | | | Stencil is - very likely - cleared just like depth. Also, switch to STORE_OP_STORE for the multisample buffer, for correctness. Change-Id: I31b56658286205af8551018115ca2abbe541be67 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | QVulkanWindow: Fix bogus stage masks in readbackLaszlo Agocs2018-09-121-1/+1
| | | | | | | | | | Change-Id: I08882a02204c95272b100647923c9903f825912c Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Fix device local alloc in hellovulkantextureLaszlo Agocs2018-09-121-0/+5
| | | | | | | | | | | | | | | | | | | | Running with QT_VK_FORCE_STAGE_TEX does not work at all with recent NVIDIA drivers due to QVulkanWindow's and the example's naive way of picking the memory index. Enhance this and add a warning note to the QVulkanWindow docs as well. Change-Id: I7f200e11d982b56e3da3b71ee3915bd7bfca5cc1 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* | Add optimized fetch ARGB32 routines for NEONAllan Sandfeld Jensen2018-09-122-0/+20
| | | | | | | | | | | | | | | | After convert and fetch were split, only convert was still NEON vectorized, while fetch is the more commonly used version. Change-Id: Iea2af7ccee6589b3d6e9908afeaae2d1ad2753be Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | Doc: Fix typo and add precision to method descriptionPaul Wicking2018-09-121-2/+3
| | | | | | | | | | | | | | | | | | As transform() returns worldTransform(), point out that it is an alias in its description. Fixes: QTBUG-18117 Change-Id: I0eb1f78c6955b499906024105f9969cdccf13303 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-09-102-0/+6
|\| | | | | | | | | | | | | Conflicts: mkspecs/common/macx.conf Change-Id: I8576493b417912fa5e5501bc2c1b935d186ac209
| * Merge remote-tracking branch 'origin/5.11.2' into 5.11Qt Forward Merge Bot2018-09-092-0/+6
| |\ | | | | | | | | | Change-Id: I2fa26fa061cbf5d2bded203a299a19b7d1c31d0a
| | * Merge 5.11 into 5.11.2Frederik Gladhorn2018-08-271-2/+2
| | |\ | | | | | | | | | | | | Change-Id: I672bc167de3801c944315d92120c5e03da69e9c7
| | * | Fix crash when combining QOpenGLWidget, QStaticText and Qt QuickEskil Abrahamsen Blomfeldt2018-08-242-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under certain circumstances, if you had a widget with a QOpenGLPaintEngine, and drew QStaticText into this, and then later had Qt Quick access the same cache and try to resize it, we would get a crash because the resize function would have a pointer to the paint engine and try to access its shader manager (which would now be null, since this is outside the begin()/end() phase of the paint engine. The solution is to reset the paint engine pointer to null on the cache once it has been populated and it is no longer needed. [ChangeLog][QtGui][Text] Fixed a possible crash when combining QStaticText, QOpenGLWidget and Qt Quick in the same application. Task-number: QTBUG-70096 Change-Id: I7383ad7456d1a72499cfcd2da09a5a808d4b3eff Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | | Update QOpenGLContext::currentContext after QPlatformOpenGLContext::makeCurrentTor Arne Vestbø2018-09-091-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of doing it up front and then restoring the current context if the makeCurrent call failed. By delaying the update, QPlatformOpenGLContext::makeCurrent has the option to check which context was current before the call. Change-Id: I458f5c00d7c820acbe2f8552b0513fce99b9b683 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | | Graph loader can load prototypes stored in the graphJuan Jose Casafranca2018-09-083-2/+22
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ib0bbfe5b0257bf355e83cc5287fa52b1e0cc3ed6 Reviewed-by: Mike Krus <mike.krus@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | | Make QOpenGLContext::makeCurrent use early exit for all its flowTor Arne Vestbø2018-09-081-44/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The case of the platform context failing makeCurrent is the exception. Change-Id: I606e6fb379f84e886bff9e27355dda9b31ff9ebe Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* | | | Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-09-073-19/+58
|\| | | | | | | | | | | | | | | Change-Id: I66c7f18a2abd13601da0947919436f7da3549ae9
| * | | Revise an incorrect QVulkanWindow doc noteLaszlo Agocs2018-09-061-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applying the transformation in question has no effect on the winding order. Rewrite that section. While all the examples are correct, clarify the rules for the geometry they use since the winding order varies. Fix up the triangle example code to use front=CCW for clarity (even though it does not matter much since culling is off there). Change-Id: Icb968c76cc9fa918a5608d3c66b4fccd5668175e Reviewed-by: Christian Stromme <christian.stromme@qt.io>
| * | | Avoid conversion over RGBA64 for RGB32 LCD text blendingAllan Sandfeld Jensen2018-08-301-9/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Short-cuts the case where there is no gamma correction to avoid a conversion over RGBA64 and back. Change-Id: I100697a9f7a4b94283557b2c0eaa45e0eff81785 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * | | Doc: Check before including the \snippet from a .pro fileVenugopal Shivashankar2018-08-301-1/+4
| | |/ | |/| | | | | | | | | | | | | Change-Id: Icc7552b46a2657c81958e40f33596ddeee045172 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | Fix QSIM::itemData returning role 255Luca Beldi2018-09-061-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this fix, QStandardItemModel::itemData returns a map containing role 255 which is used internally to store the flags. This role is an undocumented implementation detail so it should not be returned to the user. [ChangeLog][QtGui][QStandardItemModel] itemData does not return role 255 Change-Id: Ibead3cba84cfe92b3c664bc8ce87508cbcbdc9bd Reviewed-by: David Faure <david.faure@kdab.com>
* | | Fix reading 16bpc grayscale PNGsAllan Sandfeld Jensen2018-09-031-17/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | They were incorrectly attempted to be read as Indexed8, instead use the RGBA64 formats to read them with full accuracy. Task-number: QTBUG-45858 Change-Id: I14fc3cb0d59fa2fc0e68fd870f3b32352c34161f Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* | | Make flatpak portal support to be used also by Snap applicationsJan Grulich2018-09-021-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | Snap now uses xdg-desktop-portal for portal support. Add check for apps running in Snap and make them use portals by default. We also should be using different name for the platform theme used by sandboxed apps. Change-Id: Ibaa35b7549b3d94775d7edb937f729a300d071b6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Windows QPA: Stop synthesizing mouse events from tablet/touchAndre de la Rocha2018-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These fake mouse events should be synthesized by QtGui, not the QPA plugin, when the tablet/touch events are not handled by the application and the Qt::AA_SynthesizeMouseForUnhandledTouchEvents or Qt::AA_SynthesizeMouseForUnhandledTabletEvents flags are set. Task-number: QTBUG-47007 Task-number: QTBUG-60437 Change-Id: I4d6d5e6667d245c45a4eb4f3a94db05cf9772f52 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Romain Pokrzywka <romain.pokrzywka@gmail.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | WebAssembly for QtBaseMorten Johan Sørvig2018-08-305-5/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the squashed diff from wip/webassembly to dev. Done-with: Peng Wu <peng.wu@intopalo.com> Done-with: Sami Enne <sami.enne@intopalo.com> Done-with: Morten Johan Sørvig <morten.sorvig@qt.io> Started-by: Andrew Knight <andrew.knight@intopalo.com> Change-Id: I6562433c0a38d6ec49ab675e0f104f2665f3392d Reviewed-by: Lorn Potter <lorn.potter@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | Silence warning in gcc 4.9 for AndroidEskil Abrahamsen Blomfeldt2018-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | When building with warnings are errors for Android with gcc 4.9, it wrongfully fails on use of uninitialized variable. Change-Id: I39c5e8413c30567fba60cbba6a8b26d537c5836e Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | | Fix out of buffer access in qt_qimageScaleRgba64_up_xyAllan Sandfeld Jensen2018-08-291-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | Avoid reading a pixel outside the image even if we multiply the result by 0. This mirrors a similar old fix in the the 32bit scaling path. Change-Id: I7860bc808dc46dbc94918672e99c81b56d4a1d27 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-08-241-1/+1
|\| | | | | | | | | | | Change-Id: I5f1567c792992fc00f0256f39b76cfbe017e6a3a