diff options
author | Jan Arve Saether <jan-arve.saether@digia.com> | 2013-05-14 12:34:06 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-05-14 13:11:36 +0200 |
commit | 05b75bcea1a2d377584f360f28a66084b2cf8970 (patch) | |
tree | a8816d94c4e3ab1bac51c5c3fb1740fdd2cf944b /src/layouts/qquickgridlayoutengine_p.h | |
parent | 8b1a05e8d49e8cdc4caff1737c46f50a029d8add (diff) | |
download | qtquickcontrols-05b75bcea1a2d377584f360f28a66084b2cf8970.tar.gz qtquickcontrols-05b75bcea1a2d377584f360f28a66084b2cf8970.tar.bz2 qtquickcontrols-05b75bcea1a2d377584f360f28a66084b2cf8970.zip |
Quick Layouts: Do not arrange items at sub-pixel positions.
Positioning an item to a sub-pixel position might cause the item to
not appear as crisp as it should be.
To prevent this, the layout will round off the position and size to the
nearest integer.
Task-number: QTBUG-31038
Change-Id: Id07b9ed5adc64e07f08f1abe0f37716101b01456
Reviewed-by: Caroline Chao <caroline.chao@digia.com>
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'src/layouts/qquickgridlayoutengine_p.h')
-rw-r--r-- | src/layouts/qquickgridlayoutengine_p.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/layouts/qquickgridlayoutengine_p.h b/src/layouts/qquickgridlayoutengine_p.h index 67b0257b..29317ffb 100644 --- a/src/layouts/qquickgridlayoutengine_p.h +++ b/src/layouts/qquickgridlayoutengine_p.h @@ -111,8 +111,9 @@ public: void setGeometry(const QRectF &rect) { - m_item->setPosition(rect.topLeft()); - m_item->setSize(rect.size()); + const QRect r(rect.toRect()); + m_item->setPosition(r.topLeft()); + m_item->setSize(r.size()); } QQuickItem *layoutItem() const { return m_item; } |