diff options
author | Paul Olav Tvete <paul.tvete@nokia.com> | 2011-06-06 10:25:17 (GMT) |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@nokia.com> | 2011-06-06 10:25:17 (GMT) |
commit | 71cd7dfea1b8f0e287eb1616c0cda5493508c3c4 (patch) | |
tree | 9b0aedf6a235000164c4cb43eb3a99939611e545 /tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp | |
parent | 278c2b360aba87db2d1e5a2d3e14de7260d8a16e (diff) | |
parent | 408a522ffa25106334c3b29a4799e0d0a1719291 (diff) | |
download | Qt-71cd7dfea1b8f0e287eb1616c0cda5493508c3c4.zip Qt-71cd7dfea1b8f0e287eb1616c0cda5493508c3c4.tar.gz Qt-71cd7dfea1b8f0e287eb1616c0cda5493508c3c4.tar.bz2 |
Merge remote branch 'qt/4.8' into fire-master
Conflicts:
src/plugins/platforms/wayland/qwaylandclipboard.cpp
src/plugins/platforms/wayland/qwaylandclipboard.h
src/plugins/platforms/wayland/qwaylanddisplay.cpp
src/s60installs/eabi/QtOpenGLu.def
Diffstat (limited to 'tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp')
-rw-r--r-- | tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp | 67 |
1 files changed, 17 insertions, 50 deletions
diff --git a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp index 837df78..6b4ad19 100644 --- a/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp +++ b/tests/auto/qgraphicsgridlayout/tst_qgraphicsgridlayout.cpp @@ -7,29 +7,29 @@ ** This file is part of the test suite of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** ** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception +** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. ** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. ** ** ** @@ -3018,39 +3018,6 @@ static QSizeF wfh(Qt::SizeHint /*which*/, const QSizeF &constraint) return result; } -static qreal growthFactorBelowPreferredSize(qreal desired, qreal sumAvailable, qreal sumDesired) -{ - Q_ASSERT(sumDesired != 0.0); - return desired * qPow(sumAvailable / sumDesired, desired / sumDesired); -} - -static void expectedWidth(qreal minSize1, qreal prefSize1, - qreal minSize2, qreal prefSize2, - qreal targetSize, qreal *width1, qreal *width2) -{ - qreal sumAvail,factor1,factor2; - // stretch behaviour is different below and above preferred size... - if (targetSize < prefSize1 + prefSize2) { - sumAvail = targetSize - minSize1 - minSize2; - const qreal desired1 = prefSize1 - minSize1; - const qreal desired2 = prefSize2 - minSize2; - const qreal sumDesired = desired1 + desired2; - factor1 = growthFactorBelowPreferredSize(desired1, sumAvail, sumDesired); - factor2 = growthFactorBelowPreferredSize(desired2, sumAvail, sumDesired); - const qreal sumFactors = factor1 + factor2; - *width1 = sumAvail*factor1/sumFactors + minSize1; - *width2 = sumAvail*factor2/sumFactors + minSize2; - } else { - sumAvail = targetSize - prefSize1 - prefSize2; - factor1 = prefSize1; - factor2 = prefSize2; - const qreal sumFactors = factor1 + factor2; - *width1 = sumAvail*factor1/sumFactors + prefSize1; - *width2 = sumAvail*factor2/sumFactors + prefSize2; - } -} - - bool qFuzzyCompare(const QSizeF &a, const QSizeF &b) { return qFuzzyCompare(a.width(), b.width()) && qFuzzyCompare(a.height(), b.height()); |