1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
8 ** |
8 ** |
1923 int height = layouts.at(label->vLayoutIndex).size; |
1923 int height = layouts.at(label->vLayoutIndex).size; |
1924 if ((label->expandingDirections() & Qt::Vertical) == 0) { |
1924 if ((label->expandingDirections() & Qt::Vertical) == 0) { |
1925 /* |
1925 /* |
1926 If the field on the right-hand side is tall, |
1926 If the field on the right-hand side is tall, |
1927 we want the label to be top-aligned, but not too |
1927 we want the label to be top-aligned, but not too |
1928 much. So we introduce a 5 / 4 factor so that it |
1928 much. So we introduce a 7 / 4 factor so that it |
1929 gets a few extra pixels at the top. |
1929 gets some extra pixels at the top. |
1930 */ |
1930 */ |
1931 height = qMin(height, |
1931 height = qMin(height, |
1932 qMin(label->sizeHint.height() * 5 / 4, |
1932 qMin(label->sizeHint.height() * 7 / 4, |
1933 label->maxSize.height())); |
1933 label->maxSize.height())); |
1934 } |
1934 } |
1935 |
1935 |
1936 QSize sz(qMin(label->layoutWidth, label->sizeHint.width()), height); |
1936 QSize sz(qMin(label->layoutWidth, label->sizeHint.width()), height); |
1937 int x = leftOffset + rect.x() + label->layoutPos; |
1937 int x = leftOffset + rect.x() + label->layoutPos; |