diff options
author | Liang Qi <liang.qi@qt.io> | 2017-10-15 21:05:08 +0200 |
---|---|---|
committer | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2017-10-16 22:21:52 +0300 |
commit | 01afc8c810201b93a12fe7030344e03566d99001 (patch) | |
tree | 27727b38370209dc158856b4bb4d32ccd2e49fbe /src/gui/util/qgridlayoutengine.cpp | |
parent | a090076e93487f8e461d9b866b9da1c0c21cb59b (diff) | |
parent | 49da5ce10034161017b261e000d4e9063d962401 (diff) |
Merge remote-tracking branch 'origin/5.9' into 5.10
Change-Id: I3cf73c53cf131d0babfb558c2507bed0e0fc5f08
Diffstat (limited to 'src/gui/util/qgridlayoutengine.cpp')
-rw-r--r-- | src/gui/util/qgridlayoutengine.cpp | 6 |
1 files changed, 4 insertions, 2 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); |