summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qpainter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Add ObjectMode coordinate mode to QGradientEirik Aavitsland2018-06-221-7/+11
| | | | | | | | | | | | | | | | | | | | | | The ObjectBoundingMode coordinate mode of QGradient allows specifying the gradient coordinates relative to the object being painted. But if the gradient brush also has a transformation, that transformation is applied in the logical, not object, coordinate space. That behavior is counterintuitive. However, changing it now would break existing code. Instead, we introduce a new coordinate mode enum with the expected behavior, and document the old one as deprecated. This prepares to fix the bugs below in qtsvg, by making it possible to specify the same behavior in Qt as SVG has. [ChangeLog][QtGui][QGradient] Add ObjectMode coordinate mode [ChangeLog][Important Behavior Changes] QDataStream version bumped up to 18 to account for changes in the serialization of QGradient. Task-number: QTBUG-59978 Task-number: QTBUG-67995 Change-Id: I8820a2555359812f3e1a46e37d6ac2cc29a2091d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Provide presets for QGradientTor Arne Vestbø2018-05-311-0/+31
| | | | | | | | | | | | | Similar to Qt::GlobalColor, the presets allow the user to create brushes based on predefined gradients, quickly getting pretty pixels on screen. The presets are based on the linear gradients from WebGradients, a free collection of gradients, hosted at https://webgradients.com/. The few radial and blended gradient presets have been excluded. Change-Id: I1ce8f2210a6045c9edb8829ab3eddcc313549127 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* High-dpi drawTiledPixmap (raster paint engine)Morten Johan Sørvig2018-04-261-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement more consistent behavior for drawTiledPixmap(), which should produce the same visual tiling pattern independent of display devicePixelRatio Consider the following pixmaps and draw calls: QPixmap px32; // 32x32 QPixmap px64; // 64x64 drawTiledPixmap(QRect(0, 0, 128, 128), px32); drawTiledPixmap(QRect(0, 0, 128, 128), px64); On 1x displays this will produce 4x4 and 2x2 tiles, respectively. On 2x displays this would previously produce a different tiling pattern, where the paint engine would tile in the device pixel coordinate system. Change this to tile in the device independent coordinate system, producing the same visual tiling pattern as the 1x case. It is possible to produce a 4x4 tiling pattern with high-resolution output from the 64x64 pixmap by setting the devicePixelRatio: QPixmap px64; px64.setDevicePixelRatio(2); drawTiledPixmap(QRect(0, 0, 128, 128), px64); This change adds an inverse scale to the image filler transform that accounts for the pixmap devicePixelRatio. [ChangeLog][QtGui] QPainter::drawTiledPixmap() now tiles in the device independent coordinate system. Change-Id: I4918d274192967f222f181b374571c7c597dcd76 Reviewed-by: Jonathan Courtois <jonathan.courtois@gmail.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: 石博文 <sbw@sbw.so> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix drawTiledPixmap() and texture-brush painting with high-DPR imagesEirik Aavitsland2018-04-251-0/+7
| | | | | | | | | | | | | | Although QPainter::drawImage()/drawPixmap() would render images scaled according to their devicePixelRatio(), that would not happen for drawTiledPixmap() and when using a textured brush. Implemented here, in combination with the pending "High-dpi drawTiledPixmap (raster paint engine)" commit. [ChangeLog][QtGui] Fix drawTiledPixmap() and texture-brush painting with high-DPR images Task-number: QTBUG-67248 Change-Id: I037e3f897fa708038a0222d3b0c61c7842d87961 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Silence a GCC 8 warning in qpainterVille Voutilainen2018-02-281-2/+2
| | | | | | | | qtbase/src/gui/painting/qpainter.cpp:5625:68: error: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct QFixed’; use assignment or value-initialization instead [-Werror=class-memaccess] memset(advances.data(), 0, advances.size() * sizeof(QFixed)); Change-Id: I563b1b0c5dfaf381a9521bc9a4dc3197f0f38d11 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Use QColor(0, 0, 0, 0) to mark body text in QStaticTextIgor Mironchik2018-01-201-4/+9
| | | | | | | | | | | | | | | | | | | QStaticTextPrivate::paintText() now uses QColor(0, 0, 0, 0) to mark body text. QPainter's pen color was used before this commit (that was always black) that leads to different colors of body text if, for example, links are in body (first block painted with correct color set by QPainter::setPen() but after link body text was always black). Now QPainter::drawStaticText() will draw body text with set pen in any case. [ChangeLog][QtGui][Important Behavior Changes] Fixed a bug where QStaticText would not use the QPainter's pen color for text when other text colors were also in use. Internally this reserves QColor(0, 0, 0, 0) for use with QStaticText. Task-number: QTBUG-45957 Change-Id: If3e180e3083cdac1b4236e738acd15572f19ab69 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* doc: Add missing return types to \fn commandsMartin Smith2018-01-181-5/+5
| | | | | | | | | Added void return type to several \fn commands. The return type should always be included with the \fn command in clang-qdoc. Change-Id: Ie751eb1430eff668f33f8d86e0b1454bd1d2f582 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLars Knoll2018-01-021-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf sc/corelib/io/qfsfileengine_p.h src/corelib/io/qstorageinfo_unix.cpp src/platformsupport/eglconvenience/qeglpbuffer_p.h src/platformsupport/input/libinput/qlibinputkeyboard.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/ios/qiosscreen.h src/plugins/platforms/ios/qioswindow.h src/plugins/platforms/ios/quiview.mm src/printsupport/dialogs/qpagesetupdialog_unix_p.h src/printsupport/dialogs/qprintpreviewdialog.cpp src/printsupport/widgets/qcupsjobwidget_p.h src/widgets/widgets/qmenu.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Iecb4883122efe97ef0ed850271e6c51bab568e9c
| * Paint text decoration where the text isAllan Sandfeld Jensen2017-12-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | For multi text-item texts we should render the text decoration at the same position as the text-item part is, and not always from the beginning of the line. Task-number: QTBUG-60422 Change-Id: I9aa58fc164122ad1fae9716b8b18bdfbbbd778a9 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Update usage of QFontMetrics::width() to new APIEskil Abrahamsen Blomfeldt2017-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QFontMetrics(F)::width() has been deprecated and is replaced by horizontalAdvance(). This updates all usage of it in tests and documentation. It is worth noting that many or most of the usages of QFontMetrics::width() probably intended to use boundingRect().width(), but since it currently works, I have not looked into that, just replaced the function name mechanically. Change-Id: Iec382e5bad0b50f37a6cfff841bfb46ed4d4555f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Add QFontMetrics(F)::horizontalAdvance() functionEskil Abrahamsen Blomfeldt2017-11-141-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | A source of constant confusion is the QFontMetrics::width() function, which does not return the bounding width of the text, but the advance width. We deprecate this and add horizontalAdvance() instead, to avoid the confusion in the future. Note that there was an internal width() overload which was only there for the purpose of supporting the Qt::TextBypassShaping flag. This flag has already been replaced by public API, so no such overload is added. Instead, we deprecate the TextBypassShaping flag as well, which makes sense, since a replacement has been made. Also note that there was a consistency problem with QFontMetrics and QFontMetricsF, which are supposed to be interchangeable. The QFontMetrics::width() functions for strings took an optional int length argument, while the floating point version did not. This error is corrected in the advance() functions. [ChangeLog][QtGui][Text] Added QFontMetrics::horizontalAdvance() and QFontMetricsF::horizontalAdvance() to replace the confusingly named width() function. The latter has now been deprecated. Change-Id: I0dfda43aa65c8235be32c62fade82cae05b29c79 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.9' into 5.10Liang Qi2017-10-161-0/+2
|\ | | | | | | Change-Id: I3cf73c53cf131d0babfb558c2507bed0e0fc5f08
| * QPainter: fix invalid pen style when drawing misspelled wordsDavid Faure2017-10-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code asks the platform theme to resolve SpellCheckUnderline to an actual pen style (wave, solid, dash, etc.) but if there's no theme, or if the default implementation in QPlatformTheme is used, the value is still SpellCheckUnderline, which then casted to a PenStyle below in qpainter.cpp: pen.setStyle((Qt::PenStyle)(underlineStyle)); The value 7 is an invalid PenStyle, which leads to random behavior when drawing the underline. Make it WaveUnderline if the platform theme had no opinion on how to draw it. Change-Id: I4f02f9b58f10582cee5aefce7a4d5cd300133140 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | Add QTextOption/QTextEdit/QPlainTextEdit::tabStopDistance propertyEskil Abrahamsen Blomfeldt2017-08-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt, we have QTextOption::tabStop, QTextEdit::tabStopWidth and QPlainTextEdit::tabStopWidth. Neither are very good names, since the tab stop is neither a numerical value as in the former, nor does it have any dimensions that can be measured, as in the latter. Vertical text advances may also be supported by Qt at some point in the future, at which point the name would make even less sense. At the same time, we expose the actual type of the tab stop distance as floating point in the QTextEdit and QPlainTextEdit API instead of always rounding it to an int. To avoid duplicating either of these APIs in Qt Quick, we introduce tabStopDistance as the common term instead and deprecate the old names. [ChangeLog][Text] Introduced tabStopDistance property in QTextOption, QTextEdit and QPlainTextEdit as replacement for the inconsistently named tabStop and tabStopWidth properties. QTextOption::tabStop, QTextEdit::tabStopWidth and QPlainTextEdit::tabStopWidth have subsequently been deprecated. Change-Id: Ib7e01387910cddb58adaaaadcd56c0e69edc4bc2 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Add API to disable text shaping on fontsEskil Abrahamsen Blomfeldt2017-07-261-0/+2
|/ | | | | | | | | | | | | | | | | | | | | | In the past, we had an undocumented text flag that worked with one of the QPainter::drawText() overloads. This was never intended as public API and served a specific cause in Qt WebKit at one point. But there is a general need for such API, as disabling shaping features easily gives 25% performance improvement on text rendering even for fairly short strings. This patch adds a new style strategy flag to disable shaping and will just uses the CMAP and HDMX tables to get glyph indices and advances for the characters. In Qt 6, the TextBypassShaping flag can be removed completely and be replaced by the style strategy. [ChangeLog][QtGui][Text] Added QFont::PreferNoShaping style strategy to support improvements to performance at the expense of some cosmetic font features. Task-number: QTBUG-56728 Change-Id: I48e025dcc06afe02824bf5b5011702a7e0036f6d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix documentation typosChristian Gagneraud2017-02-251-1/+1
| | | | | | | | | | This patch fixes 2 simple typos in QGraphicsItem and QPainter documentation and a copy/paste error between QAbstractItemModel's beginRemoveColumns and beginRemoveRows documentation. Change-Id: I32bdc4dc69154a40fe30a5b8c08d0c3a001853f8 Reviewed-by: Harri Porten <porten@froglogic.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Fix clipping error on some RTL textEskil Abrahamsen Blomfeldt2017-01-311-1/+0
| | | | | | | | | | | | | | | | | | There was a false assumption that the bidi level of text is only used for visualizing the text, not for calculating its bounding box. But the bidi level is required for shaping (indeed many OpenType rules check for reading direction) and the glyphs used to represent a given text may be different based on its directionality. The effect would be that the bounding rect we calculated for text would sometimes be too small for RTL text, and we would end up clipping pixels. [ChangeLog][QtGui][Text] Fixed clipping errors and too small bounding rects for some right-to-left text. Task-number: QTBUG-48005 Change-Id: Idd12ae1b0033d518034b582204ba47ae41795293 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix decorated text in extra-selectionsEskil Abrahamsen Blomfeldt2016-10-241-1/+2
| | | | | | | | | | | | | Change ddef89b323e8507ea5f451cb53ed151e29a110b3 broke decorations set using setExtraSelections(), because these decorations are drawn with a second drawTextItem() call where numGlyphs is set to 0. When the drawTextDecoration() call was moved into the branches for multi/no-multi font engines, the call for the cut-off when numGlyphs == 0 was unintentionally removed. Task-number: QTBUG-54626 Change-Id: Ieb9fc23099a9d7daf87cc364d3fc9da128ec516d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-06-131-6/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config_help.txt configure mkspecs/features/uikit/sdk.prf src/corelib/global/qhooks.cpp src/corelib/io/qfilesystemwatcher.cpp src/corelib/io/qlockfile_unix.cpp src/corelib/tools/qalgorithms.h src/gui/kernel/qwindowsysteminterface.h src/gui/text/qtextdocument_p.cpp src/network/access/access.pri src/network/access/qnetworkaccessmanager.cpp src/network/access/qnetworkreplynsurlconnectionimpl.mm src/src.pro src/testlib/qtestcase.cpp src/widgets/kernel/qwidgetbackingstore_p.h src/widgets/styles/qwindowscestyle.cpp src/widgets/styles/qwindowsmobilestyle.cpp tests/auto/corelib/io/qdiriterator/qdiriterator.pro tests/auto/corelib/io/qfileinfo/qfileinfo.pro tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp tools/configure/configureapp.cpp Change-Id: Ibf7fb9c8cf263a810ade82f821345d0725c57c67
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-06-061-5/+4
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf config.tests/unix/nis/nis.cpp mkspecs/unsupported/freebsd-g++/qplatformdefs.h src/corelib/tools/qdatetime.cpp src/corelib/tools/qsimd.cpp src/corelib/tools/qsimd_p.h src/network/access/access.pri src/network/access/qnetworkreplynsurlconnectionimpl.mm src/network/access/qnetworkreplynsurlconnectionimpl_p.h src/plugins/platforms/cocoa/qnsview.mm src/plugins/printsupport/windows/qwindowsprintdevice.cpp tests/auto/corelib/kernel/qobject/tst_qobject.cpp tests/auto/network/access/qnetworkreply/BLACKLIST tests/auto/widgets/widgets/qopenglwidget/BLACKLIST Change-Id: I4b32055bbf922392ef0264fd403405416fffee57
| | * Correct compositionMode documentationAllan Sandfeld Jensen2016-05-231-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Most composition modes require an alpha-channel to be meaningful, but not all, and there is no requirements of specific formats. Change-Id: I11e930ccc07e9ff5df06dbda6745e4afb79f5e08 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * | Gui: use const (and const APIs) moreAnton Kudryavtsev2016-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | For CoW types, prefer const methods to avoid needless detach()ing. Change-Id: I88d08d499e1be72c1f6d983fecdcee513df18aa2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-231-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/wince80colibri-armv7-msvc2012/qmake.conf qmake/generators/win32/msvc_vcproj.cpp src/corelib/global/qnamespace.h src/corelib/global/qnamespace.qdoc src/corelib/io/qfsfileengine_win.cpp src/corelib/tools/tools.pri src/network/ssl/qsslconfiguration_p.h src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp src/plugins/platforms/windows/windows.pri src/src.pro src/tools/bootstrap/bootstrap.pro src/tools/uic/cpp/cppwriteinitialization.cpp src/widgets/dialogs/qfilesystemmodel.cpp tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt Change-Id: I4d2ac78f0dcc97f008186bbbc769c6fe588ab0e5
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-191-2/+2
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp src/network/access/qnetworkaccessmanager.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h src/widgets/widgets/qlineedit_p.cpp src/widgets/widgets/qlineedit_p.h src/winmain/winmain.pro tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp tools/configure/configureapp.cpp Change-Id: Ib9997b0d0f91946e4081d36c0c6b696c5c983b2a
| | * Fix building with -qreal floatAllan Sandfeld Jensen2016-05-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Min and max expressions need matching types, which means we have to take care both values are qreal. Task-number: QTCREATORBUG-15851 Change-Id: I5f123e979fa896006ff6eafaac1f65b667db975d Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-05-121-8/+13
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config_help.txt configure src/corelib/io/qprocess_wince.cpp src/plugins/platforms/windows/qwindowstheme.cpp src/plugins/platforms/xcb/qxcbbackingstore.cpp tests/auto/corelib/tools/qtimezone/BLACKLIST tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp Change-Id: I26644d1cb3b78412c8ff285e2a55bea1bd641c01
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-061-3/+6
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/qtestlib/tutorial5/containers.cpp examples/widgets/tools/tools.pro src/corelib/io/qprocess.cpp src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/network/kernel/qdnslookup_unix.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/testlib/qtestcase.cpp tools/configure/configureapp.cpp Change-Id: I838ae7f082535a67a4a53aa13a21ba5580758be8
| | * Fix underline position on Liberation MonoAllan Sandfeld Jensen2016-05-021-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure we don't round a underline position beyond the descent in our eagerness to avoid underlines too close to baseline. Task-number: QTCREATORBUG-15851 Change-Id: I9a29447bbcb938b7e9fb29d52fd392a1340d07c5 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| * | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-291-5/+7
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qml_module.prf mkspecs/features/qt_common.prf src/gui/text/qzip.cpp src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/windows/array.h src/testlib/qtestcase.cpp src/widgets/dialogs/qfilesystemmodel.h Change-Id: Ie41c5868415b81f7693c80e045497035504bb210
| | * Fix clipping of wave underline decoration on certain fontsAllan Sandfeld Jensen2016-04-271-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Limit the height of the the wave-pixmap so that fillRect doesn't clip it. At the same time the precision of the generated wave-pixmap is improved so it better fits the requested radius. Task-number: QTCREATORBUG-15851 Change-Id: If754387b20ab7b015857ecb0a0e8fe16de1d728a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | Use correct decoration for fallback font enginesEskil Abrahamsen Blomfeldt2016-03-011-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The font engine itself specifies the line thickness, underline position etc. so we need to pass in the correct one, not the multi engine (which will just return whatever engine #0 prefers.) Change-Id: I2b2b92e7881df8a8310aedbc6efa304c3210c095 Task-number: QTBUG-33708 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | | QtGui: use new QRegion::begin()/end() instead of rect()Marc Mutz2016-02-281-1/+1
|/ / | | | | | | | | | | | | Saves ~1100b in text size on optimized GCC 5.3 Linux AMD64 builds. Change-Id: I928be44314dde06d5fdd2486a3417870bda64af4 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QPainter: replace an inefficient QList with QVectorMarc Mutz2016-02-111-17/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QPainterClipInfo is larger than a void*, so holding it in QLists is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Fix by marking it movable and holding it in a QVector instead. Port from op<< to append() to reap rvalue push_back(). Change-Id: I3af17eca2443d26a795381635510b8b9a5795e5f Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Fix QPainter::rotate() documentationMitch Curtis2016-01-041-1/+1
| | | | | Change-Id: I5d11f84181cad9be644e850c83459b47ec2f2f15 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* Enable non-integer device pixel ratioMorten Johan Sørvig2015-07-301-5/+5
| | | | | | | | | | | | | | | | | | | | Work around QPaintDevice::metric's int return type by adding a new metric that returns a scaled devicePixelRatio. Choose a scale factor that gives us more than enough range. The QPaintDevice::devicePixelRatio() convenience accessor is public API and can unfortunately not be changed to return a qreal. Add devicePixelRatioF() which returns the (unscaled) devicePixelRatio. Change all call sites of QPaintDevice::devicePixelRatio() to use QPainDevice::devicePixelRatioF(). Task-number: QTBUG-46615 Change-Id: I97ec4000fe379b7ff5e1624a871ae2512790aad9 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-07-011-8/+37
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qglobal.h src/corelib/global/qsysinfo.h src/corelib/global/qsystemdetection.h src/corelib/kernel/qobjectdefs.h src/plugins/plugins.pro tests/auto/widgets/itemviews/qlistview/qlistview.pro Change-Id: Ib55aa79d707c4c1453fb9d697f6cf92211ed665c
| * Replace MAC OS X with OS XNico Vertriest2015-06-301-1/+1
| | | | | | | | | | | | Task-number: QTBUG-46374 Change-Id: I7bc633ab551740bd328a24b0ccae1d534af47138 Reviewed-by: Martin Smith <martin.smith@digia.com>
| * Clarify QPainter::drawText() documentation.Mitch Curtis2015-06-031-7/+36
| | | | | | | | | | | | | | | | | | | | The difference between rectangle and boundingRect was not quite clear. This patch adds a snippet with a corresponding image, in order to illustrate the difference. Change-Id: Icb1fe737788cc93f1c5baa16bc0e04b8ec728f3a Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | gui: Add several QList::reserve() calls.Sérgio Martins2015-06-221-0/+1
| | | | | | | | | | | | | | Reduces reallocations. Change-Id: I0db16726f413a67b76a73fabd013f910ab5f5109 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Fix users of QTextLayout::additionalFormats to use the new APIMarc Mutz2015-05-301-2/+2
|/ | | | | | | | | | | | QTextLayout::additionalFormats setters and getters using QList<FormatRange> have been deprecated; port to the QVector versions. Moved op== definition for FormatRange needed in tst_qsyntaxhighlighter.cpp to a friend declaration in FormatRange itself, because MSVC 2008 doesn't find it otherwise. Change-Id: Ibab6589df057f02377d895079b56395859e3401e Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Don't remove mnemonics and parentheses under non-Mac system.Debao Zhang2015-03-261-0/+2
| | | | | | | | | SHA: 8e3aacf61bcfe036acdba8fac4d07d68ff0f5ab3 is a mac only patch, but some code introduced by which is not wrapped with Q_OS_MAC. So add the missing Q_OS_MAC here. Change-Id: I748d46b977740e6116dab5659ad1e47d23262a0f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* QtGui: Fix const correctness in old style castsThiago Macieira2015-03-121-2/+2
| | | | | | | Found with GCC's -Wcast-qual. Change-Id: Ia0aac2f09e9245339951ffff13c946844bc31eb8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Micro optimization to QPainterPrivate::drawGlyphsKonstantin Ritt2015-03-111-6/+3
| | | | | | | | Re-use font engine obtained in the first place Change-Id: Icdc2ad404ba9b2aadf2732e95c43a47aa957a6fb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix underline for centered textEskil Abrahamsen Blomfeldt2015-02-251-1/+1
| | | | | | | | | | | | | | | The position of the text itself is always floored, since the glyph contains the subpixel antialiasing. Since no antialiasing is applied to the underline, its position also has to be floored, otherwise it will sometimes appear one pixel to the right of the text it's underlining. [ChangeLog][Text] Fixed position of underline on centered text when the text layout's width is an even number. Task-number: QTBUG-39286 Change-Id: Ib1704ac5b09289f5b3f5a6580443f234d6d868fc Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Merge remote-tracking branch 'origin/5.4' into 5.5Frederik Gladhorn2015-02-241-0/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/xml/htmlinfo/simpleexample.html examples/xml/rsslisting/rsslisting.cpp qmake/generators/win32/msbuild_objectmodel.cpp src/3rdparty/harfbuzz-ng/src/hb-private.hh src/corelib/global/qlogging.cpp src/corelib/io/qstorageinfo_unix.cpp src/corelib/thread/qwaitcondition_unix.cpp src/gui/kernel/qguiapplication.cpp src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp src/testlib/doc/src/qt-webpages.qdoc tests/auto/other/qaccessibility/tst_qaccessibility.cpp Change-Id: Ib272ff0bc30a1a5d51275eb3cd2f201dc82c11ff
| * Fix crash in QPainter::drawGlyphRun() when painter is not activeOlivier Blin2015-02-241-0/+5
| | | | | | | | | | Change-Id: I24f52cf1db300b8a6d0a4cb19fc6c74c41e00dbc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* | Don't replace IntersectClip with ReplaceClip on a QPictureAllan Sandfeld Jensen2015-02-051-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QPainter should not try to be smart and optimize IntersectClip with ReplaceClip when working on a QPicture paint device. Doing so will change the end result as the actually state when replayed might be different from the one it was recorded in. [ChangeLog][QtGui][QPainter] QPainter will no longer try to replace IntersectClip with ReplaceClip if the paint engine is a QPicture. Task-number: QTBUG-35830 Change-Id: I0693d932f037336b960c34bb8fe840e8afe04fe6 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>