diff options
| author | Jan Arve Saether <jan-arve.saether@digia.com> | 2013-03-10 23:59:05 +0100 |
|---|---|---|
| committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-11 22:04:07 +0100 |
| commit | 3d3e6d9dfc28229f54ee26becefd273176aa7e0c (patch) | |
| tree | 1ecf9f77894c84742c72c0960b20d6bd6827d9de | |
| parent | 57f8095ed7ed57bbcf93912df89280850904e66c (diff) | |
Fix bug where default alignment was not centered
Change-Id: Ie803af39d142a7c16f5bde2d70613d006c61eaa6
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
| -rw-r--r-- | src/layouts/qgridlayoutengine.cpp | 9 |
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; } |
