summaryrefslogtreecommitdiffstats
path: root/src/gui/util
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-10-24 10:37:17 +0200
committerLiang Qi <liang.qi@qt.io>2017-10-24 13:40:55 +0200
commitfa9d12f4a20d618caedc77880459fa1af75fd50d (patch)
tree11bd3cb4541afb924b3ee17f867133e71eb0e090 /src/gui/util
parent895cb4681ee78caaf9b99c88390a74ff1d79ae61 (diff)
parentf174d31667dca184439f520b9624a1471d9556a6 (diff)
Merge remote-tracking branch 'origin/5.10' into dev
Conflicts: src/plugins/platforms/windows/qwindowsmousehandler.cpp src/plugins/platforms/xcb/qxcbimage.cpp tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/manual/qtabletevent/regular_widgets/main.cpp Done-with: Friedemann Kleint<Friedemann.Kleint@qt.io> Done-with: MÃ¥rten Nordheim<marten.nordheim@qt.io> Change-Id: I5b2499513a92c590ed0756f7d2e93c35a64b7f30
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
{