summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* Fix printing of semitransparent images to PDFAllan Sandfeld Jensen2014-10-241-1/+3
| | | | | | | | | | The patch marks the image data to be inverted when a soft mask is used. Without this any embedded image with semitransparent pixels would be decoded with inverted colors. Task-number: QTBUG-31540 Change-Id: Ia607f7c1acf542ecf3bc88d713dfd87785b43f40 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Do not parent the shader program to the QOpenGLContextJocelyn Turcotte2014-10-231-1/+4
| | | | | | | | | | | | | | | | | | | | | | | When the last QOpenGLContext in a share group is destroyed, all the remaining alive QOpenGL* objects have their resource invalidated. This happens under QOpenGLContext::destroy, but before any QObject children of the QOpenGLContext is destroyed by the QObject destructor. This is currently an issue with ANGLE that could be fixed in its own code, but that is still better for us to be covered against. This means that the OpenGL resource is assumed to be destroyed with the context by the driver, but this isn't always the same. Fix an instance of this in QOpenGLTextureGlyphCache by explicitly owning the blit QOpenGLShaderProgram instead of parenting it under the current GL context. The very same resource invalidation system will prevent anything bad to happen if the QOpenGLContext is destroyed before the QOpenGLTextureGlyphCache. Task-number: QTBUG-41588 Change-Id: Ic3bc69b07bcbdcf7d699ea9139b2e34b04e642e5 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Adjust the layout if a QGraphicsWidget is explicitly hiddenJan Arve Saether2014-10-232-1/+2
| | | | | | | | | Since layout items can now be hidden, this also makes sure we respect the QSizePolicy::retainSizeWhenHidden Task-number: QTBUG-20132 Change-Id: Iab59fc9b61d4ca1bb2208c479a027da6eb0283a9 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Fix uninitialized value warning in QFontEngineFT.Axel Rasmussen2014-10-231-0/+1
| | | | | | | | | | | | | | | | | | | When running an application which called e.g. QPainter::drawText under Valgrind, it would produce "Conditional jump or move depends on uninitialized value(s)" warnings, since we were allocating a buffer for a FreeType bitmap without initializing its contents. FreeType, apparently, does not set the value of all bytes in a bitmap buffer when it is used as a FT_Bitmap, so we were left with some uninitialized memory which was still being used. This commit fixes these warnings, and prevents any potential undefined behavior. [ChangeLog][QtGui][General] fixed use of uninitialized memory in the FreeType font engine Change-Id: Ia7b3595c78310ce41f76cb4546fc36016c0000a8 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Doc: Improved explanation of quality setting in QImageReader/Writeraavit2014-10-222-15/+25
| | | | | | | | Explanation was somewhat inprecise and incomplete. Task-number: QTBUG-41358 Change-Id: Iae52c30868ca48a49eac76d6979a9b02c24a7d49 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Avoid adding empty parent icon themeWeitian Leung2014-10-221-0/+1
| | | | | | | | "Icon Theme/Inherits" may assign an empty value, e.g. Flattr icon theme Change-Id: I90713b3eb67e39d6a49a49d1f5b3d7a75a8f30f4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Document QOpenGLPixelTransferOptionsLaszlo Agocs2014-10-221-0/+93
| | | | | | Task-number: QTBUG-35576 Change-Id: I178f5db5f1075b6a395cf8ff73b75fe1765540aa Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QPA: Flush window system events with flags.Morten Johan Sørvig2014-10-224-10/+13
| | | | | | | | | | | Add a QEventLoop::ProcessEventsFlags argument to flushWindowSystemEvents(). This gives the platform plugins more control over which events to flush. Task-number: QTBUG-39842 Change-Id: Id9c01948b22e297b22503d38ec4e726f9f880fd5 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Jonathan Liu <net147@gmail.com>
* Correctly apply miter limits when stroking linesLars Knoll2014-10-211-0/+2
| | | | | | | | | | | The PDF generator was in many cases not correctly applying miter limits to the generated strokes leading to drawing artifacts for very sharp edges. Task-number: QTBUG-37903 Change-Id: Ie93b0f4a56775729105a375ba3bcdb5b58993433 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Fix ShortcutOverride for QtQuick on OSXJosh Faust2014-10-201-2/+10
| | | | | | | | | | tryShortcutOverride on OSX gets called via QWindowSystemInterface::tryHandleShortcutEvent. This change fixes that to use the QWindow's focus object. Task-number: QTBUG-32928 Change-Id: I51beb774e1fb91e0d8e2c12d087176d917357311 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@theqtcompany.com>
* Doc: add info about letter spacing type to function descLeena Miettinen2014-10-201-1/+2
| | | | | | Task-number: QTBUG-41222 Change-Id: I18168dfa503feac07ee1b7bc349b9f14b7351518 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Correct QPainter::clipPath() documentation.Mitch Curtis2014-10-201-2/+1
| | | | | Change-Id: Ie8ea01eee23e28378eadca0e87dc89fd62aec14f Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Remove QOpenGLContextPrivate::globalShareContextJocelyn Turcotte2014-10-202-13/+0
| | | | | | | | This has previously been replaced with qt_gl_global_share_context and all using code has been ported to the new name at this point. Change-Id: I13832f583456891dd057a7b414f45ec3e83f5698 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Fix QOpenGLWindow tests when devicePixelRatio != 1Jørgen Lind2014-10-201-7/+10
| | | | | Change-Id: I83d71de8b9d735cd649a6c514e41a9ff23625005 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Avoid breaking BC with new virtuals in QOpenGLPaintDeviceLaszlo Agocs2014-10-165-44/+95
| | | | | | Task-number: QTBUG-41046 Change-Id: Iab628d2d6811d528e2cc513b6f8a74baa628541d Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Fix QOpenGLWidget on Cocoa when used as viewportLaszlo Agocs2014-10-143-1/+32
| | | | | | | | | | | | | | | | | | | | | | | Having a QOpenGLWidget as a graphics view viewport was not functioning on OS X: it was showing incomplete content due to accessing the texture attached to the framebuffer object before the rendering is complete. On the normal path, when rendering is done via paintGL(), the flush was there. When used as a viewport however, this path is not used. The missing flush is now added for the other case too. For performance reasons, we will not flush on every paint engine end(). Instead, the flush is deferred until composition starts. QGLWidget also featured a weird on-by-default autoFillBackground concept. To maintain compatibility with apps that used QGLWidget as the viewport for QGraphicsView, we will now do the same for QOpenGLWidget, but only when it is used as a viewport. For regular QOpenGLWidgets autoFillBackground defaults to false, like for any other widget. The docs are extended with a small section about differences between QGLWidget and QOpenGLWidget. Task-number: QTBUG-41046 Change-Id: I42c2033fdd2ef5815783fd640fe11373761061e0 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* qplatformmenu: remove unused and deprecated functionRichard Moe Gustavsen2014-10-131-5/+0
| | | | | | | | | | | | | Now that all platforms use the popup function that takes a target rect, lets remove the deprecated one. This is sort of important, since QtQuick controls now uses the new version. So if a (new) platform ends up only implementing the old version, that can end up not working correctly. Change-Id: I34814b3de5ea4954cf21b161e8a834e39e5534c8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Update QOffscreenSurface docs regarding threadsLaszlo Agocs2014-10-131-0/+8
| | | | | Change-Id: Ic2e3230835aa7fc1b1c3ac0530a65cd478e1ec5f Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Doc: Update description of QKeyEvent classTopi Reinio2014-10-131-6/+5
| | | | | | | | | | Update the description on how to use the QKeyEvent pointer passed to key event handlers, and remove an outdated note about multimedia key events. Change-Id: I67a3f0054e28b84d5a0e367c02a329f4670221c7 Task-number: QTBUG-35155 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Fix memory leak in QClipboard::setMimeData()Eskil Abrahamsen Blomfeldt2014-10-101-3/+8
| | | | | | | | | | | | | | | | | | | The setMimeData() function is documented to take ownership of the object passed in, but in the case where the platform plugin did not support the requested mode, we would simply return without deleting the object nor telling the application, so it would cause a potential memory leak. We need to honor the contract, even when we fail to set the mime data. Test was updated to avoid verifying the leak in cases where the platform does not support all modes. [ChangeLog][QtGui][Clipboard] Fixed a memory leak in setMimeData() when the platform plugin did not support the requested mode. Task-number: QTBUG-41852 Change-Id: I2112da1613199fe1b56724e7ccf097b9e912c117 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Don't stream QStringLiterals into QDebugMarc Mutz2014-10-092-2/+2
| | | | | | | | Normal (C) string literals do just as well and use more than twice less space in the DATA section. Change-Id: Iafb0682a362c41dfd5b4d8b9137d88014d7992a2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't use QStringLiteral in startsWith/endsWidthMarc Mutz2014-10-092-3/+3
| | | | | | | | | | | | | | | For QLatin1String, startsWith/endsWith is overloaded, so comparing to a latin-1 (C) string literal is efficient, since strlen() is comparatively fast. OTOH, QStringLiteral, when not using RVO, litters the code with QString dtor calls, which are not inline. Worse, absent lambdas, it even allocates memory. So, just use QLatin1String instead. Change-Id: I7eaf464c67b55116f970fe7f58a85f19ce4d254e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't use QStringLiteral in comparisonsMarc Mutz2014-10-091-1/+1
| | | | | | | | | | | | | | For QLatin1String, operator== is overloaded, so comparing to a latin-1 (C) string literal is efficient, since strlen() is comparatively fast. OTOH, QStringLiteral, when not using RVO, litters the code with QString dtor calls, which are not inline. Worse, absent lambdas, it even allocates memory. So, just compare using QLatin1String instead. Change-Id: I7af3bf3a67c55dae33ffaf9922d004fa168a3f9c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QCss: mark many classes as movableMarc Mutz2014-10-081-0/+24
| | | | | | | | | Most of these are held in QVectors, so let QVector use the optimized reallocation strategy. Change-Id: I6c2182465c283705bd5ec761e3d2d3d072bc6207 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QCss: Move declaration of ValueExtractorMarc Mutz2014-10-081-39/+34
| | | | | | | | | | Move it to the end of the header, since it was sitting right in the middle of AST struct definitions without being one itself. Change-Id: I017d6187324e91f2745629dbed4271064d4e59a8 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* QCss: unexport some classesMarc Mutz2014-10-081-6/+8
| | | | | | | | | | | | and export only the non-inline functions inside them. Inline functions don't need exporting, and some compilers are known to have problems inlining inline functions of exported classes. Change-Id: I843adc0ab493817e71f48ab87bfefb03d4ca918d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Add text ranges to QGlyphRunPrivateEskil Abrahamsen Blomfeldt2014-10-082-8/+69
| | | | | | | | | | | | This is an enabler for using the QGlyphRun in the selection code of the scene graph node. In this case, we need to know exactly which of the characters in the text are represented by the glyph run, as a single range of text may result in several glyph runs. Change-Id: Ie8ec942693dceea45ab548f6cefc4f78e4c6d524 Task-number: QTBUG-41808 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Do not re-create windows during application shutdownShawn Rutledge2014-10-061-1/+1
| | | | | | | | | | | | | | | Change 9c3a58a913a7e59359146264ee59d40d703d4db2 causes any window to be re-created when the screen it is shown on is destroyed. This is for the use case of detaching one monitor while another remains. In QWindow::setScreen(), if the screen is null, it will be set to the primary screen. However during application shutdown, it may be that the primary screen has been destroyed before all the windows are destroyed; so trying to set it anyway will cause a crash. qtdeclarative/tests/auto/quick/qquickwindow was segfaulting, especially when running testWindowVisibilityOrder by itself. Change-Id: Ice6b30320ac563f0c70264aa5c57de21d2e4d56e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Fix QTextInlineObject class documentationAlex Blasche2014-10-051-6/+3
| | | | | | | Change-Id: I10ac533c1ba7a8003b59b1617af98afbdd4ed17f Task-number: QTBUG-39784 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* QBrush: be more robust in detach()Marc Mutz2014-10-031-2/+10
| | | | | | | | | | | | | | | If detach() was called with a newStyle corresponding to a gradient, but with d->style not a gradient, it would execute an invalid cast and read invalid memory. The reason this has not been seen in practice is that a non-gradient brush instance can currently never become a gradient one. But that may change when someone adds an operator=(QGradient), so in the interest of robust code, add a check to verify the old style was a gradient before accessing the corresponding member. Change-Id: I216a144d31a9ed7145bcd829f3ae5f44a41672db Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* Pass a sized format when creating multisampled renderbuffers on ESLaszlo Agocs2014-10-033-15/+18
| | | | | | | Task-number: QTBUG-40921 Change-Id: I96b05442dd5928992dab06553b3d41feca89084d Reviewed-by: BogDan Vatra <bogdan@kde.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QRegion: fix a valgrind warningMarc Mutz2014-10-021-1/+1
| | | | | | | | | | | | | | | | When: - i == 0 (at end of current POINTBLOCK), - numFullPtBlocks == 1 (only one more POINTBLOCK left) and - iCurPtBlock == 0 (last block contains no points), Valgrind rightfully complained about an invalid read: Conditional jump or move depends on uninitialised value(s) at 0x517B08B: PolygonRegion(QPoint const*, int, int) (qregion.cpp:3480) Fixed by setting 'next' to nullptr when !numFullPtBlocks OR !iCurPtBlock. Change-Id: If5225fdfa66f2910a8aafb675cd02b40c0a81ad9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove wrong unneeded definition in qopenglextensions_p.hAllan Sandfeld Jensen2014-10-021-12/+0
| | | | | | | | The types are already defined by qopengl.h, and the GLchar could be incorrectly defined in the Qt namespace for GLES2 namespaced builds. Change-Id: Ia2052599538af51fdadc434935d51bbfe8437453 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Doc: Removed a few references to the outdated featuresVenu2014-10-021-8/+1
| | | | | | | | | | OpenVG support and the -graphicssystem command-line option is not available since Qt 5.0. Change-Id: I19c89cd3bb2c4a2215cdfae9fd783dece637b30f Task-number: QTBUG-41265 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4Gabriel de Dietrich2014-10-015-5/+17
|\
| * Merge remote-tracking branch 'origin/5.3' into 5.4Gabriel de Dietrich2014-09-295-5/+17
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/socket/qnativesocketengine_unix.cpp src/widgets/kernel/qwidget_qpa.cpp Change-Id: I6f1aa320d5ca66cd92d601a95885aeaab0abb191
| | * Prevent a Coverity warning about a dangerous code pathGiuseppe D'Angelo2014-09-221-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity warns that we may access the gray array without initializing it. The array is initialized if d (the source image depth) is 8. However, when doing ordered dithering, we don't check that depth any more and just use the array. There are instead checks in place for the other dither modes; the one for ordered has been commented out before public history. So, for the love of kittens, put the check back. Change-Id: I1cc5ced8edbb626777e54e9f4e58f152c6b28ddc Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * QTransform: initialize the d memberGiuseppe D'Angelo2014-09-222-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although never used, the d member triggers all sorts of warnings when copying a QTransform around because it's technically undefined behavior (reading from an uninitialized variable). Change-Id: If06b6bea6f0ec0623c38ba330d46958b373cdc65 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| | * QRegion: fix a memory leakGiuseppe D'Angelo2014-09-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | An early return in case of errors leaked memory tracked in a variable in scope. Change-Id: I68cd77890608caff54df7476d38850e5541ce76e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| | * Add backslash to the list of word separator.David Schulz2014-09-221-0/+1
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-40384 Change-Id: I16ae1432f3bdd7e577593fc43336bf29c735a66b Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | | Fix regression in metric calculation of text with mnemonicsAllan Sandfeld Jensen2014-10-011-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even when we do not intend to display the text, we still need to go through the processing of mnemonics to remove them from the text. Instead of capping the max underlines to 0, the TextDontPrint option now just saves adding the underline formats. Task-number: QTBUG-41593 Change-Id: I67790650dbed0092de2c63e5d5a9349dc02d5846 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Robert Loehning <robert.loehning@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* | | Extend QOpenGLVertexArrayObjectHelper to support glIsVertexArraysAllan Sandfeld Jensen2014-09-302-1/+13
| | | | | | | | | | | | | | | | | | | | | This is needed for dynamicgl support in QtWebKit. Change-Id: I4d1769394ccdeaf449cac4f002c03ca8013f62f6 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* | | Doc: Use title case in section1 titlesNico Vertriest2014-09-306-18/+18
| | | | | | | | | | | | | | | | | | | | | | | | Using Python script title-cased.py Task-number: QTBUG-41250 Change-Id: I00d3d7a0b30db7304a7904efd6d63abd9a7b493b Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | | Make QAccessible compile with -Werrorhjk2014-09-301-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | GCC was bailing out when attempting to merge this into the dev branch due to the use of "potentially uninitialized values". Change-Id: Id2fc4a123a4b180b9ab439429a0d20245c7ee41b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Make QRegion::shared_empty constMarc Mutz2014-09-292-18/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Continuing the trend of QString, QVector, etc. Change-Id: I8f53d4abfa0dd941bfdfd3c1a9049a42dbf92691 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Fix build when using -WerrorSérgio Martins2014-09-291-3/+6
|/ / | | | | | | | | | | | | | | | | | | "accessible/qaccessible.cpp:2154:43: error: 'type' may be used uninitialized in this function [-Werror=maybe-uninitialized]" Compiler doesn't seem very smart, all enumerators are handled in the switch already. Observed on android's gcc and gcc-4.7 on GNU/Linux Change-Id: I30b4660c18992158457cada01b5916aa4feae4ff Reviewed-by: BogDan Vatra <bogdan@kde.org>
* | Clean up QImage::Format switchesAllan Sandfeld Jensen2014-09-254-78/+31
| | | | | | | | | | | | | | | | | | | | Changes some switches on QImage::Format that needed to be updated whenever a new image format was added. Two were changed to matching formats supported by BMP and PPM instead of what they don't support, and two were changed to now use QPixelFormat values. Change-Id: I5a14f1d7b7cc0451c68e4d6ab2361a5bd8dc8915 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Fix smooth scaling of large QImagesAlex Blasche2014-09-251-12/+13
| | | | | | | | | | | | Task-number: QTBUG-13448 Change-Id: Ie76f5b5deefabeae93ab17eb866aea303692f5ac Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Update license headers and add new license filesMatti Paaso2014-09-24518-9734/+5590
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* | Make QScreenPrivate constructor a bit clearerTor Arne Vestbø2014-09-241-5/+5
| | | | | | | | | | | | | | | | Easier to read/understand that the screen properties are initialized from the platformScreen. Change-Id: I3084c3ac30a08cb4e154536f949475459212d2de Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>