summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Arve Saether <jan-arve.saether@digia.com>2013-03-10 23:59:05 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-03-11 22:04:07 +0100
commit3d3e6d9dfc28229f54ee26becefd273176aa7e0c (patch)
tree1ecf9f77894c84742c72c0960b20d6bd6827d9de /src
parent57f8095ed7ed57bbcf93912df89280850904e66c (diff)
Fix bug where default alignment was not centered
Change-Id: Ie803af39d142a7c16f5bde2d70613d006c61eaa6 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/layouts/qgridlayoutengine.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/layouts/qgridlayoutengine.cpp b/src/layouts/qgridlayoutengine.cpp
index ae5da09ea..30c02c978 100644
--- a/src/layouts/qgridlayoutengine.cpp
+++ b/src/layouts/qgridlayoutengine.cpp
@@ -936,16 +936,17 @@ Qt::Alignment QGridLayoutEngine::effectiveAlignment(const QGridLayoutItem *layou
// no vertical alignment, respect the row alignment
int y = layoutItem->firstRow();
align |= (rowAlignment(y, Qt::Vertical) & Qt::AlignVertical_Mask);
- if (!align)
- align = Qt::AlignVCenter;
+ if (!(align & Qt::AlignVertical_Mask))
+ align |= Qt::AlignVCenter;
}
if (!(align & Qt::AlignHorizontal_Mask)) {
// no horizontal alignment, respect the column alignment
int x = layoutItem->firstColumn();
align |= (rowAlignment(x, Qt::Horizontal) & Qt::AlignHorizontal_Mask);
- if (!align)
- align = Qt::AlignHCenter;
+ if (!(align & Qt::AlignHorizontal_Mask))
+ align |= Qt::AlignHCenter;
}
+
return align;
}