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/util') 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 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/util') 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