diff options
author | Lars Knoll <lars.knoll@nokia.com> | 2009-03-23 10:18:55 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-03-23 10:18:55 +0100 |
commit | e5fcad302d86d316390c6b0f62759a067313e8a9 (patch) | |
tree | c2afbf6f1066b6ce261f14341cf6d310e5595bc1 /tests/auto/qgraphicsview/tst_qgraphicsview_2.cpp | |
download | qt4-tools-e5fcad302d86d316390c6b0f62759a067313e8a9.tar.gz |
Long live Qt 4.5!
Diffstat (limited to 'tests/auto/qgraphicsview/tst_qgraphicsview_2.cpp')
-rw-r--r-- | tests/auto/qgraphicsview/tst_qgraphicsview_2.cpp | 956 |
1 files changed, 956 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview_2.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview_2.cpp new file mode 100644 index 0000000000..702b253e86 --- /dev/null +++ b/tests/auto/qgraphicsview/tst_qgraphicsview_2.cpp @@ -0,0 +1,956 @@ +/**************************************************************************** +** +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Qt Software Information (qt-info@nokia.com) +** +** 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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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. +** +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this +** package. +** +** 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at qt-sales@nokia.com. +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include <QtTest/QtTest> +#include <QSize> +#include <QRectF> +#include <QTransform> + +Q_DECLARE_METATYPE(QList<int>) +Q_DECLARE_METATYPE(QList<QRectF>) +Q_DECLARE_METATYPE(QMatrix) +Q_DECLARE_METATYPE(QPainterPath) +Q_DECLARE_METATYPE(QPointF) +Q_DECLARE_METATYPE(QRectF) +Q_DECLARE_METATYPE(Qt::ScrollBarPolicy) + +static void _scrollBarRanges_data_1() +{ + // No motif, flat frame + QTest::newRow("1") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << 0 << 0 << 0 << false << false; + QTest::newRow("2") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 16) << 0 << 16 << false << false; + QTest::newRow("3") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 16) << 0 << (100 + 16) << false << false; + QTest::newRow("4") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << 0 << 0 << 0 << false << false; + QTest::newRow("5") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -100 << (16-50) << -100 << (-100 + 16) << false << false; + QTest::newRow("6") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -100 << (16-50) << -100 << 16 << false << false; + QTest::newRow("7") << QSize(150, 100) << QRectF(0, 0, 151, 101) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << 17 << 0 << 17 << false << false; + QTest::newRow("8") << QSize(150, 100) << QRectF(0, 0, 201, 101) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 17) << 0 << 17 << false << false; + QTest::newRow("9") << QSize(150, 100) << QRectF(0, 0, 201, 201) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 17) << 0 << (100 + 17) << false << false; + QTest::newRow("10") << QSize(150, 100) << QRectF(-101, -101, 151, 101) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -101 << (-100 + 16) << -101 << (-100 + 16) << false << false; + QTest::newRow("11") << QSize(150, 100) << QRectF(-101, -101, 201, 101) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-101) << (16-50) << -101 << (-100 + 16) << false << false; + QTest::newRow("12") << QSize(150, 100) << QRectF(-101, -101, 201, 201) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-101) << (16-50) << (-101) << 16 << false << false; + QTest::newRow("13") << QSize(150, 100) << QRectF(0, 0, 166, 116) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (16 + 16) << 0 << (16 + 16) << false << false; + QTest::newRow("14") << QSize(150, 100) << QRectF(0, 0, 216, 116) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 16 + 16) << 0 << (16 + 16) << false << false; + QTest::newRow("15") << QSize(150, 100) << QRectF(0, 0, 216, 216) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 16 + 16) << 0 << (100 + 16 + 16) << false << false; + QTest::newRow("16") << QSize(150, 100) << QRectF(-116, -116, 166, 116) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-100 - 16) << (-100 + 16) << (-100 - 16) << (-100 + 16) << false << false; + QTest::newRow("17") << QSize(150, 100) << QRectF(-116, -116, 216, 116) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-100 - 16) << (16-50) << (-100 - 16) << (-100 + 16) << false << false; + QTest::newRow("18") << QSize(150, 100) << QRectF(-116, -116, 216, 216) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-100 - 16) << (16-50) << (-100 - 16) << 16 << false << false; + QTest::newRow("1 x2") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (150 + 16) << 0 << (100 + 16) << false << false; + QTest::newRow("2 x2") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (250 + 16) << 0 << (100 + 16) << false << false; + QTest::newRow("3 x2") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (250 + 16) << 0 << (300 + 16) << false << false; + QTest::newRow("4 x2") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -200 << (-50 + 16) << -200 << (-100 + 16) << false << false; + QTest::newRow("5 x2") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -200 << (50 + 16) << -200 << (-100 + 16) << false << false; + QTest::newRow("6 x2") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -200 << (50 + 16) << -200 << (100 + 16) << false << false; + QTest::newRow("1 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 0 << 0 << 0 << false << false; + QTest::newRow("2 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 50 << 0 << 0 << false << false; + QTest::newRow("3 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 50 << 0 << 100 << false << false; + QTest::newRow("4 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 0 << 0 << 0 << false << false; + QTest::newRow("5 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -100 << -50 << 0 << 0 << false << false; + QTest::newRow("6 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -100 << -50 << -100 << 0 << false << false; + QTest::newRow("7 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 151, 101) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 1 << 0 << 1 << false << false; + QTest::newRow("8 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 201, 101) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 51 << 0 << 1 << false << false; + QTest::newRow("9 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 201, 201) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 51 << 0 << 101 << false << false; + QTest::newRow("10 No ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 151, 101) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -101 << -100 << -101 << -100 << false << false; + QTest::newRow("11 No ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 201, 101) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -101 << -50 << -101 << -100 << false << false; + QTest::newRow("12 No ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 201, 201) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -101 << -50 << -101 << 0 << false << false; + QTest::newRow("13 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 166, 116) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 16 << 0 << 16 << false << false; + QTest::newRow("14 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 216, 116) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << (50 + 16) << 0 << 16 << false << false; + QTest::newRow("15 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 216, 216) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << (50 + 16) << 0 << (100 + 16) << false << false; + QTest::newRow("16 No ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 166, 116) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << (-100 - 16) << -100 << (-100 - 16) << -100 << false << false; + QTest::newRow("17 No ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 216, 116) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << (-100 - 16) << -50 << (-100 - 16) << -100 << false << false; + QTest::newRow("18 No ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 216, 216) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << (-100 - 16) << -50 << (-100 - 16) << 0 << false << false; + QTest::newRow("1 x2 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 150 << 0 << 100 << false << false; + QTest::newRow("2 x2 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 250 << 0 << 100 << false << false; + QTest::newRow("3 x2 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 250 << 0 << 300 << false << false; + QTest::newRow("4 x2 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -200 << -50 << -200 << -100 << false << false; + QTest::newRow("5 x2 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -200 << 50 << -200 << -100 << false << false; + QTest::newRow("6 x2 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -200 << 50 << -200 << 100 << false << false; + QTest::newRow("1 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << 16 << 0 << 16 << false << false; + QTest::newRow("2 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (50 + 16) << 0 << 16 << false << false; + QTest::newRow("3 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (50 + 16) << 0 << (100 + 16) << false << false; + QTest::newRow("4 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -100 << (-100 + 16) << -100 << (-100 + 16) << false << false; + QTest::newRow("5 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -100 << (16-50) << -100 << (-100 + 16) << false << false; + QTest::newRow("6 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -100 << (16-50) << -100 << 16 << false << false; + QTest::newRow("7 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 151, 101) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << 17 << 0 << 17 << false << false; + QTest::newRow("8 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 201, 101) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (17+50) << 0 << 17 << false << false; + QTest::newRow("9 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 201, 201) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << 67 << 0 << 117 << false << false; + QTest::newRow("10 Always ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 151, 101) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -101 << (-100 + 16) << -101 << (-100 + 16) << false << false; + QTest::newRow("11 Always ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 201, 101) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -101 << (16-50) << -101 << (-100 + 16) << false << false; + QTest::newRow("12 Always ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 201, 201) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -101 << (16-50) << -101 << 16 << false << false; + QTest::newRow("13 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 166, 116) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << 32 << 0 << 32 << false << false; + QTest::newRow("14 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 216, 116) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (50 + 32) << 0 << 32 << false << false; + QTest::newRow("15 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 216, 216) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (50 + 32) << 0 << (100 + 32) << false << false; + QTest::newRow("16 Always ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 166, 116) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << (-100 - 16) << (-100 + 16) << (-100 - 16) << (-100 + 16) << false << false; + QTest::newRow("17 Always ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 216, 116) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << (-100 - 16) << (16-50) << (-100 - 16) << (-100 + 16) << false << false; + QTest::newRow("18 Always ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 216, 216) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << (-100 - 16) << (16-50) << (-100 - 16) << 16 << false << false; + QTest::newRow("1 x2 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (150 + 16) << 0 << (100 + 16) << false << false; + QTest::newRow("2 x2 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (250 + 16) << 0 << (100 + 16) << false << false; + QTest::newRow("3 x2 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (250 + 16) << 0 << (300 + 16) << false << false; + QTest::newRow("4 x2 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -200 << (-50 + 16) << -200 << (-100 + 16) << false << false; + QTest::newRow("5 x2 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -200 << (50 + 16) << -200 << (-100 + 16) << false << false; + QTest::newRow("6 x2 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -200 << (50 + 16) << -200 << (100 + 16) << false << false; +} + +static void _scrollBarRanges_data_2() +{ + // Motif, flat frame + QTest::newRow("Motif, 1") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << 0 << 0 << 0 << true << false; + QTest::newRow("Motif, 2") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 16) << 0 << 16 << true << false; + QTest::newRow("Motif, 3") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 16) << 0 << (100 + 16) << true << false; + QTest::newRow("Motif, 4") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << 0 << 0 << 0 << true << false; + QTest::newRow("Motif, 5") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -100 << (16-50) << -100 << (-100 + 16) << true << false; + QTest::newRow("Motif, 6") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -100 << (16-50) << -100 << 16 << true << false; + QTest::newRow("Motif, 7") << QSize(150, 100) << QRectF(0, 0, 151, 101) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << 17 << 0 << 17 << true << false; + QTest::newRow("Motif, 8") << QSize(150, 100) << QRectF(0, 0, 201, 101) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 17) << 0 << 17 << true << false; + QTest::newRow("Motif, 9") << QSize(150, 100) << QRectF(0, 0, 201, 201) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 17) << 0 << (100 + 17) << true << false; + QTest::newRow("Motif, 10") << QSize(150, 100) << QRectF(-101, -101, 151, 101) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -101 << (-100 + 16) << -101 << (-100 + 16) << true << false; + QTest::newRow("Motif, 11") << QSize(150, 100) << QRectF(-101, -101, 201, 101) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-101) << (16-50) << -101 << (-100 + 16) << true << false; + QTest::newRow("Motif, 12") << QSize(150, 100) << QRectF(-101, -101, 201, 201) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-101) << (16-50) << (-101) << 16 << true << false; + QTest::newRow("Motif, 13") << QSize(150, 100) << QRectF(0, 0, 166, 116) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (16 + 16) << 0 << (16 + 16) << true << false; + QTest::newRow("Motif, 14") << QSize(150, 100) << QRectF(0, 0, 216, 116) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 16 + 16) << 0 << (16 + 16) << true << false; + QTest::newRow("Motif, 15") << QSize(150, 100) << QRectF(0, 0, 216, 216) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 16 + 16) << 0 << (100 + 16 + 16) << true << false; + QTest::newRow("Motif, 16") << QSize(150, 100) << QRectF(-116, -116, 166, 116) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-100 - 16) << (-100 + 16) << (-100 - 16) << (-100 + 16) << true << false; + QTest::newRow("Motif, 17") << QSize(150, 100) << QRectF(-116, -116, 216, 116) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-100 - 16) << (16-50) << (-100 - 16) << (-100 + 16) << true << false; + QTest::newRow("Motif, 18") << QSize(150, 100) << QRectF(-116, -116, 216, 216) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-100 - 16) << (16-50) << (-100 - 16) << 16 << true << false; + QTest::newRow("Motif, 1 x2") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (150 + 16) << 0 << (100 + 16) << true << false; + QTest::newRow("Motif, 2 x2") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (250 + 16) << 0 << (100 + 16) << true << false; + QTest::newRow("Motif, 3 x2") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (250 + 16) << 0 << (300 + 16) << true << false; + QTest::newRow("Motif, 4 x2") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -200 << (-50 + 16) << -200 << (-100 + 16) << true << false; + QTest::newRow("Motif, 5 x2") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -200 << (50 + 16) << -200 << (-100 + 16) << true << false; + QTest::newRow("Motif, 6 x2") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -200 << (50 + 16) << -200 << (100 + 16) << true << false; + QTest::newRow("Motif, 1 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 0 << 0 << 0 << true << false; + QTest::newRow("Motif, 2 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 50 << 0 << 0 << true << false; + QTest::newRow("Motif, 3 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 50 << 0 << 100 << true << false; + QTest::newRow("Motif, 4 No ScrollBars") << QSize(100, 100) << QRectF(-100, -100, 100, 100) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 0 << 0 << 0 << true << false; + QTest::newRow("Motif, 5 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -100 << -50 << 0 << 0 << true << false; + QTest::newRow("Motif, 6 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -100 << -50 << -100 << 0 << true << false; + QTest::newRow("Motif, 7 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 151, 101) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 1 << 0 << 1 << true << false; + QTest::newRow("Motif, 8 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 201, 101) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 51 << 0 << 1 << true << false; + QTest::newRow("Motif, 9 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 201, 201) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 51 << 0 << 101 << true << false; + QTest::newRow("Motif, 10 No ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 151, 101) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -101 << -100 << -101 << -100 << true << false; + QTest::newRow("Motif, 11 No ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 201, 101) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -101 << -50 << -101 << -100 << true << false; + QTest::newRow("Motif, 12 No ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 201, 201) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -101 << -50 << -101 << 0 << true << false; + QTest::newRow("Motif, 13 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 166, 116) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 16 << 0 << 16 << true << false; + QTest::newRow("Motif, 14 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 216, 116) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << (50 + 16) << 0 << 16 << true << false; + QTest::newRow("Motif, 15 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 216, 216) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << (50 + 16) << 0 << (100 + 16) << true << false; + QTest::newRow("Motif, 16 No ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 166, 116) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << (-100 - 16) << -100 << (-100 - 16) << -100 << true << false; + QTest::newRow("Motif, 17 No ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 216, 116) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << (-100 - 16) << -50 << (-100 - 16) << -100 << true << false; + QTest::newRow("Motif, 18 No ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 216, 216) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << (-100 - 16) << -50 << (-100 - 16) << 0 << true << false; + QTest::newRow("Motif, 1 x2 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 150 << 0 << 100 << true << false; + QTest::newRow("Motif, 2 x2 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 250 << 0 << 100 << true << false; + QTest::newRow("Motif, 3 x2 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 250 << 0 << 300 << true << false; + QTest::newRow("Motif, 4 x2 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -200 << -50 << -200 << -100 << true << false; + QTest::newRow("Motif, 5 x2 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -200 << 50 << -200 << -100 << true << false; + QTest::newRow("Motif, 6 x2 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -200 << 50 << -200 << 100 << true << false; + QTest::newRow("Motif, 1 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << 16 << 0 << 16 << true << false; + QTest::newRow("Motif, 2 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (50 + 16) << 0 << 16 << true << false; + QTest::newRow("Motif, 3 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (50 + 16) << 0 << (100 + 16) << true << false; + QTest::newRow("Motif, 4 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -100 << (-100 + 16) << -100 << (-100 + 16) << true << false; + QTest::newRow("Motif, 5 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -100 << (16-50) << -100 << (-100 + 16) << true << false; + QTest::newRow("Motif, 6 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -100 << (16-50) << -100 << 16 << true << false; + QTest::newRow("Motif, 7 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 151, 101) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << 17 << 0 << 17 << true << false; + QTest::newRow("Motif, 8 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 201, 101) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (117-50) << 0 << 17 << true << false; + QTest::newRow("Motif, 9 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 201, 201) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (117-50) << 0 << 117 << true << false; + QTest::newRow("Motif, 10 Always ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 151, 101) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -101 << (-100 + 16) << -101 << (-100 + 16) << true << false; + QTest::newRow("Motif, 11 Always ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 201, 101) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -101 << (16-50) << -101 << (-100 + 16) << true << false; + QTest::newRow("Motif, 12 Always ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 201, 201) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -101 << (16-50) << -101 << 16 << true << false; + QTest::newRow("Motif, 13 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 166, 116) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << 32 << 0 << 32 << true << false; + QTest::newRow("Motif, 14 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 216, 116) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (50 + 32) << 0 << 32 << true << false; + QTest::newRow("Motif, 15 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 216, 216) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (50 + 32) << 0 << (100 + 32) << true << false; + QTest::newRow("Motif, 16 Always ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 166, 116) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << (-100 - 16) << (-100 + 16) << (-100 - 16) << (-100 + 16) << true << false; + QTest::newRow("Motif, 17 Always ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 216, 116) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << (-100 - 16) << (16-50) << (-100 - 16) << (-100 + 16) << true << false; + QTest::newRow("Motif, 18 Always ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 216, 216) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << (-100 - 16) << (16-50) << (-100 - 16) << 16 << true << false; + QTest::newRow("Motif, 1 x2 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (150 + 16) << 0 << (100 + 16) << true << false; + QTest::newRow("Motif, 2 x2 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (250 + 16) << 0 << (100 + 16) << true << false; + QTest::newRow("Motif, 3 x2 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (250 + 16) << 0 << (300 + 16) << true << false; + QTest::newRow("Motif, 4 x2 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -200 << (-50 + 16) << -200 << (-100 + 16) << true << false; + QTest::newRow("Motif, 5 x2 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -200 << (50 + 16) << -200 << (-100 + 16) << true << false; + QTest::newRow("Motif, 6 x2 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -200 << (50 + 16) << -200 << (100 + 16) << true << false; +} + +static void _scrollBarRanges_data_3() +{ + // No motif, styled panel + QTest::newRow("Styled, 1") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << 0 << 0 << 0 << false << true; + QTest::newRow("Styled, 2") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 16) << 0 << 16 << false << true; + QTest::newRow("Styled, 3") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 16) << 0 << (100 + 16) << false << true; + QTest::newRow("Styled, 4") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << 0 << 0 << 0 << false << true; + QTest::newRow("Styled, 5") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -100 << (16-50) << -100 << (-100 + 16) << false << true; + QTest::newRow("Styled, 6") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -100 << (16-50) << -100 << 16 << false << true; + QTest::newRow("Styled, 7") << QSize(150, 100) << QRectF(0, 0, 151, 101) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << 17 << 0 << 17 << false << true; + QTest::newRow("Styled, 8") << QSize(150, 100) << QRectF(0, 0, 201, 101) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 17) << 0 << 17 << false << true; + QTest::newRow("Styled, 9") << QSize(150, 100) << QRectF(0, 0, 201, 201) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 17) << 0 << (100 + 17) << false << true; + QTest::newRow("Styled, 10") << QSize(150, 100) << QRectF(-101, -101, 151, 101) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -101 << (-100 + 16) << -101 << (-100 + 16) << false << true; + QTest::newRow("Styled, 11") << QSize(150, 100) << QRectF(-101, -101, 201, 101) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-101) << (16-50) << -101 << (-100 + 16) << false << true; + QTest::newRow("Styled, 12") << QSize(150, 100) << QRectF(-101, -101, 201, 201) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-101) << (16-50) << (-101) << 16 << false << true; + QTest::newRow("Styled, 13") << QSize(150, 100) << QRectF(0, 0, 166, 116) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (16 + 16) << 0 << (16 + 16) << false << true; + QTest::newRow("Styled, 14") << QSize(150, 100) << QRectF(0, 0, 216, 116) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 16 + 16) << 0 << (16 + 16) << false << true; + QTest::newRow("Styled, 15") << QSize(150, 100) << QRectF(0, 0, 216, 216) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 16 + 16) << 0 << (100 + 16 + 16) << false << true; + QTest::newRow("Styled, 16") << QSize(150, 100) << QRectF(-116, -116, 166, 116) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-100 - 16) << (-100 + 16) << (-100 - 16) << (-100 + 16) << false << true; + QTest::newRow("Styled, 17") << QSize(150, 100) << QRectF(-116, -116, 216, 116) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-100 - 16) << (16-50) << (-100 - 16) << (-100 + 16) << false << true; + QTest::newRow("Styled, 18") << QSize(150, 100) << QRectF(-116, -116, 216, 216) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-100 - 16) << (16-50) << (-100 - 16) << 16 << false << true; + QTest::newRow("Styled, 1 x2") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (150 + 16) << 0 << (100 + 16) << false << true; + QTest::newRow("Styled, 2 x2") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (250 + 16) << 0 << (100 + 16) << false << true; + QTest::newRow("Styled, 3 x2") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (250 + 16) << 0 << (300 + 16) << false << true; + QTest::newRow("Styled, 4 x2") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -200 << (-50 + 16) << -200 << (-100 + 16) << false << true; + QTest::newRow("Styled, 5 x2") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -200 << (50 + 16) << -200 << (-100 + 16) << false << true; + QTest::newRow("Styled, 6 x2") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -200 << (50 + 16) << -200 << (100 + 16) << false << true; + QTest::newRow("Styled, 1 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 0 << 0 << 0 << false << true; + QTest::newRow("Styled, 2 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 50 << 0 << 0 << false << true; + QTest::newRow("Styled, 3 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 50 << 0 << 100 << false << true; + QTest::newRow("Styled, 4 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 0 << 0 << 0 << false << true; + QTest::newRow("Styled, 5 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -100 << -50 << 0 << 0 << false << true; + QTest::newRow("Styled, 6 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -100 << -50 << -100 << 0 << false << true; + QTest::newRow("Styled, 7 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 151, 101) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 1 << 0 << 1 << false << true; + QTest::newRow("Styled, 8 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 201, 101) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 51 << 0 << 1 << false << true; + QTest::newRow("Styled, 9 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 201, 201) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 51 << 0 << 101 << false << true; + QTest::newRow("Styled, 10 No ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 151, 101) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -101 << -100 << -101 << -100 << false << true; + QTest::newRow("Styled, 11 No ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 201, 101) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -101 << -50 << -101 << -100 << false << true; + QTest::newRow("Styled, 12 No ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 201, 201) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -101 << -50 << -101 << 0 << false << true; + QTest::newRow("Styled, 13 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 166, 116) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 16 << 0 << 16 << false << true; + QTest::newRow("Styled, 14 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 216, 116) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << (50 + 16) << 0 << 16 << false << true; + QTest::newRow("Styled, 15 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 216, 216) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << (50 + 16) << 0 << (100 + 16) << false << true; + QTest::newRow("Styled, 16 No ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 166, 116) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << (-100 - 16) << -100 << (-100 - 16) << -100 << false << true; + QTest::newRow("Styled, 17 No ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 216, 116) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << (-100 - 16) << -50 << (-100 - 16) << -100 << false << true; + QTest::newRow("Styled, 18 No ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 216, 216) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << (-100 - 16) << -50 << (-100 - 16) << 0 << false << true; + QTest::newRow("Styled, 1 x2 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 150 << 0 << 100 << false << true; + QTest::newRow("Styled, 2 x2 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 250 << 0 << 100 << false << true; + QTest::newRow("Styled, 3 x2 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 250 << 0 << 300 << false << true; + QTest::newRow("Styled, 4 x2 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -200 << -50 << -200 << -100 << false << true; + QTest::newRow("Styled, 5 x2 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -200 << 50 << -200 << -100 << false << true; + QTest::newRow("Styled, 6 x2 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -200 << 50 << -200 << 100 << false << true; + QTest::newRow("Styled, 1 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << 16 << 0 << 16 << false << true; + QTest::newRow("Styled, 2 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (50 + 16) << 0 << 16 << false << true; + QTest::newRow("Styled, 3 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (50 + 16) << 0 << (100 + 16) << false << true; + QTest::newRow("Styled, 4 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -100 << (-100 + 16) << -100 << (-100 + 16) << false << true; + QTest::newRow("Styled, 5 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -100 << (16-50) << -100 << (-100 + 16) << false << true; + QTest::newRow("Styled, 6 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -100 << (16-50) << -100 << 16 << false << true; + QTest::newRow("Styled, 7 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 151, 101) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << 17 << 0 << 17 << false << true; + QTest::newRow("Styled, 8 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 201, 101) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (117-50) << 0 << 17 << false << true; + QTest::newRow("Styled, 9 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 201, 201) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (117-50) << 0 << 117 << false << true; + QTest::newRow("Styled, 10 Always ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 151, 101) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -101 << (-100 + 16) << -101 << (-100 + 16) << false << true; + QTest::newRow("Styled, 11 Always ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 201, 101) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -101 << (16-50) << -101 << (-100 + 16) << false << true; + QTest::newRow("Styled, 12 Always ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 201, 201) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -101 << (16-50) << -101 << 16 << false << true; + QTest::newRow("Styled, 13 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 166, 116) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << 32 << 0 << 32 << false << true; + QTest::newRow("Styled, 14 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 216, 116) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (50 + 32) << 0 << 32 << false << true; + QTest::newRow("Styled, 15 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 216, 216) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (50 + 32) << 0 << (100 + 32) << false << true; + QTest::newRow("Styled, 16 Always ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 166, 116) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << (-100 - 16) << (-100 + 16) << (-100 - 16) << (-100 + 16) << false << true; + QTest::newRow("Styled, 17 Always ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 216, 116) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << (-100 - 16) << (16-50) << (-100 - 16) << (-100 + 16) << false << true; + QTest::newRow("Styled, 18 Always ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 216, 216) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << (-100 - 16) << (16-50) << (-100 - 16) << 16 << false << true; + QTest::newRow("Styled, 1 x2 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (150 + 16) << 0 << (100 + 16) << false << true; + QTest::newRow("Styled, 2 x2 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (250 + 16) << 0 << (100 + 16) << false << true; + QTest::newRow("Styled, 3 x2 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (250 + 16) << 0 << (300 + 16) << false << true; + QTest::newRow("Styled, 4 x2 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -200 << (-50 + 16) << -200 << (-100 + 16) << false << true; + QTest::newRow("Styled, 5 x2 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -200 << (50 + 16) << -200 << (-100 + 16) << false << true; + QTest::newRow("Styled, 6 x2 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -200 << (50 + 16) << -200 << (100 + 16) << false << true; +} + +static void _scrollBarRanges_data_4() +{ + // Motif, styled panel + QTest::newRow("Motif, Styled, 1") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << 0 << 0 << 0 << true << true; + QTest::newRow("Motif, Styled, 2") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 16 + 4) << 0 << (16 + 4) << true << true; + QTest::newRow("Motif, Styled, 3") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 16 + 4) << 0 << (100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 4") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << 0 << 0 << 0 << true << true; + QTest::newRow("Motif, Styled, 5") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -100 << (16 + 4 - 50) << -100 << (-100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 6") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -100 << (16 + 4 - 50) << -100 << (16 + 4) << true << true; + QTest::newRow("Motif, Styled, 7") << QSize(150, 100) << QRectF(0, 0, 151, 101) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (17 + 4) << 0 << (17 + 4) << true << true; + QTest::newRow("Motif, Styled, 8") << QSize(150, 100) << QRectF(0, 0, 201, 101) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 17 + 4) << 0 << (17 + 4) << true << true; + QTest::newRow("Motif, Styled, 9") << QSize(150, 100) << QRectF(0, 0, 201, 201) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 17 + 4) << 0 << (100 + 17 + 4) << true << true; + QTest::newRow("Motif, Styled, 10") << QSize(150, 100) << QRectF(-101, -101, 151, 101) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -101 << (-100 + 16 + 4) << -101 << (-100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 11") << QSize(150, 100) << QRectF(-101, -101, 201, 101) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-101) << (16 + 4 - 50) << -101 << (-100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 12") << QSize(150, 100) << QRectF(-101, -101, 201, 201) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-101) << (16 + 4 - 50) << (-101) << (16 + 4) << true << true; + QTest::newRow("Motif, Styled, 13") << QSize(150, 100) << QRectF(0, 0, 166, 116) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (16 + 16 + 4) << 0 << (16 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 14") << QSize(150, 100) << QRectF(0, 0, 216, 116) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 16 + 16 + 4) << 0 << (16 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 15") << QSize(150, 100) << QRectF(0, 0, 216, 216) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (50 + 16 + 16 + 4) << 0 << (100 + 16 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 16") << QSize(150, 100) << QRectF(-116, -116, 166, 116) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-100 - 16) << (-100 + 16 + 4) << (-100 - 16) << (-100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 17") << QSize(150, 100) << QRectF(-116, -116, 216, 116) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-100 - 16) << (16 + 4 - 50) << (-100 - 16) << (-100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 18") << QSize(150, 100) << QRectF(-116, -116, 216, 216) << QTransform() + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << (-100 - 16) << (16 + 4 - 50) << (-100 - 16) << (16 + 4) << true << true; + QTest::newRow("Motif, Styled, 1 x2") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (150 + 16 + 4) << 0 << (100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 2 x2") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (250 + 16 + 4) << 0 << (100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 3 x2") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << 0 << (250 + 16 + 4) << 0 << (300 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 4 x2") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -200 << (-50 + 16 + 4) << -200 << (-100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 5 x2") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -200 << (50 + 16 + 4) << -200 << (-100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 6 x2") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAsNeeded << Qt::ScrollBarAsNeeded + << -200 << (50 + 16 + 4) << -200 << (100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 1 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 0 << 0 << 0 << true << true; + QTest::newRow("Motif, Styled, 2 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 50 << 0 << 0 << true << true; + QTest::newRow("Motif, Styled, 3 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 50 << 0 << 100 << true << true; + QTest::newRow("Motif, Styled, 4 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 0 << 0 << 0 << true << true; + QTest::newRow("Motif, Styled, 5 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -100 << -50 << 0 << 0 << true << true; + QTest::newRow("Motif, Styled, 6 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -100 << -50 << -100 << 0 << true << true; + QTest::newRow("Motif, Styled, 7 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 151, 101) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 1 << 0 << 1 << true << true; + QTest::newRow("Motif, Styled, 8 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 201, 101) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 51 << 0 << 1 << true << true; + QTest::newRow("Motif, Styled, 9 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 201, 201) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 51 << 0 << 101 << true << true; + QTest::newRow("Motif, Styled, 10 No ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 151, 101) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -101 << -100 << -101 << -100 << true << true; + QTest::newRow("Motif, Styled, 11 No ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 201, 101) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -101 << -50 << -101 << -100 << true << true; + QTest::newRow("Motif, Styled, 12 No ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 201, 201) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -101 << -50 << -101 << 0 << true << true; + QTest::newRow("Motif, Styled, 13 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 166, 116) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 16 << 0 << 16 << true << true; + QTest::newRow("Motif, Styled, 14 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 216, 116) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << (50 + 16) << 0 << 16 << true << true; + QTest::newRow("Motif, Styled, 15 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 216, 216) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << (50 + 16) << 0 << (100 + 16) << true << true; + QTest::newRow("Motif, Styled, 16 No ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 166, 116) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << (-100 - 16) << -100 << (-100 - 16) << -100 << true << true; + QTest::newRow("Motif, Styled, 17 No ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 216, 116) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << (-100 - 16) << -50 << (-100 - 16) << -100 << true << true; + QTest::newRow("Motif, Styled, 18 No ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 216, 216) << QTransform() + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << (-100 - 16) << -50 << (-100 - 16) << 0 << true << true; + QTest::newRow("Motif, Styled, 1 x2 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 150 << 0 << 100 << true << true; + QTest::newRow("Motif, Styled, 2 x2 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 250 << 0 << 100 << true << true; + QTest::newRow("Motif, Styled, 3 x2 No ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << 0 << 250 << 0 << 300 << true << true; + QTest::newRow("Motif, Styled, 4 x2 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -200 << -50 << -200 << -100 << true << true; + QTest::newRow("Motif, Styled, 5 x2 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -200 << 50 << -200 << -100 << true << true; + QTest::newRow("Motif, Styled, 6 x2 No ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOff << Qt::ScrollBarAlwaysOff + << -200 << 50 << -200 << 100 << true << true; + QTest::newRow("Motif, Styled, 1 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (16 + 4) << 0 << (16 + 4) << true << true; + QTest::newRow("Motif, Styled, 2 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (50 + 16 + 4) << 0 << (16 + 4) << true << true; + QTest::newRow("Motif, Styled, 3 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (50 + 16 + 4) << 0 << (100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 4 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -100 << (-100 + 16 + 4) << -100 << (-100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 5 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -100 << (16 + 4 - 50) << -100 << (-100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 6 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -100 << (16 + 4 - 50) << -100 << (16 + 4) << true << true; + QTest::newRow("Motif, Styled, 7 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 151, 101) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (17 + 4) << 0 << (17 + 4) << true << true; + QTest::newRow("Motif, Styled, 8 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 201, 101) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (117 + 4 - 50) << 0 << (17 + 4) << true << true; + QTest::newRow("Motif, Styled, 9 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 201, 201) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (117 + 4 - 50) << 0 << (117 + 4) << true << true; + QTest::newRow("Motif, Styled, 10 Always ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 151, 101) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -101 << (-100 + 16 + 4) << -101 << (-100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 11 Always ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 201, 101) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -101 << (16 + 4 - 50) << -101 << (-100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 12 Always ScrollBars") << QSize(150, 100) << QRectF(-101, -101, 201, 201) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -101 << (16 + 4 - 50) << -101 << (16 + 4) << true << true; + QTest::newRow("Motif, Styled, 13 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 166, 116) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (32 + 4) << 0 << (32 + 4) << true << true; + QTest::newRow("Motif, Styled, 14 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 216, 116) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (50 + 32 + 4) << 0 << (32 + 4) << true << true; + QTest::newRow("Motif, Styled, 15 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 216, 216) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (50 + 32 + 4) << 0 << (100 + 32 + 4) << true << true; + QTest::newRow("Motif, Styled, 16 Always ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 166, 116) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << (-100 - 16) << (-100 + 16 + 4) << (-100 - 16) << (-100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 17 Always ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 216, 116) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << (-100 - 16) << (16 + 4 - 50) << (-100 - 16) << (-100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 18 Always ScrollBars") << QSize(150, 100) << QRectF(-116, -116, 216, 216) << QTransform() + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << (-100 - 16) << (16 + 4 - 50) << (-100 - 16) << (16 + 4) << true << true; + QTest::newRow("Motif, Styled, 1 x2 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (150 + 16 + 4) << 0 << (100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 2 x2 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (250 + 16 + 4) << 0 << (100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 3 x2 Always ScrollBars") << QSize(150, 100) << QRectF(0, 0, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << 0 << (250 + 16 + 4) << 0 << (300 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 4 x2 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 150, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -200 << (-50 + 16 + 4) << -200 << (-100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 5 x2 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 100) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -200 << (50 + 16 + 4) << -200 << (-100 + 16 + 4) << true << true; + QTest::newRow("Motif, Styled, 6 x2 Always ScrollBars") << QSize(150, 100) << QRectF(-100, -100, 200, 200) << QTransform().scale(2, 2) + << Qt::ScrollBarAlwaysOn << Qt::ScrollBarAlwaysOn + << -200 << (50 + 16 + 4) << -200 << (100 + 16 + 4) << true << true; +} + +void _scrollBarRanges_data() +{ + QTest::addColumn<QSize>("viewportSize"); + QTest::addColumn<QRectF>("sceneRect"); + QTest::addColumn<QTransform>("transform"); + QTest::addColumn<Qt::ScrollBarPolicy>("hbarpolicy"); + QTest::addColumn<Qt::ScrollBarPolicy>("vbarpolicy"); + QTest::addColumn<int>("hmin"); + QTest::addColumn<int>("hmax"); + QTest::addColumn<int>("vmin"); + QTest::addColumn<int>("vmax"); + QTest::addColumn<bool>("useMotif"); + QTest::addColumn<bool>("useStyledPanel"); + + _scrollBarRanges_data_1(); + _scrollBarRanges_data_2(); + _scrollBarRanges_data_3(); + _scrollBarRanges_data_4(); +} |