From 807fa90b32466fd936704459884c12214d8a254f Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 26 Sep 2017 10:57:04 +0200 Subject: Fix crash with clips entirely outside glyph map When the range to work on is empty just continue to next span. Task-number: QTBUG-63412 Change-Id: Ic5cb77ed438eb9c218f482095aa0cd4e3c2fc6e6 Reviewed-by: Oliver Wolff --- src/gui/painting/qdrawhelper.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/gui') diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index c78fdfe62e..6c25710271 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -5627,6 +5627,8 @@ static void qt_alphamapblit_generic(QRasterBuffer *rasterBuffer, int start = qMax(x, clip.x); int end = qMin(x + mapWidth, clip.x + clip.len); + if (end <= start) + continue; Q_ASSERT(end - start <= buffer_size); QRgba64 *dest = destFetch64((QRgba64*)buffer, rasterBuffer, start, clip.y, end - start); @@ -5900,6 +5902,8 @@ static void qt_alphargbblit_generic(QRasterBuffer *rasterBuffer, int start = qMax(x, clip.x); int end = qMin(x + mapWidth, clip.x + clip.len); + if (end <= start) + continue; Q_ASSERT(end - start <= buffer_size); QRgba64 *dest = destFetch64((QRgba64*)buffer, rasterBuffer, start, clip.y, end - start); -- cgit v1.2.3 From 0366f68b6d63efb2544ccd75dce5157e9c8d6313 Mon Sep 17 00:00:00 2001 From: Mika Salmela Date: Fri, 15 Sep 2017 08:52:23 +0300 Subject: Prevent changing the width for layout item's rect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For gridlayout items the x position is rounded, but the QRectF changes the width to keep the right edge. The width is yet calculated exactly for the text so we need to preserve it. Task-number: QTBUG-61244 Change-Id: I823ba742c9ab299740232b5d9b4ad5713e1782c4 Reviewed-by: Jan Arve Sæther --- src/gui/util/qgridlayoutengine.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/gui') diff --git a/src/gui/util/qgridlayoutengine.cpp b/src/gui/util/qgridlayoutengine.cpp index 8ff2a3eeec..33adac40b2 100644 --- a/src/gui/util/qgridlayoutengine.cpp +++ b/src/gui/util/qgridlayoutengine.cpp @@ -1051,10 +1051,12 @@ void QGridLayoutEngine::setGeometries(const QRectF &contentsGeometry, const QAbs if (m_snapToPixelGrid) { // x and y should already be rounded, but the call to geometryWithin() above might // result in a geom with x,y at half-pixels (due to centering within the cell) - geom.setX(qround(geom.x())); + // QRectF may change the width as it wants to maintain the right edge. In this + // case the width need to be preserved. + geom.moveLeft(qround(geom.x())); // Do not snap baseline aligned items, since that might cause the baselines to not be aligned. if (align != Qt::AlignBaseline) - geom.setY(qround(geom.y())); + geom.moveTop(qround(geom.y())); } visualRect(&geom, visualDirection(), contentsGeometry); item->setGeometry(geom); -- cgit v1.2.3 From c071413ecca3599d27aab21b7efab0193af5f1d9 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 5 Oct 2017 16:54:35 +0200 Subject: Fix zero-length lines with scaling We should calculate the pen width based on the scaling similar to how it is done for normal lines, otherwise we get the scaling applied twice. Task-number: QTBUG-61777 Change-Id: Iba71d55971a1d29537d2c9ff33749223a06160de Reviewed-by: Eirik Aavitsland --- src/gui/painting/qpaintengine_raster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index ef58f96fbc..92ab6e8375 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -1638,7 +1638,7 @@ void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen) QPointF p = lines[i].p1(); QLineF line = s->matrix.map(QLineF(QPointF(p.x() - width*0.5, p.y()), QPointF(p.x() + width*0.5, p.y()))); - d->rasterizer->rasterizeLine(line.p1(), line.p2(), 1); + d->rasterizer->rasterizeLine(line.p1(), line.p2(), width / line.length()); } continue; } -- cgit v1.2.3 From d20aa0d50d6dfc2dc1b88cc912425a28df6437de Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 9 Oct 2017 19:39:11 +0200 Subject: Fix typo in QKeyEvent docs Change-Id: I926fc94ae039f03c507149a6d3fc66f4584201e2 Reviewed-by: Jake Petroules --- src/gui/kernel/qevent.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 680acb16e7..a7848b5485 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -1123,7 +1123,7 @@ QWheelEvent::QWheelEvent(const QPointF &pos, const QPointF& globalPos, The event is propagated up the parent widget chain until a widget accepts it or an event filter consumes it. - The QWidget::setEnable() function can be used to enable or disable + The QWidget::setEnabled() function can be used to enable or disable mouse and keyboard events for a widget. The event handlers QWidget::keyPressEvent(), QWidget::keyReleaseEvent(), -- cgit v1.2.3 From f6cca6ab8a6055a0bc3a32d4c7943679972fb9ea Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 5 Oct 2017 09:04:36 +0200 Subject: Replace 'an unique' with 'a unique' Unique begins with a "y" sound, hence a unique is correct. Change-Id: I9eb6b4d4c9ddab45af931e97c041c24edf163eca Reviewed-by: Jake Petroules --- src/gui/util/qhexstring_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/util/qhexstring_p.h b/src/gui/util/qhexstring_p.h index 511eec0f1b..d30a8eeee8 100644 --- a/src/gui/util/qhexstring_p.h +++ b/src/gui/util/qhexstring_p.h @@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE -// internal helper. Converts an integer value to an unique string token +// internal helper. Converts an integer value to a unique string token template struct HexString { -- cgit v1.2.3 From bc74273143dfb5de8e2255649c7fd037d3d4075a Mon Sep 17 00:00:00 2001 From: David Faure Date: Fri, 6 Oct 2017 11:07:14 +0200 Subject: QPainter: fix invalid pen style when drawing misspelled words 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 --- src/gui/painting/qpainter.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gui') diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp index b186182c34..49d8fd2846 100644 --- a/src/gui/painting/qpainter.cpp +++ b/src/gui/painting/qpainter.cpp @@ -6259,6 +6259,8 @@ static void drawTextItemDecoration(QPainter *painter, const QPointF &pos, const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme(); if (theme) underlineStyle = QTextCharFormat::UnderlineStyle(theme->themeHint(QPlatformTheme::SpellCheckUnderlineStyle).toInt()); + if (underlineStyle == QTextCharFormat::SpellCheckUnderline) // still not resolved + underlineStyle = QTextCharFormat::WaveUnderline; } if (underlineStyle == QTextCharFormat::WaveUnderline) { -- cgit v1.2.3 From 2d4fe257cad8b10f284de7a0b10a1a297026e86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Thu, 12 Oct 2017 16:32:07 +0200 Subject: Remove some unused, local variables Change-Id: I453162d2d396bb3427064d3b1593bb6c71376605 Reviewed-by: Friedemann Kleint --- src/gui/painting/qstroker.cpp | 2 -- src/gui/text/qtextodfwriter.cpp | 1 - 2 files changed, 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/painting/qstroker.cpp b/src/gui/painting/qstroker.cpp index c52792c2d3..4776545be6 100644 --- a/src/gui/painting/qstroker.cpp +++ b/src/gui/painting/qstroker.cpp @@ -1147,8 +1147,6 @@ void QDashStroker::processCurrentSubpath() QLineF cline; - QPainterPath dashPath; - QSubpathFlatIterator it(&m_elements, m_dashThreshold); qfixed2d prev = it.next(); diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp index e228b3c840..3dd19a6eda 100644 --- a/src/gui/text/qtextodfwriter.cpp +++ b/src/gui/text/qtextodfwriter.cpp @@ -381,7 +381,6 @@ void QTextOdfWriter::writeInlineCharacter(QXmlStreamWriter &writer, const QTextF } if (image.isNull()) { - QString context; if (image.isNull()) { // try direct loading name = imageFormat.name(); // remove qrc:/ prefix again image.load(name); -- cgit v1.2.3