summaryrefslogtreecommitdiffstats
path: root/src/gui/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/util')
-rw-r--r--src/gui/util/qgridlayoutengine.cpp6
-rw-r--r--src/gui/util/qhexstring_p.h2
2 files changed, 5 insertions, 3 deletions
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);
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 <typename T>
struct HexString
{