summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/arthur/common/common.pro2
-rw-r--r--tests/arthur/common/paintcommands.cpp148
-rw-r--r--tests/arthur/common/paintcommands.h8
-rw-r--r--tests/arthur/data/qps/sizes.qps60
-rw-r--r--tests/arthur/datagenerator/datagenerator.pro1
-rw-r--r--tests/arthur/htmlgenerator/htmlgenerator.pro1
-rw-r--r--tests/arthur/lance/lance.pro1
-rw-r--r--tests/arthur/lance/main.cpp8
-rw-r--r--tests/arthur/performancediff/performancediff.pro1
-rw-r--r--tests/arthur/shower/shower.pro1
-rw-r--r--tests/auto/qaccessibility/tst_qaccessibility.cpp1007
-rw-r--r--tests/auto/qcombobox/tst_qcombobox.cpp24
-rw-r--r--tests/auto/qdatastream/tst_qdatastream.cpp1045
-rw-r--r--tests/auto/qmenubar/tst_qmenubar.cpp465
-rw-r--r--tests/auto/qsharedpointer/externaltests.cpp4
-rw-r--r--tests/auto/qsharedpointer/externaltests.h13
-rw-r--r--tests/auto/qsplitter/tst_qsplitter.cpp659
-rw-r--r--tests/auto/qtipc/lackey/lackey.pro1
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.cpp6
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp4
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.cpp7
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.h7
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp14
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.cpp8
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.cpp16
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.h6
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.cpp2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp8
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp32
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.h2
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.cpp8
-rw-r--r--tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.h5
-rw-r--r--tests/benchmarks/gui/painting/qtbench/benchmarktests.h30
-rw-r--r--tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp2
41 files changed, 548 insertions, 3072 deletions
diff --git a/tests/arthur/common/common.pro b/tests/arthur/common/common.pro
index 9510f87f06..2a1f8f04fb 100644
--- a/tests/arthur/common/common.pro
+++ b/tests/arthur/common/common.pro
@@ -6,7 +6,7 @@
#include(../arthurtester.pri)
#TEMPLATE = lib
#CONFIG += static
-#QT += xml opengl svg qt3support
+#QT += xml opengl svg
#build_all:!build_pass {
# CONFIG -= build_all
diff --git a/tests/arthur/common/paintcommands.cpp b/tests/arthur/common/paintcommands.cpp
index 9273142905..a6762082cb 100644
--- a/tests/arthur/common/paintcommands.cpp
+++ b/tests/arthur/common/paintcommands.cpp
@@ -49,10 +49,6 @@
#include <qtextlayout.h>
#include <qdebug.h>
-#ifdef QT3_SUPPORT
-#include <q3painter.h>
-#endif
-
#ifndef QT_NO_OPENGL
#include <qglpixelbuffer.h>
#endif
@@ -364,33 +360,6 @@ void PaintCommands::staticInit()
"^gradient_setCoordinateMode\\s+(\\w*)$",
"gradient_setCoordinateMode <coordinate method enum>",
"gradient_setCoordinateMode ObjectBoundingMode");
-#ifdef QT3_SUPPORT
- DECL_PAINTCOMMANDSECTION("qt3 drawing ops");
- DECL_PAINTCOMMAND("qt3_drawArc", command_qt3_drawArc,
- "^qt3_drawArc\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$",
- "qt3_drawArc <x> <y> <w> <h> <angleStart> <angleArc>\n - angles are expressed in 1/16th of degree",
- "qt3_drawArc 10 10 20 20 0 5760");
- DECL_PAINTCOMMAND("qt3_drawChord", command_qt3_drawChord,
- "^qt3_drawChord\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$",
- "qt3_drawChord <x> <y> <w> <h> <angleStart> <angleArc>\n - angles are expressed in 1/16th of degree",
- "qt3_drawChord 10 10 20 20 0 5760");
- DECL_PAINTCOMMAND("qt3_drawEllipse", command_qt3_drawEllipse,
- "^qt3_drawEllipse\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$",
- "qt3_drawEllipse <x> <y> <w> <h>",
- "qt3_drawEllipse 10 10 20 20");
- DECL_PAINTCOMMAND("qt3_drawPie", command_qt3_drawPie,
- "^qt3_drawPie\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$",
- "qt3_drawPie <x> <y> <w> <h> <angleStart> <angleArc>\n - angles are expressed in 1/16th of degree",
- "qt3_drawPie 10 10 20 20 0 5760");
- DECL_PAINTCOMMAND("qt3_drawRect", command_qt3_drawRect,
- "^qt3_drawRect\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)$",
- "qt3_drawRect <x> <y> <w> <h>",
- "qt3_drawRect 10 10 20 20");
- DECL_PAINTCOMMAND("qt3_drawRoundRect", command_qt3_drawRoundRect,
- "^qt3_drawRoundRect\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s+(-?\\w*)\\s*(-?\\w)?\\s*(-?\\w)?$",
- "qt3_drawRoundRect <x> <y> <w> <h> [rx] [ry]",
- "qt3_drawRoundRect 10 10 20 20 3 3");
-#endif
DECL_PAINTCOMMANDSECTION("drawing ops");
DECL_PAINTCOMMAND("drawPoint", command_drawPoint,
"^drawPoint\\s+(-?[\\w.]*)\\s+(-?[\\w.]*)$",
@@ -1271,123 +1240,6 @@ void PaintCommands::command_drawArc(QRegExp re)
m_painter->drawArc(x, y, w, h, angle, sweep);
}
-#ifdef QT3_SUPPORT
-/***************************************************************************************************/
-void PaintCommands::command_qt3_drawRect(QRegExp re)
-{
- Q_UNUSED(re);
-#ifdef QT3_SUPPORT
- QStringList caps = re.capturedTexts();
- int x = convertToInt(caps.at(1));
- int y = convertToInt(caps.at(2));
- int w = convertToInt(caps.at(3));
- int h = convertToInt(caps.at(4));
-
- if (m_verboseMode)
- printf(" -(lance) qt3_drawRect(%d, %d, %d, %d)\n", x, y, w, h);
-
- static_cast<Q3Painter*>(m_painter)->drawRect(x, y, w, h);
-#endif
-}
-
-/***************************************************************************************************/
-void PaintCommands::command_qt3_drawRoundRect(QRegExp re)
-{
- Q_UNUSED(re);
-#ifdef QT3_SUPPORT
- QStringList caps = re.capturedTexts();
- int x = convertToInt(caps.at(1));
- int y = convertToInt(caps.at(2));
- int w = convertToInt(caps.at(3));
- int h = convertToInt(caps.at(4));
- int xrnd = caps.at(5).isEmpty() ? 25 : convertToInt(caps.at(5));
- int yrnd = caps.at(6).isEmpty() ? 25 : convertToInt(caps.at(6));
-
- if (m_verboseMode)
- printf(" -(lance) qt3_drawRoundRect(%d, %d, %d, %d), %d, %d\n", x, y, w, h, xrnd, yrnd);
-
- static_cast<Q3Painter*>(m_painter)->drawRoundRect(x, y, w, h, xrnd, yrnd);
-#endif
-}
-
-/***************************************************************************************************/
-void PaintCommands::command_qt3_drawEllipse(QRegExp re)
-{
- Q_UNUSED(re);
-#ifdef QT3_SUPPORT
- QStringList caps = re.capturedTexts();
- int x = convertToInt(caps.at(1));
- int y = convertToInt(caps.at(2));
- int w = convertToInt(caps.at(3));
- int h = convertToInt(caps.at(4));
-
- if (m_verboseMode)
- printf(" -(lance) qt3_drawEllipse(%d, %d, %d, %d)\n", x, y, w, h);
-
- static_cast<Q3Painter*>(m_painter)->drawEllipse(x, y, w, h);
-#endif
-}
-
-/***************************************************************************************************/
-void PaintCommands::command_qt3_drawPie(QRegExp re)
-{
- Q_UNUSED(re);
-#ifdef QT3_SUPPORT
- QStringList caps = re.capturedTexts();
- int x = convertToInt(caps.at(1));
- int y = convertToInt(caps.at(2));
- int w = convertToInt(caps.at(3));
- int h = convertToInt(caps.at(4));
- int angle = convertToInt(caps.at(5));
- int sweep = convertToInt(caps.at(6));
-
- if (m_verboseMode)
- printf(" -(lance) qt3_drawPie(%d, %d, %d, %d, %d, %d)\n", x, y, w, h, angle, sweep);
-
- static_cast<Q3Painter*>(m_painter)->drawPie(x, y, w, h, angle, sweep);
-#endif
-}
-
-/***************************************************************************************************/
-void PaintCommands::command_qt3_drawChord(QRegExp re)
-{
- Q_UNUSED(re);
-#ifdef QT3_SUPPORT
- QStringList caps = re.capturedTexts();
- int x = convertToInt(caps.at(1));
- int y = convertToInt(caps.at(2));
- int w = convertToInt(caps.at(3));
- int h = convertToInt(caps.at(4));
- int angle = convertToInt(caps.at(5));
- int sweep = convertToInt(caps.at(6));
-
- if (m_verboseMode)
- printf(" -(lance) qt3_drawChord(%d, %d, %d, %d, %d, %d)\n", x, y, w, h, angle, sweep);
-
- static_cast<Q3Painter*>(m_painter)->drawChord(x, y, w, h, angle, sweep);
-#endif
-}
-
-/***************************************************************************************************/
-void PaintCommands::command_qt3_drawArc(QRegExp re)
-{
- Q_UNUSED(re);
-#ifdef QT3_SUPPORT
- QStringList caps = re.capturedTexts();
- int x = convertToInt(caps.at(1));
- int y = convertToInt(caps.at(2));
- int w = convertToInt(caps.at(3));
- int h = convertToInt(caps.at(4));
- int angle = convertToInt(caps.at(5));
- int sweep = convertToInt(caps.at(6));
-
- if (m_verboseMode)
- printf(" -(lance) qt3_drawArc(%d, %d, %d, %d, %d, %d)\n", x, y, w, h, angle, sweep);
-
- static_cast<Q3Painter*>(m_painter)->drawArc(x, y, w, h, angle, sweep);
-#endif
-}
-#endif //QT3_SUPPORT
/***************************************************************************************************/
void PaintCommands::command_drawText(QRegExp re)
{
diff --git a/tests/arthur/common/paintcommands.h b/tests/arthur/common/paintcommands.h
index 08c0e25a7b..786ff64943 100644
--- a/tests/arthur/common/paintcommands.h
+++ b/tests/arthur/common/paintcommands.h
@@ -185,14 +185,6 @@ private:
void command_gradient_setCoordinateMode(QRegExp re);
// commands: drawing ops
-#ifdef QT3_SUPPORT
- void command_qt3_drawArc(QRegExp re);
- void command_qt3_drawChord(QRegExp re);
- void command_qt3_drawEllipse(QRegExp re);
- void command_qt3_drawPie(QRegExp re);
- void command_qt3_drawRect(QRegExp re);
- void command_qt3_drawRoundRect(QRegExp re);
-#endif
void command_drawArc(QRegExp re);
void command_drawChord(QRegExp re);
void command_drawConvexPolygon(QRegExp re);
diff --git a/tests/arthur/data/qps/sizes.qps b/tests/arthur/data/qps/sizes.qps
index 30f6557538..c585e5a01f 100644
--- a/tests/arthur/data/qps/sizes.qps
+++ b/tests/arthur/data/qps/sizes.qps
@@ -14,16 +14,6 @@ drawRect 120 0 16 16
drawRect 140 0 17 17
drawRect 160 0 18 18
drawRect 180 0 19 19
-qt3_drawRect 200 0 10 10
-qt3_drawRect 220 0 11 11
-qt3_drawRect 240 0 12 12
-qt3_drawRect 260 0 13 13
-qt3_drawRect 280 0 14 14
-qt3_drawRect 300 0 15 15
-qt3_drawRect 320 0 16 16
-qt3_drawRect 340 0 17 17
-qt3_drawRect 360 0 18 18
-qt3_drawRect 380 0 19 19
drawEllipse 0 20 10 10
drawEllipse 20 20 11 11
@@ -35,16 +25,6 @@ drawEllipse 120 20 16 16
drawEllipse 140 20 17 17
drawEllipse 160 20 18 18
drawEllipse 180 20 19 19
-qt3_drawEllipse 200 20 10 10
-qt3_drawEllipse 220 20 11 11
-qt3_drawEllipse 240 20 12 12
-qt3_drawEllipse 260 20 13 13
-qt3_drawEllipse 280 20 14 14
-qt3_drawEllipse 300 20 15 15
-qt3_drawEllipse 320 20 16 16
-qt3_drawEllipse 340 20 17 17
-qt3_drawEllipse 360 20 18 18
-qt3_drawEllipse 380 20 19 19
drawRoundRect 0 40 10 10
drawRoundRect 20 40 11 11
@@ -56,16 +36,6 @@ drawRoundRect 120 40 16 16
drawRoundRect 140 40 17 17
drawRoundRect 160 40 18 18
drawRoundRect 180 40 19 19
-qt3_drawRoundRect 200 40 10 10
-qt3_drawRoundRect 220 40 11 11
-qt3_drawRoundRect 240 40 12 12
-qt3_drawRoundRect 260 40 13 13
-qt3_drawRoundRect 280 40 14 14
-qt3_drawRoundRect 300 40 15 15
-qt3_drawRoundRect 320 40 16 16
-qt3_drawRoundRect 340 40 17 17
-qt3_drawRoundRect 360 40 18 18
-qt3_drawRoundRect 380 40 19 19
drawPie 0 60 10 10 0 4320
drawPie 20 60 11 11 0 4320
@@ -77,16 +47,6 @@ drawPie 120 60 16 16 0 4320
drawPie 140 60 17 17 0 4320
drawPie 160 60 18 18 0 4320
drawPie 180 60 19 19 0 4320
-qt3_drawPie 200 60 10 10 0 4320
-qt3_drawPie 220 60 11 11 0 4320
-qt3_drawPie 240 60 12 12 0 4320
-qt3_drawPie 260 60 13 13 0 4320
-qt3_drawPie 280 60 14 14 0 4320
-qt3_drawPie 300 60 15 15 0 4320
-qt3_drawPie 320 60 16 16 0 4320
-qt3_drawPie 340 60 17 17 0 4320
-qt3_drawPie 360 60 18 18 0 4320
-qt3_drawPie 380 60 19 19 0 4320
drawArc 0 80 10 10 0 4320
drawArc 20 80 11 11 0 4320
@@ -98,16 +58,6 @@ drawArc 120 80 16 16 0 4320
drawArc 140 80 17 17 0 4320
drawArc 160 80 18 18 0 4320
drawArc 180 80 19 19 0 4320
-qt3_drawArc 200 80 10 10 0 4320
-qt3_drawArc 220 80 11 11 0 4320
-qt3_drawArc 240 80 12 12 0 4320
-qt3_drawArc 260 80 13 13 0 4320
-qt3_drawArc 280 80 14 14 0 4320
-qt3_drawArc 300 80 15 15 0 4320
-qt3_drawArc 320 80 16 16 0 4320
-qt3_drawArc 340 80 17 17 0 4320
-qt3_drawArc 360 80 18 18 0 4320
-qt3_drawArc 380 80 19 19 0 4320
drawChord 0 100 10 10 0 4320
drawChord 20 100 11 11 0 4320
@@ -119,16 +69,6 @@ drawChord 120 100 16 16 0 4320
drawChord 140 100 17 17 0 4320
drawChord 160 100 18 18 0 4320
drawChord 180 100 19 19 0 4320
-qt3_drawChord 200 100 10 10 0 4320
-qt3_drawChord 220 100 11 11 0 4320
-qt3_drawChord 240 100 12 12 0 4320
-qt3_drawChord 260 100 13 13 0 4320
-qt3_drawChord 280 100 14 14 0 4320
-qt3_drawChord 300 100 15 15 0 4320
-qt3_drawChord 320 100 16 16 0 4320
-qt3_drawChord 340 100 17 17 0 4320
-qt3_drawChord 360 100 18 18 0 4320
-qt3_drawChord 380 100 19 19 0 4320
end_block
diff --git a/tests/arthur/datagenerator/datagenerator.pro b/tests/arthur/datagenerator/datagenerator.pro
index 9da6fcd5c5..114e81a795 100644
--- a/tests/arthur/datagenerator/datagenerator.pro
+++ b/tests/arthur/datagenerator/datagenerator.pro
@@ -10,7 +10,6 @@ DESTDIR = ../bin
QT += svg xml
contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl
-contains(QT_CONFIG, qt3support):QT += qt3support
# Input
HEADERS += datagenerator.h \
diff --git a/tests/arthur/htmlgenerator/htmlgenerator.pro b/tests/arthur/htmlgenerator/htmlgenerator.pro
index 4a1c8ba89b..81c538fba6 100644
--- a/tests/arthur/htmlgenerator/htmlgenerator.pro
+++ b/tests/arthur/htmlgenerator/htmlgenerator.pro
@@ -11,7 +11,6 @@ CONFIG += console
QT += svg xml
contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl
-contains(QT_CONFIG, qt3support):QT += qt3support
# Input
HEADERS += htmlgenerator.h
diff --git a/tests/arthur/lance/lance.pro b/tests/arthur/lance/lance.pro
index 56b7f25b81..cff431309f 100644
--- a/tests/arthur/lance/lance.pro
+++ b/tests/arthur/lance/lance.pro
@@ -10,7 +10,6 @@ SOURCES += interactivewidget.cpp main.cpp
RESOURCES += icons.qrc
contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl
-contains(QT_CONFIG, qt3support):QT += qt3support
symbian*: {
testData.files = $$QT_BUILD_TREE/tests/arthur/data/qps
diff --git a/tests/arthur/lance/main.cpp b/tests/arthur/lance/main.cpp
index 2bda932130..9e8e07f96d 100644
--- a/tests/arthur/lance/main.cpp
+++ b/tests/arthur/lance/main.cpp
@@ -137,14 +137,6 @@ static void displayCommands()
" drawText x y \"text\"\n"
" drawTiledPixmap pixmapfile x y width height sx sy\n"
"\n"
- "Compat functions for Qt 3:\n"
- " qt3_drawArc x y width height angle sweep\n"
- " qt3_drawChord x y width height angle sweep\n"
- " qt3_drawEllipse x y width height\n"
- " qt3_drawPie x y width height angle sweep\n"
- " qt3_drawRect x y width height\n"
- " qt3_drawRoundRect x y width height xfactor yfactor\n"
- "\n"
"Path commands:\n"
" path_addEllipse pathname x y width height\n"
" path_addPolygon pathname [ x1 y1 x2 y2 ... ] winding?\n"
diff --git a/tests/arthur/performancediff/performancediff.pro b/tests/arthur/performancediff/performancediff.pro
index 15d5ec5956..e79017c364 100644
--- a/tests/arthur/performancediff/performancediff.pro
+++ b/tests/arthur/performancediff/performancediff.pro
@@ -11,7 +11,6 @@ CONFIG += console
QT += xml svg
contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl
-contains(QT_CONFIG, qt3support):QT += qt3support
# Input
HEADERS += performancediff.h
diff --git a/tests/arthur/shower/shower.pro b/tests/arthur/shower/shower.pro
index c02ded0865..1f2ce22af2 100644
--- a/tests/arthur/shower/shower.pro
+++ b/tests/arthur/shower/shower.pro
@@ -9,7 +9,6 @@ DESTDIR = ../bin
QT += xml svg
contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2):QT += opengl
-contains(QT_CONFIG, qt3support):QT += qt3support
# Input
HEADERS += shower.h
diff --git a/tests/auto/qaccessibility/tst_qaccessibility.cpp b/tests/auto/qaccessibility/tst_qaccessibility.cpp
index dcd6286b07..9110bd717d 100644
--- a/tests/auto/qaccessibility/tst_qaccessibility.cpp
+++ b/tests/auto/qaccessibility/tst_qaccessibility.cpp
@@ -40,9 +40,6 @@
****************************************************************************/
-#ifdef QT3_SUPPORT
-#include <Qt3Support/Qt3Support>
-#endif
#include <QtTest/QtTest>
#ifndef Q_OS_WINCE
#include "../../shared/util.h"
@@ -228,17 +225,10 @@ private slots:
void customWidget();
void deletedWidget();
- void childCount();
- void childAt(); // also indexOfChild
- void relationTo();
void navigateGeometric();
void navigateHierarchy();
void navigateSlider();
void navigateCovered();
- void navigateControllers();
- void navigateLabels();
- void text();
- void setText();
void hideShowTest();
void userActionCount();
@@ -248,7 +238,6 @@ private slots:
void applicationTest();
void mainWindowTest();
void buttonTest();
- void sliderTest();
void scrollBarTest();
void tabTest();
void tabWidgetTest();
@@ -271,15 +260,11 @@ private slots:
void tableViewTest();
void calendarWidgetTest();
void dockWidgetTest();
- void pushButtonTest();
void comboBoxTest();
void accessibleName();
void treeWidgetTest();
void labelTest();
void accelerators();
-
-private:
- QWidget *createGUI();
};
const double Q_PI = 3.14159265358979323846;
@@ -458,378 +443,6 @@ void tst_QAccessibility::deletedWidget()
delete iface;
}
-QWidget *tst_QAccessibility::createGUI()
-{
-#if !defined(QT3_SUPPORT)
- qWarning( "Should never get here without Qt3Support");
- return 0;
-#else
- QWidget *toplevel = new QWidget(0, Qt::X11BypassWindowManagerHint);
- QGridLayout *grid = new QGridLayout(toplevel, 2, 2);
-
- // topLeft - hierarchies
- Q3VBox *topLeft = new Q3VBox(toplevel, "topLeft");
- topLeft->setSpacing(2);
- grid->addWidget(topLeft, 0, 0);
-
- Q3VButtonGroup *group1 = new Q3VButtonGroup("Title1:", topLeft, "group1");
- /*QPushButton *pb1 = */ new QPushButton("Button&1", group1, "pb1");
- Q3VButtonGroup *group2 = new Q3VButtonGroup("Title2:", topLeft, "group2");
- /*QPushButton *pb2 = */ new QPushButton("Button2", group2, "pb2");
-
- Q3WidgetStack *stack = new Q3WidgetStack(topLeft, "stack");
- QLabel *page1 = new QLabel("Page 1", stack, "page1");
- stack->addWidget(page1);
- QLabel *page2 = new QLabel("Page 2", stack, "page2");
- stack->addWidget(page2);
- QLabel *page3 = new QLabel("Page 3", stack, "page3");
- stack->addWidget(page3);
-
- // topRight - controlling
- Q3VBox *topRight= new Q3VBox(toplevel, "topRight");
- grid->addWidget(topRight, 0, 1);
-
- QPushButton *pbOk = new QPushButton("Ok", topRight, "pbOk" );
- pbOk->setDefault(TRUE);
- QSlider *slider = new QSlider(Qt::Horizontal, topRight, "slider");
- QLCDNumber *sliderLcd = new QLCDNumber(topRight, "sliderLcd");
- QSpinBox *spinBox = new QSpinBox(topRight, "spinBox");
-
- connect(pbOk, SIGNAL(clicked()), toplevel, SLOT(close()) );
- connect(slider, SIGNAL(valueChanged(int)), sliderLcd, SLOT(display(int)));
- connect(spinBox, SIGNAL(valueChanged(int)), slider, SLOT(setValue(int)));
-
- spinBox->setValue(50);
-
- // bottomLeft - labeling and controlling
- Q3HBox *bottomLeft = new Q3HBox(toplevel, "bottomLeft");
- grid->addWidget(bottomLeft, 1, 0);
-
- QLabel *label = new QLabel("This is a &lineedit:", bottomLeft, "label");
- QLineEdit *lineedit = new QLineEdit(bottomLeft, "lineedit");
- label->setBuddy(lineedit);
- QLabel *label2 = new QLabel(bottomLeft, "label2");
-
- connect(lineedit, SIGNAL(textChanged(const QString&)), label2, SLOT(setText(const QString&)));
-
- Q3VButtonGroup *radiogroup = new Q3VButtonGroup("Exclusive &choices:", bottomLeft, "radiogroup");
- QLineEdit *frequency = new QLineEdit(radiogroup, "frequency");
- frequency->setText("100 Mhz");
- QRadioButton *radioAM = new QRadioButton("&AM", radiogroup, "radioAM");
- /* QRadioButton *radioFM = */ new QRadioButton("&FM", radiogroup, "radioFM");
- /* QRadioButton *radioSW = */ new QRadioButton("&Shortwave", radiogroup, "radioSW");
-
- // bottomRight - ### empty
- Q3HBox *bottomRight = new Q3HBox(toplevel, "bottomRight");
- grid->addWidget(bottomRight, 1, 1);
-
- toplevel->adjustSize(); // sends layout and child events
-
- // some tooltips
- QToolTip::add(label, "A label");
- QToolTip::add(lineedit, "A line edit");
- // some whatsthis
- QWhatsThis::add(label, "A label displays static text");
- QWhatsThis::add(frequency, "You can enter a single line of text here");
-
- radioAM->setFocus();
- QTestAccessibility::clearEvents();
- return toplevel;
-#endif // !QT3_SUPPORT
-}
-
-void tst_QAccessibility::childAt()
-{
-#if !defined(QT3_SUPPORT)
- QSKIP("This test needs Qt3Support", SkipAll);
-#else
- QWidget *toplevel = createGUI();
- QAccessibleInterface *acc_toplevel = QAccessible::queryAccessibleInterface(toplevel);
- QVERIFY(acc_toplevel);
- // this is necessary to have the layout setup correctly
- toplevel->show();
-
- QObjectList children = toplevel->queryList("QWidget", 0, 0, 0);
- for (int c = 1; c <= children.count(); ++c) {
- QWidget *child = qobject_cast<QWidget*>(children.at(c-1));
- QAccessibleInterface *acc_child = QAccessible::queryAccessibleInterface(child);
- QVERIFY(acc_child);
- QCOMPARE(acc_child->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask, QAccessible::Child);
-
- QPoint center(child->mapToGlobal(child->rect().center()));
- QRect childRect(child->geometry());
- childRect.moveCenter(center);
-
- QCOMPARE(acc_child->rect(0), childRect);
- QCOMPARE(acc_toplevel->childAt(childRect.center().x(), childRect.center().y()), c);
- QCOMPARE(acc_toplevel->childAt(childRect.left(), childRect.top()), c);
- QCOMPARE(acc_toplevel->childAt(childRect.left(), childRect.bottom()), c);
- QCOMPARE(acc_toplevel->childAt(childRect.right(), childRect.top()), c);
- QCOMPARE(acc_toplevel->childAt(childRect.right(), childRect.bottom()), c);
-
- QCOMPARE(acc_toplevel->indexOfChild(acc_child), c);
- delete acc_child;
- }
-
- delete acc_toplevel;
- delete toplevel;
- QTestAccessibility::clearEvents();
-#endif // !QT3_SUPPORT
-}
-
-void tst_QAccessibility::childCount()
-{
-#if !defined(QT3_SUPPORT)
- QSKIP("This test needs Qt3Support", SkipAll);
-#else
- QWidget *toplevel = createGUI();
- QObject *topLeft = toplevel->child("topLeft");
- QObject *topRight = toplevel->child("topRight");
- QObject *bottomLeft = toplevel->child("bottomLeft");
- QObject *bottomRight = toplevel->child("bottomRight");
-
- QAccessibleInterface* acc_toplevel = QAccessible::queryAccessibleInterface(toplevel);
- QAccessibleInterface* acc_topLeft = QAccessible::queryAccessibleInterface(topLeft);
- QAccessibleInterface* acc_topRight = QAccessible::queryAccessibleInterface(topRight);
- QAccessibleInterface* acc_bottomLeft = QAccessible::queryAccessibleInterface(bottomLeft);
- QAccessibleInterface* acc_bottomRight = QAccessible::queryAccessibleInterface(bottomRight);
-
- QVERIFY(acc_toplevel);
- QVERIFY(acc_topLeft);
- QVERIFY(acc_topRight);
- QVERIFY(acc_bottomLeft);
- QVERIFY(acc_bottomRight);
-
- toplevel->show();
- QCOMPARE(acc_toplevel->childCount(), toplevel->queryList("QWidget", 0, 0, 0).count());
- QCOMPARE(acc_topLeft->childCount(), topLeft->queryList("QWidget", 0, 0, 0).count());
- QCOMPARE(acc_topRight->childCount(), topRight->queryList("QWidget", 0, 0, 0).count());
- QCOMPARE(acc_bottomLeft->childCount(), bottomLeft->queryList("QWidget", 0, 0, 0).count());
- QCOMPARE(acc_bottomRight->childCount(), bottomRight->queryList("QWidget", 0, 0, 0).count());
-
- delete acc_toplevel;
- delete acc_topLeft;
- delete acc_topRight;
- delete acc_bottomLeft;
- delete acc_bottomRight;
- delete toplevel;
- QTestAccessibility::clearEvents();
-#endif // !QT3_SUPPORT
-}
-
-void tst_QAccessibility::relationTo()
-{
-#if !defined(QT3_SUPPORT)
- QSKIP("This test needs Qt3Support", SkipAll);
-#else
- QWidget *toplevel = createGUI();
- toplevel->resize(400,300);
- QObject *topLeft = toplevel->child("topLeft");
- QObject *topRight = toplevel->child("topRight");
- QObject *bottomLeft = toplevel->child("bottomLeft");
- QObject *bottomRight = toplevel->child("bottomRight");
-
- toplevel->show();
-
- QAccessibleInterface *acc_toplevel = QAccessible::queryAccessibleInterface(toplevel);
-
- QAccessibleInterface *acc_topLeft = QAccessible::queryAccessibleInterface(topLeft);
- QAccessibleInterface *acc_group1 = QAccessible::queryAccessibleInterface(topLeft->child("group1"));
- QVERIFY(topLeft->child("group1"));
- QAccessibleInterface *acc_pb1 = QAccessible::queryAccessibleInterface(topLeft->child("group1")->child("pb1"));
- QAccessibleInterface *acc_group2 = QAccessible::queryAccessibleInterface(topLeft->child("group2"));
- QAccessibleInterface *acc_pb2 = 0;
- QAccessibleInterface *acc_stack = QAccessible::queryAccessibleInterface(topLeft->child("stack"));
- QAccessibleInterface *acc_page1 = QAccessible::queryAccessibleInterface(topLeft->child("stack")->child("page1"));
- QAccessibleInterface *acc_page2 = QAccessible::queryAccessibleInterface(topLeft->child("stack")->child("page2"));
- QAccessibleInterface *acc_page3 = QAccessible::queryAccessibleInterface(topLeft->child("stack")->child("page3"));
- QAccessibleInterface *acc_topRight = QAccessible::queryAccessibleInterface(topRight);
- QAccessibleInterface *acc_pbOk = QAccessible::queryAccessibleInterface(topRight->child("pbOk"));
- QAccessibleInterface *acc_slider = QAccessible::queryAccessibleInterface(topRight->child("slider"));
- QAccessibleInterface *acc_spinBox = QAccessible::queryAccessibleInterface(topRight->child("spinBox"));
- QAccessibleInterface *acc_sliderLcd = QAccessible::queryAccessibleInterface(topRight->child("sliderLcd"));
-
- QAccessibleInterface *acc_bottomLeft = QAccessible::queryAccessibleInterface(bottomLeft);
- QAccessibleInterface *acc_label = QAccessible::queryAccessibleInterface(bottomLeft->child("label"));
- QAccessibleInterface *acc_lineedit = QAccessible::queryAccessibleInterface(bottomLeft->child("lineedit"));
- QAccessibleInterface *acc_label2 = QAccessible::queryAccessibleInterface(bottomLeft->child("label2"));
- QAccessibleInterface *acc_radiogroup = QAccessible::queryAccessibleInterface(bottomLeft->child("radiogroup"));
- QAccessibleInterface *acc_radioAM = QAccessible::queryAccessibleInterface(bottomLeft->child("radiogroup")->child("radioAM"));
- QAccessibleInterface *acc_radioFM = QAccessible::queryAccessibleInterface(bottomLeft->child("radiogroup")->child("radioFM"));
- QAccessibleInterface *acc_radioSW = QAccessible::queryAccessibleInterface(bottomLeft->child("radiogroup")->child("radioSW"));
- QAccessibleInterface *acc_frequency = QAccessible::queryAccessibleInterface(bottomLeft->child("radiogroup")->child("frequency"));
-
- QAccessibleInterface *acc_bottomRight = QAccessible::queryAccessibleInterface(bottomRight);
-
- QVERIFY(acc_toplevel);
- QVERIFY(acc_topLeft);
- QVERIFY(acc_topRight);
- QVERIFY(acc_bottomLeft);
- QVERIFY(acc_bottomRight);
- QVERIFY(acc_group1);
- QVERIFY(acc_group2);
- QVERIFY(acc_stack);
- QVERIFY(acc_page1);
- QVERIFY(acc_page2);
- QVERIFY(acc_page3);
- QVERIFY(acc_pbOk);
- QVERIFY(acc_slider);
- QVERIFY(acc_spinBox);
- QVERIFY(acc_sliderLcd);
- QVERIFY(acc_label);
- QVERIFY(acc_lineedit);
- QVERIFY(acc_radiogroup);
- QVERIFY(acc_radioAM);
- QVERIFY(acc_radioFM);
- QVERIFY(acc_radioSW);
- QVERIFY(acc_frequency);
-
- // hierachy relations
- QCOMPARE(acc_toplevel->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask,
- QAccessible::Self);
- QCOMPARE(acc_toplevel->relationTo(1, acc_toplevel, 0) & QAccessible::HierarchyMask,
- QAccessible::Child);
- QCOMPARE(acc_toplevel->relationTo(0, acc_toplevel, 1) & QAccessible::HierarchyMask,
- QAccessible::Ancestor);
-
- QCOMPARE(acc_toplevel->relationTo(0, acc_topLeft, 0) & QAccessible::HierarchyMask,
- QAccessible::Ancestor);
- QCOMPARE(acc_toplevel->relationTo(0, acc_topRight, 0) & QAccessible::HierarchyMask,
- QAccessible::Ancestor);
- QCOMPARE(acc_toplevel->relationTo(0, acc_bottomLeft, 0) & QAccessible::HierarchyMask,
- QAccessible::Ancestor);
- QCOMPARE(acc_toplevel->relationTo(0, acc_bottomRight, 0) & QAccessible::HierarchyMask,
- QAccessible::Ancestor);
-
- QCOMPARE(acc_toplevel->relationTo(0, acc_group1, 0) & QAccessible::HierarchyMask,
- QAccessible::Ancestor);
- QCOMPARE(acc_toplevel->relationTo(0, acc_page1, 0) & QAccessible::HierarchyMask,
- QAccessible::Ancestor);
- QCOMPARE(acc_group1->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask,
- QAccessible::Descendent);
- QCOMPARE(acc_stack->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask,
- QAccessible::Descendent);
- QCOMPARE(acc_page1->relationTo(0, acc_stack, 0) & QAccessible::HierarchyMask,
- QAccessible::Child);
- QCOMPARE(acc_page1->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask,
- QAccessible::Descendent);
-
- QCOMPARE(acc_topLeft->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask,
- QAccessible::Child);
- QCOMPARE(acc_topRight->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask,
- QAccessible::Child);
- QCOMPARE(acc_bottomLeft->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask,
- QAccessible::Child);
- QCOMPARE(acc_bottomRight->relationTo(0, acc_toplevel, 0) & QAccessible::HierarchyMask,
- QAccessible::Child);
-
- QCOMPARE(acc_topLeft->relationTo(0, acc_topRight, 0) & QAccessible::HierarchyMask,
- QAccessible::Sibling);
- QCOMPARE(acc_topLeft->relationTo(0, acc_bottomLeft, 0) & QAccessible::HierarchyMask,
- QAccessible::Sibling);
- QCOMPARE(acc_topLeft->relationTo(0, acc_bottomRight, 0) & QAccessible::HierarchyMask,
- QAccessible::Sibling);
-
- QCOMPARE(acc_pb1->relationTo(0, acc_pb2, 0), QAccessible::Unrelated);
-
- // geometrical relations - only valid for siblings
- QCOMPARE(acc_topLeft->relationTo(0, acc_topRight, 0), QAccessible::Sibling | QAccessible::Left);
- QCOMPARE(acc_topLeft->relationTo(0, acc_bottomLeft, 0), QAccessible::Sibling | QAccessible::Up);
- QCOMPARE(acc_topLeft->relationTo(0, acc_bottomRight, 0), QAccessible::Sibling | QAccessible::Left | QAccessible::Up);
-
- QCOMPARE(acc_bottomRight->relationTo(0, acc_topLeft, 0), QAccessible::Sibling | QAccessible::Right | QAccessible::Down);
- QCOMPARE(acc_bottomRight->relationTo(0, acc_topRight, 0), QAccessible::Sibling | QAccessible::Down);
- QCOMPARE(acc_bottomRight->relationTo(0, acc_bottomLeft, 0), QAccessible::Sibling | QAccessible::Right);
-#ifdef Q_WS_MAC
- QEXPECT_FAIL("", "Task 155501", Continue);
-#endif
- QCOMPARE(acc_group1->relationTo(0, acc_group2, 0), QAccessible::Sibling | QAccessible::Up);
-#ifdef Q_WS_MAC
- QEXPECT_FAIL("", "Task 155501", Continue);
-#endif
- QCOMPARE(acc_group2->relationTo(0, acc_group1, 0), QAccessible::Sibling | QAccessible::Down);
-
- // Covers/Covered tested in navigateCovered
-
- // logical relations - focus
- QCOMPARE(acc_radioAM->relationTo(0, acc_radioFM, 0) & QAccessible::FocusChild,
- QAccessible::Unrelated);
- QCOMPARE(acc_radioAM->relationTo(0, acc_radiogroup, 0) & QAccessible::FocusChild,
- QAccessible::FocusChild);
- QCOMPARE(acc_radioAM->relationTo(0, acc_bottomLeft, 0) & QAccessible::FocusChild,
- QAccessible::FocusChild);
- QCOMPARE(acc_radioAM->relationTo(0, acc_topLeft, 0) & QAccessible::FocusChild,
- QAccessible::Unrelated);
- QCOMPARE(acc_radioAM->relationTo(0, acc_toplevel, 0) & QAccessible::FocusChild,
- QAccessible::FocusChild);
-
- // logical relations - labels
- QCOMPARE(acc_label->relationTo(0, acc_lineedit, 0) & QAccessible::LogicalMask,
- QAccessible::Label);
- QCOMPARE(acc_lineedit->relationTo(0, acc_label, 0) & QAccessible::LogicalMask,
- QAccessible::Labelled);
- QCOMPARE(acc_label->relationTo(0, acc_radiogroup, 0) & QAccessible::LogicalMask,
- QAccessible::Unrelated);
- QCOMPARE(acc_lineedit->relationTo(0, acc_lineedit, 0) & QAccessible::LogicalMask,
- QAccessible::Unrelated);
-
- QEXPECT_FAIL("", "Make me accessible", Continue);
- QCOMPARE(acc_radiogroup->relationTo(0, acc_radioAM, 0) & QAccessible::LogicalMask,
- QAccessible::Label | QAccessible::Controlled);
- QEXPECT_FAIL("", "Make me accessible", Continue);
- QCOMPARE(acc_radiogroup->relationTo(0, acc_radioFM, 0) & QAccessible::LogicalMask,
- QAccessible::Label | QAccessible::Controlled);
- QEXPECT_FAIL("", "Make me accessible", Continue);
- QCOMPARE(acc_radiogroup->relationTo(0, acc_radioSW, 0) & QAccessible::LogicalMask,
- QAccessible::Label | QAccessible::Controlled);
- QCOMPARE(acc_radiogroup->relationTo(0, acc_frequency, 0) & QAccessible::LogicalMask,
- QAccessible::Label);
- QCOMPARE(acc_frequency->relationTo(0, acc_radiogroup, 0) & QAccessible::LogicalMask,
- QAccessible::Labelled);
- QCOMPARE(acc_radiogroup->relationTo(0, acc_lineedit, 0) & QAccessible::LogicalMask,
- QAccessible::Unrelated);
-
- // logical relations - controller
- QCOMPARE(acc_pbOk->relationTo(0, acc_toplevel, 0) & QAccessible::LogicalMask,
- QAccessible::Controller);
- QCOMPARE(acc_slider->relationTo(0, acc_sliderLcd, 0) & QAccessible::LogicalMask,
- QAccessible::Controller);
- QCOMPARE(acc_spinBox->relationTo(0, acc_slider, 0) & QAccessible::LogicalMask,
- QAccessible::Controller);
- QCOMPARE(acc_lineedit->relationTo(0, acc_label2, 0) & QAccessible::LogicalMask,
- QAccessible::Controller);
-
- delete acc_toplevel;
- delete acc_topLeft;
- delete acc_group1;
- delete acc_pb1;
- delete acc_group2;
- delete acc_stack;
- delete acc_page1;
- delete acc_page2;
- delete acc_page3;
- delete acc_topRight;
- delete acc_pbOk;
- delete acc_slider;
- delete acc_spinBox;
- delete acc_sliderLcd;
- delete acc_bottomLeft;
- delete acc_label;
- delete acc_lineedit;
- delete acc_label2;
- delete acc_radiogroup;
- delete acc_radioAM;
- delete acc_radioFM;
- delete acc_radioSW;
- delete acc_frequency;
- delete acc_bottomRight;
-
- delete toplevel;
-
- QTestAccessibility::clearEvents();
-#endif // !QT3_SUPPORT
-}
-
void tst_QAccessibility::navigateGeometric()
{
{
@@ -1167,225 +780,6 @@ void tst_QAccessibility::navigateHierarchy()
#define QSETCOMPARE(thetypename, elements, otherelements) \
QCOMPARE((QSet<thetypename>() << elements), (QSet<thetypename>() << otherelements))
-void tst_QAccessibility::navigateControllers()
-{
-#if !defined(QT3_SUPPORT)
- QSKIP("This test needs Qt3Support", SkipAll);
-#else
- {
- Q3VBox vbox;
- QSlider slider(&vbox);
- QSpinBox spinBox(&vbox);
- QLCDNumber lcd1(&vbox);
- QLCDNumber lcd2(&vbox);
- QLabel label(&vbox);
- vbox.show();
-
- slider.setObjectName("slider");
- spinBox.setObjectName("spinBox");
- lcd1.setObjectName("lcd1");
- lcd2.setObjectName("lcd2");
- label.setObjectName("label");
-
- QTestAccessibility::clearEvents();
-
- connect(&slider, SIGNAL(valueChanged(int)), &lcd1, SLOT(display(int)));
- connect(&slider, SIGNAL(valueChanged(int)), &lcd2, SLOT(display(int)));
- connect(&spinBox, SIGNAL(valueChanged(int)), &lcd2, SLOT(display(int)));
- connect(&spinBox, SIGNAL(valueChanged(int)), &lcd1, SLOT(display(int)));
- connect(&spinBox, SIGNAL(valueChanged(const QString&)), &label, SLOT(setText(const QString&)));
-
- QAccessibleInterface *acc_slider = QAccessible::queryAccessibleInterface(&slider);
- QAccessibleInterface *acc_spinBox = QAccessible::queryAccessibleInterface(&spinBox);
- QAccessibleInterface *acc_lcd1 = QAccessible::queryAccessibleInterface(&lcd1);
- QAccessibleInterface *acc_lcd2 = QAccessible::queryAccessibleInterface(&lcd2);
- QAccessibleInterface *acc_label = QAccessible::queryAccessibleInterface(&label);
-
- QVERIFY(acc_slider->relationTo(0, acc_lcd1, 0) & QAccessible::Controller);
- QVERIFY(acc_slider->relationTo(0, acc_lcd2, 0) & QAccessible::Controller);
- QVERIFY(acc_spinBox->relationTo(0, acc_lcd1, 0) & QAccessible::Controller);
- QVERIFY(acc_spinBox->relationTo(0, acc_lcd2, 0) & QAccessible::Controller);
- QVERIFY(acc_spinBox->relationTo(0, acc_label, 0) & QAccessible::Controller);
-
- QAccessibleInterface *acc_target1, *acc_target2, *acc_target3;
- // from controller
- QCOMPARE(acc_slider->navigate(QAccessible::Controlled, 0, &acc_target1), -1);
- QVERIFY(!acc_target1);
- QCOMPARE(acc_slider->navigate(QAccessible::Controlled, 1, &acc_target1), 0);
- QCOMPARE(acc_slider->navigate(QAccessible::Controlled, 2, &acc_target2), 0);
- QSETCOMPARE(QObject*, acc_lcd1->object() << acc_lcd2->object(),
- acc_target1->object() << acc_target2->object());
- delete acc_target1;
- delete acc_target2;
-
- QCOMPARE(acc_slider->navigate(QAccessible::Controlled, 3, &acc_target1), -1);
- QVERIFY(!acc_target1);
-
- QCOMPARE(acc_spinBox->navigate(QAccessible::Controlled, 0, &acc_target1), -1);
- QVERIFY(!acc_target1);
- QCOMPARE(acc_spinBox->navigate(QAccessible::Controlled, 1, &acc_target1), 0);
- QCOMPARE(acc_spinBox->navigate(QAccessible::Controlled, 2, &acc_target2), 0);
- QCOMPARE(acc_spinBox->navigate(QAccessible::Controlled, 3, &acc_target3), 0);
- QSETCOMPARE(QObject*, acc_lcd1->object() << acc_lcd2->object() << acc_label->object(),
- acc_target1->object() << acc_target2->object() << acc_target3->object());
- delete acc_target1;
- delete acc_target2;
- delete acc_target3;
-
- QCOMPARE(acc_spinBox->navigate(QAccessible::Controlled, 4, &acc_target1), -1);
- QVERIFY(!acc_target1);
-
- // to controller
- QCOMPARE(acc_lcd1->navigate(QAccessible::Controller, 0, &acc_target1), -1);
- QVERIFY(!acc_target1);
- QCOMPARE(acc_lcd1->navigate(QAccessible::Controller, 1, &acc_target1), 0);
- QCOMPARE(acc_lcd1->navigate(QAccessible::Controller, 2, &acc_target2), 0);
- QSETCOMPARE(QObject*, acc_slider->object() << acc_spinBox->object(),
- acc_target1->object() << acc_target2->object());
- delete acc_target1;
- delete acc_target2;
- QCOMPARE(acc_lcd1->navigate(QAccessible::Controller, 3, &acc_target1), -1);
- QVERIFY(!acc_target1);
-
- delete acc_label;
- delete acc_lcd2;
- delete acc_lcd1;
- delete acc_spinBox;
- delete acc_slider;
- }
- QTestAccessibility::clearEvents();
-#endif // !QT3_SUPPORT
-}
-
-void tst_QAccessibility::navigateLabels()
-{
-#if !defined(QT3_SUPPORT)
- QSKIP("This test needs Qt3Support", SkipAll);
-#else
- {
- Q3VBox vbox;
- Q3HBox hbox(&vbox);
-
- QLabel label(&hbox);
- label.setText("This is a lineedit:");
- QLineEdit lineedit(&hbox);
- label.setBuddy(&lineedit);
-
- Q3VButtonGroup groupbox(&vbox);
- groupbox.setTitle("Be my children!");
- QRadioButton radio(&groupbox);
- QLabel label2(&groupbox);
- label2.setText("Another lineedit:");
- QLineEdit lineedit2(&groupbox);
- label2.setBuddy(&lineedit2);
- Q3GroupBox groupbox2(&groupbox);
- groupbox2.setTitle("Some grand-children");
- QLineEdit grandchild(&groupbox2);
-
- Q3GroupBox border(&vbox);
- QLineEdit lineedit3(&border);
- vbox.show();
- QTestAccessibility::clearEvents();
-
- QAccessibleInterface *acc_label = QAccessible::queryAccessibleInterface(&label);
- QAccessibleInterface *acc_lineedit = QAccessible::queryAccessibleInterface(&lineedit);
- QAccessibleInterface *acc_groupbox = QAccessible::queryAccessibleInterface(&groupbox);
- QAccessibleInterface *acc_radio = QAccessible::queryAccessibleInterface(&radio);
- QAccessibleInterface *acc_label2 = QAccessible::queryAccessibleInterface(&label2);
- QAccessibleInterface *acc_lineedit2 = QAccessible::queryAccessibleInterface(&lineedit2);
- QAccessibleInterface *acc_groupbox2 = QAccessible::queryAccessibleInterface(&groupbox2);
- QAccessibleInterface *acc_grandchild = QAccessible::queryAccessibleInterface(&grandchild);
- QAccessibleInterface *acc_border = QAccessible::queryAccessibleInterface(&border);
- QAccessibleInterface *acc_lineedit3 = QAccessible::queryAccessibleInterface(&lineedit3);
-
- QVERIFY(acc_label->relationTo(0, acc_lineedit,0) & QAccessible::Label);
- QVERIFY(acc_groupbox->relationTo(0, acc_radio,0) & QAccessible::Label);
- QVERIFY(acc_groupbox->relationTo(0, acc_lineedit2,0) & QAccessible::Label);
- QVERIFY(acc_groupbox->relationTo(0, acc_groupbox2,0) & QAccessible::Label);
- QVERIFY(acc_groupbox2->relationTo(0, acc_grandchild,0) & QAccessible::Label);
- QVERIFY(!(acc_border->relationTo(0, acc_lineedit3,0) & QAccessible::Label));
-
- QAccessibleInterface *acc_target;
- // from label
- QCOMPARE(acc_label->navigate(QAccessible::Labelled, 0, &acc_target), -1);
- QVERIFY(!acc_target);
- QCOMPARE(acc_label->navigate(QAccessible::Labelled, 1, &acc_target), 0);
- QVERIFY(acc_target->object() == acc_lineedit->object());
- delete acc_target; acc_target = 0;
- QCOMPARE(acc_label->navigate(QAccessible::Labelled, 2, &acc_target), -1);
- QVERIFY(!acc_target);
-
- QCOMPARE(acc_groupbox->navigate(QAccessible::Labelled, 0, &acc_target), -1);
- QVERIFY(!acc_target);
- QCOMPARE(acc_groupbox->navigate(QAccessible::Labelled, 1, &acc_target), 0);
- QVERIFY(acc_target->object() == acc_radio->object());
- delete acc_target; acc_target = 0;
- QCOMPARE(acc_groupbox->navigate(QAccessible::Labelled, 2, &acc_target), 0);
- QVERIFY(acc_target->object() == acc_label2->object());
- delete acc_target; acc_target = 0;
- QCOMPARE(acc_groupbox->navigate(QAccessible::Labelled, 3, &acc_target), 0);
- QVERIFY(acc_target->object() == acc_lineedit2->object());
- delete acc_target; acc_target = 0;
- QCOMPARE(acc_groupbox->navigate(QAccessible::Labelled, 4, &acc_target), 0);
- QVERIFY(acc_target->object() == acc_groupbox2->object());
- delete acc_target; acc_target = 0;
- QCOMPARE(acc_groupbox->navigate(QAccessible::Labelled, 5, &acc_target), -1);
- QVERIFY(!acc_target);
-
- QCOMPARE(acc_border->navigate(QAccessible::Labelled, 0, &acc_target), -1);
- QVERIFY(!acc_target);
- QCOMPARE(acc_border->navigate(QAccessible::Labelled, 1, &acc_target), -1);
- QVERIFY(!acc_target);
-
- // to label
- QCOMPARE(acc_lineedit->navigate(QAccessible::Label, 0, &acc_target), -1);
- QVERIFY(!acc_target);
- QCOMPARE(acc_lineedit->navigate(QAccessible::Label, 1, &acc_target), 0);
- QVERIFY(acc_target->object() == acc_label->object());
- delete acc_target; acc_target = 0;
- QCOMPARE(acc_lineedit->navigate(QAccessible::Label, 2, &acc_target), -1);
- QVERIFY(!acc_target);
-
- QCOMPARE(acc_radio->navigate(QAccessible::Label, 0, &acc_target), -1);
- QVERIFY(!acc_target);
- QCOMPARE(acc_radio->navigate(QAccessible::Label, 1, &acc_target), 0);
- QVERIFY(acc_target->object() == acc_groupbox->object());
- delete acc_target; acc_target = 0;
- QCOMPARE(acc_radio->navigate(QAccessible::Label, 2, &acc_target), -1);
- QVERIFY(!acc_target);
-
- QCOMPARE(acc_lineedit2->navigate(QAccessible::Label, 1, &acc_target), 0);
- QVERIFY(acc_target->object() == acc_label2->object());
- delete acc_target; acc_target = 0;
- QCOMPARE(acc_lineedit2->navigate(QAccessible::Label, 2, &acc_target), 0);
- QVERIFY(acc_target->object() == acc_groupbox->object());
- delete acc_target; acc_target = 0;
- QCOMPARE(acc_lineedit2->navigate(QAccessible::Label, 3, &acc_target), -1);
- QVERIFY(!acc_target);
-
- QCOMPARE(acc_grandchild->navigate(QAccessible::Label, 1, &acc_target), 0);
- QVERIFY(acc_target->object() == acc_groupbox2->object());
- delete acc_target; acc_target = 0;
- QCOMPARE(acc_grandchild->navigate(QAccessible::Label, 2, &acc_target), -1);
- QVERIFY(!acc_target);
- QCOMPARE(acc_grandchild->navigate(QAccessible::Label, 3, &acc_target), -1);
- QVERIFY(!acc_target);
-
- delete acc_label;
- delete acc_lineedit;
- delete acc_groupbox;
- delete acc_radio;
- delete acc_label2;
- delete acc_lineedit2;
- delete acc_groupbox2;
- delete acc_grandchild;
- delete acc_border;
- delete acc_lineedit3;
- }
- QTestAccessibility::clearEvents();
-#endif // !QT3_SUPPORT
-}
-
static QWidget *createWidgets()
{
QWidget *w = new QWidget();
@@ -1460,140 +854,6 @@ void tst_QAccessibility::accessibleName()
QTestAccessibility::clearEvents();
}
-void tst_QAccessibility::text()
-{
-#if !defined(QT3_SUPPORT)
- QSKIP("This test needs Qt3Support", SkipAll);
-#else
- QWidget *toplevel = createGUI();
- toplevel->show();
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(toplevel);
- QTest::qWait(100);
-#endif
- QObject *topLeft = toplevel->child("topLeft");
- QObject *topRight = toplevel->child("topRight");
- QObject *bottomLeft = toplevel->child("bottomLeft");
-
- QAccessibleInterface *acc_pb1 = QAccessible::queryAccessibleInterface(topLeft->child("pb1"));
-
- QAccessibleInterface *acc_pbOk = QAccessible::queryAccessibleInterface(topRight->child("pbOk"));
- QAccessibleInterface *acc_slider = QAccessible::queryAccessibleInterface(topRight->child("slider"));
- QAccessibleInterface *acc_spinBox = QAccessible::queryAccessibleInterface(topRight->child("spinBox"));
- QAccessibleInterface *acc_sliderLcd = QAccessible::queryAccessibleInterface(topRight->child("sliderLcd"));
-
- QAccessibleInterface *acc_label = QAccessible::queryAccessibleInterface(bottomLeft->child("label"));
- QAccessibleInterface *acc_lineedit = QAccessible::queryAccessibleInterface(bottomLeft->child("lineedit"));
- QAccessibleInterface *acc_radiogroup = QAccessible::queryAccessibleInterface(bottomLeft->child("radiogroup"));
- QVERIFY(bottomLeft->child("radiogroup"));
- QAccessibleInterface *acc_radioAM = QAccessible::queryAccessibleInterface(bottomLeft->child("radiogroup")->child("radioAM"));
- QAccessibleInterface *acc_frequency = QAccessible::queryAccessibleInterface(bottomLeft->child("radiogroup")->child("frequency"));
-
- QVERIFY(acc_pb1);
-
- QVERIFY(acc_pbOk);
- QVERIFY(acc_slider);
- QVERIFY(acc_spinBox);
- QVERIFY(acc_sliderLcd);
-
- QVERIFY(acc_label);
- QVERIFY(acc_lineedit);
- QVERIFY(acc_radiogroup);
- QVERIFY(acc_radioAM);
- QVERIFY(acc_frequency);
-
- QVERIFY(acc_label->relationTo(0, acc_lineedit, 0) & QAccessible::Label);
- QVERIFY(acc_radiogroup->relationTo(0, acc_frequency, 0) & QAccessible::Label);
- QVERIFY(acc_slider->relationTo(0, acc_sliderLcd, 0) & QAccessible::Controller);
- QVERIFY(acc_spinBox->relationTo(0, acc_slider, 0) & QAccessible::Controller);
-
- // Name
- QCOMPARE(acc_lineedit->text(QAccessible::Name, 0), acc_label->text(QAccessible::Name,0));
- QCOMPARE(acc_frequency->text(QAccessible::Name, 0), acc_radiogroup->text(QAccessible::Name,0));
- QCOMPARE(acc_sliderLcd->text(QAccessible::Name, 0), acc_slider->text(QAccessible::Value,0));
- QCOMPARE(acc_pbOk->text(QAccessible::Name, 0), QString("Ok"));
- QCOMPARE(acc_radioAM->text(QAccessible::Name, 0), QString("AM"));
- QCOMPARE(acc_pb1->text(QAccessible::Name, 0), QString("Button1"));
-
- // Description
- QString desc = qobject_cast<QWidget*>(acc_label->object())->toolTip();
- QVERIFY(!desc.isEmpty());
- QCOMPARE(acc_label->text(QAccessible::Description, 0), desc);
- desc = qobject_cast<QWidget*>(acc_lineedit->object())->toolTip();
- QVERIFY(!desc.isEmpty());
- QCOMPARE(acc_lineedit->text(QAccessible::Description, 0), desc);
-
- // Help
- QString help = qobject_cast<QWidget*>(acc_label->object())->whatsThis();
- QVERIFY(!help.isEmpty());
- QCOMPARE(acc_label->text(QAccessible::Help, 0), help);
- help = qobject_cast<QWidget*>(acc_frequency->object())->whatsThis();
- QVERIFY(!help.isEmpty());
- QCOMPARE(acc_frequency->text(QAccessible::Help, 0), help);
-
- // Value
- QString value = acc_frequency->object()->property("text").toString();
- QVERIFY(!value.isEmpty());
- QCOMPARE(acc_frequency->text(QAccessible::Value, 0), value);
- value = acc_slider->object()->property("value").toString();
- QVERIFY(!value.isEmpty());
- QCOMPARE(acc_slider->text(QAccessible::Value, 0), value);
- QCOMPARE(acc_spinBox->text(QAccessible::Value, 0), value);
-
- // Accelerator
- QCOMPARE(acc_pbOk->text(QAccessible::Accelerator, 0), Q3Accel::keyToString(Qt::Key_Enter));
- QCOMPARE(acc_pb1->text(QAccessible::Accelerator, 0), Q3Accel::keyToString(Qt::ALT + Qt::Key_1));
- QCOMPARE(acc_lineedit->text(QAccessible::Accelerator, 0), Q3Accel::keyToString(Qt::ALT) + "L");
- QCOMPARE(acc_frequency->text(QAccessible::Accelerator, 0), Q3Accel::keyToString(Qt::ALT) + "C");
-
- delete acc_pb1;
- delete acc_pbOk;
- delete acc_slider;
- delete acc_spinBox;
- delete acc_sliderLcd;
-
- delete acc_label;
- delete acc_lineedit;
- delete acc_radiogroup;
- delete acc_radioAM;
- delete acc_frequency;
-
- delete toplevel;
- QTestAccessibility::clearEvents();
-#endif // !QT3_SUPPORT
-}
-
-void tst_QAccessibility::setText()
-{
-#if !defined(QT3_SUPPORT)
- QSKIP("This test needs Qt3Support", SkipAll);
-#else
- QWidget *toplevel = createGUI();
- toplevel->show();
- QObject *bottomLeft = toplevel->findChild<QObject *>("bottomLeft");
-
- QAccessibleInterface *acc_lineedit = QAccessible::queryAccessibleInterface(bottomLeft->findChild<QLineEdit *>("lineedit"));
- // Value, read-write
- QString txt = acc_lineedit->text(QAccessible::Value, 0);
- QVERIFY(txt.isEmpty());
- txt = QLatin1String("Writable");
- acc_lineedit->setText(QAccessible::Value, 0, txt);
- QCOMPARE(acc_lineedit->text(QAccessible::Value, 0), txt);
-
- // Description, read-only
- txt = acc_lineedit->text(QAccessible::Description, 0);
- QVERIFY(!txt.isEmpty());
- acc_lineedit->setText(QAccessible::Description, 0, QLatin1String(""));
- QCOMPARE(acc_lineedit->text(QAccessible::Description, 0), txt);
-
- QVERIFY(acc_lineedit);
-
- delete acc_lineedit;
- delete toplevel;
- QTestAccessibility::clearEvents();
-#endif //QT3_SUPPORT
-}
-
void tst_QAccessibility::hideShowTest()
{
QWidget * const window = new QWidget();
@@ -1768,32 +1028,6 @@ void tst_QAccessibility::buttonTest()
toggletool.setText("Toggle");
toggletool.setMinimumSize(20,20);
-#if 0
- // QT3_SUPPORT
- // push button with a menu
- QPushButton menuButton("Menu", &window);
- Q3PopupMenu buttonMenu(&menuButton);
- buttonMenu.insertItem("Some item");
- menuButton.setPopup(&buttonMenu);
-
- // menu toolbutton
- QToolButton menuToolButton(&window);
- menuToolButton.setText("Menu Tool");
- Q3PopupMenu toolMenu(&menuToolButton);
- toolMenu.insertItem("Some item");
- menuToolButton.setPopup(&toolMenu);
- menuToolButton.setMinimumSize(20,20);
-
- // splitted menu toolbutton
- QToolButton splitToolButton(&window);
- splitToolButton.setTextLabel("Split Tool");
- Q3PopupMenu splitMenu(&splitToolButton);
- splitMenu.insertItem("Some item");
- splitToolButton.setPopup(&splitMenu);
- splitToolButton.setPopupDelay(0);
- splitToolButton.setMinimumSize(20,20);
-#endif
-
// test push button
QAccessibleInterface* interface = QAccessible::queryAccessibleInterface(&pushButton);
QAccessibleActionInterface* actionInterface = interface->actionInterface();
@@ -1927,206 +1161,6 @@ void tst_QAccessibility::buttonTest()
QTestAccessibility::clearEvents();
}
-void tst_QAccessibility::sliderTest()
-{
-#if !defined(QT3_SUPPORT)
- QSKIP("This test needs Qt3Support", SkipAll);
-#else
- QAccessibleInterface *test = 0;
- Q3VBox *vbox = new Q3VBox;
- QLabel *labelHorizontal = new QLabel("Horizontal", vbox);
- QSlider *sliderHorizontal = new QSlider(Qt::Horizontal, vbox);
- labelHorizontal->setBuddy(sliderHorizontal);
-
- QLabel *labelVertical = new QLabel("Vertical", vbox);
- QSlider *sliderVertical = new QSlider(Qt::Vertical, vbox);
- labelVertical->setBuddy(sliderVertical);
- vbox->show();
-
- // test horizontal slider
- test = QAccessible::queryAccessibleInterface(sliderHorizontal);
- QVERIFY(test);
- QCOMPARE(test->childCount(), 3);
- QCOMPARE(test->role(0), QAccessible::Slider);
- QCOMPARE(test->role(1), QAccessible::PushButton);
- QCOMPARE(test->role(2), QAccessible::Indicator);
- QCOMPARE(test->role(3), QAccessible::PushButton);
-
- QCOMPARE(test->text(QAccessible::Name, 0), labelHorizontal->text());
- QCOMPARE(test->text(QAccessible::Name, 1), QSlider::tr("Page left"));
- QCOMPARE(test->text(QAccessible::Name, 2), QSlider::tr("Position"));
- QCOMPARE(test->text(QAccessible::Name, 3), QSlider::tr("Page right"));
- QCOMPARE(test->text(QAccessible::Value, 0), QString::number(sliderHorizontal->value()));
- QCOMPARE(test->text(QAccessible::Value, 1), QString());
- QCOMPARE(test->text(QAccessible::Value, 2), QString::number(sliderHorizontal->value()));
- QCOMPARE(test->text(QAccessible::Value, 3), QString());
-// Skip action tests.
-#if 0
- QCOMPARE(test->defaultAction(0), QAccessible::SetFocus);
- QCOMPARE(test->defaultAction(1), QAccessible::Press);
- QCOMPARE(test->defaultAction(2), QAccessible::NoAction);
- QCOMPARE(test->defaultAction(3), QAccessible::Press);
- QCOMPARE(test->actionText(QAccessible::SetFocus, QAccessible::Name, 0), QSlider::tr("Set Focus"));
- QCOMPARE(test->actionText(QAccessible::Press, QAccessible::Name, 1), QSlider::tr("Press"));
- QCOMPARE(test->actionText(QAccessible::Increase, QAccessible::Name, 2), QSlider::tr("Increase"));
- QCOMPARE(test->actionText(QAccessible::Decrease, QAccessible::Name, 2), QSlider::tr("Decrease"));
- QCOMPARE(test->actionText(QAccessible::Press, QAccessible::Name, 3), QSlider::tr("Press"));
- QVERIFY(test->doAction(QAccessible::Press, 3));
- QCOMPARE(test->text(QAccessible::Value, 0), QString::number(sliderHorizontal->pageStep()));
- QVERIFY(test->doAction(QAccessible::Press, 3));
- QCOMPARE(test->text(QAccessible::Value, 0), QString::number(2*sliderHorizontal->pageStep()));
- QVERIFY(test->doAction(QAccessible::Press, 1));
- QCOMPARE(test->text(QAccessible::Value, 0), QString::number(sliderHorizontal->pageStep()));
- QVERIFY(test->doAction(QAccessible::Press, 1));
- QCOMPARE(test->text(QAccessible::Value, 0), QString::number(0));
- QVERIFY(test->doAction(QAccessible::Increase, 2));
- QCOMPARE(test->text(QAccessible::Value, 0), QString::number(sliderHorizontal->lineStep()));
- QVERIFY(test->doAction(QAccessible::Increase, 2));
- QCOMPARE(test->text(QAccessible::Value, 0), QString::number(2*sliderHorizontal->lineStep()));
- QVERIFY(test->doAction(QAccessible::Decrease, 2));
- QCOMPARE(test->text(QAccessible::Value, 0), QString::number(sliderHorizontal->lineStep()));
- QVERIFY(test->doAction(QAccessible::Decrease, 2));
- QCOMPARE(test->text(QAccessible::Value, 0), QString::number(0));
-#endif
- delete test;
-
- // test vertical slider
- test = QAccessible::queryAccessibleInterface(sliderVertical);
- QVERIFY(test);
- QCOMPARE(test->childCount(), 3);
- QCOMPARE(test->role(0), QAccessible::Slider);
- QCOMPARE(test->role(1), QAccessible::PushButton);
- QCOMPARE(test->role(2), QAccessible::Indicator);
- QCOMPARE(test->role(3), QAccessible::PushButton);
-
- QCOMPARE(test->text(QAccessible::Name, 0), labelVertical->text());
- QCOMPARE(test->text(QAccessible::Name, 1), QSlider::tr("Page up"));
- QCOMPARE(test->text(QAccessible::Name, 2), QSlider::tr("Position"));
- QCOMPARE(test->text(QAccessible::Name, 3), QSlider::tr("Page down"));
- QCOMPARE(test->text(QAccessible::Value, 0), QString::number(sliderVertical->value()));
- QCOMPARE(test->text(QAccessible::Value, 1), QString());
- QCOMPARE(test->text(QAccessible::Value, 2), QString::number(sliderVertical->value()));
- QCOMPARE(test->text(QAccessible::Value, 3), QString());
-// Skip action tests.
-#if 0
- QCOMPARE(test->defaultAction(0), QAccessible::SetFocus);
- QCOMPARE(test->defaultAction(1), QAccessible::Press);
- QCOMPARE(test->defaultAction(2), QAccessible::NoAction);
- QCOMPARE(test->defaultAction(3), QAccessible::Press);
- QCOMPARE(test->actionText(QAccessible::SetFocus, QAccessible::Name, 0), QSlider::tr("Set Focus"));
- QCOMPARE(test->actionText(QAccessible::Press, QAccessible::Name, 1), QSlider::tr("Press"));
- QCOMPARE(test->actionText(QAccessible::Increase, QAccessible::Name, 2), QSlider::tr("Increase"));
- QCOMPARE(test->actionText(QAccessible::Decrease, QAccessible::Name, 2), QSlider::tr("Decrease"));
- QCOMPARE(test->actionText(QAccessible::Press, QAccessible::Name, 3), QSlider::tr("Press"));
- QVERIFY(test->doAction(QAccessible::Press, 3));
- QCOMPARE(test->text(QAccessible::Value, 0), QString::number(sliderVertical->pageStep()));
- QVERIFY(test->doAction(QAccessible::Press, 3));
- QCOMPARE(test->text(QAccessible::Value, 0), QString::number(2*sliderVertical->pageStep()));
- QVERIFY(test->doAction(QAccessible::Press, 1));
- QCOMPARE(test->text(QAccessible::Value, 0), QString::number(sliderVertical->pageStep()));
- QVERIFY(test->doAction(QAccessible::Press, 1));
- QCOMPARE(test->text(QAccessible::Value, 0), QString::number(0));
- QVERIFY(test->doAction(QAccessible::Increase, 2));
- QCOMPARE(test->text(QAccessible::Value, 0), QString::number(sliderVertical->lineStep()));
- QVERIFY(test->doAction(QAccessible::Increase, 2));
- QCOMPARE(test->text(QAccessible::Value, 0), QString::number(2*sliderVertical->lineStep()));
- QVERIFY(test->doAction(QAccessible::Decrease, 2));
- QCOMPARE(test->text(QAccessible::Value, 0), QString::number(sliderVertical->lineStep()));
- QVERIFY(test->doAction(QAccessible::Decrease, 2));
- QCOMPARE(test->text(QAccessible::Value, 0), QString::number(0));
-#endif
- delete test;
- delete sliderHorizontal;
- delete sliderVertical;
- delete labelHorizontal;
- delete labelVertical;
- delete vbox;
-
- // Test that when we hide() a slider, the PageLeft, Indicator, and PageRight also gets the
- // Invisible state bit set.
- enum SubControls { PageLeft = 1, Position = 2, PageRight = 3 };
-
- QSlider *slider = new QSlider();
- QAccessibleInterface * const sliderInterface = QAccessible::queryAccessibleInterface(slider);
- QVERIFY(sliderInterface);
-
- QVERIFY(sliderInterface->state(0) & QAccessible::Invisible);
- QVERIFY(sliderInterface->state(PageLeft) & QAccessible::Invisible);
- QVERIFY(sliderInterface->state(Position) & QAccessible::Invisible);
- QVERIFY(sliderInterface->state(PageRight) & QAccessible::Invisible);
-
- slider->show();
- QVERIFY(sliderInterface->state(0) ^ QAccessible::Invisible);
- QVERIFY(sliderInterface->state(PageLeft) ^ QAccessible::Invisible);
- QVERIFY(sliderInterface->state(Position) ^ QAccessible::Invisible);
- QVERIFY(sliderInterface->state(PageRight) ^ QAccessible::Invisible);
- QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(slider, 0, QAccessible::ObjectShow)));
- QTestAccessibility::clearEvents();
-
- slider->hide();
- QVERIFY(sliderInterface->state(0) & QAccessible::Invisible);
- QVERIFY(sliderInterface->state(PageLeft) & QAccessible::Invisible);
- QVERIFY(sliderInterface->state(Position) & QAccessible::Invisible);
- QVERIFY(sliderInterface->state(PageRight) & QAccessible::Invisible);
- QVERIFY(QTestAccessibility::events().contains(QTestAccessibilityEvent(slider, 0, QAccessible::ObjectHide)));
- QTestAccessibility::clearEvents();
-
- // Test that the left/right subcontrols are set to unavailable when the slider is at the minimum/maximum.
- slider->show();
- slider->setMinimum(0);
- slider->setMaximum(100);
-
- slider->setValue(50);
- QVERIFY(sliderInterface->state(PageLeft) ^ QAccessible::Unavailable);
- QVERIFY(sliderInterface->state(Position) ^ QAccessible::Unavailable);
- QVERIFY(sliderInterface->state(PageRight) ^ QAccessible::Unavailable);
-
- slider->setValue(0);
- QVERIFY(sliderInterface->state(PageLeft) & QAccessible::Unavailable);
- QVERIFY(sliderInterface->state(Position) ^ QAccessible::Unavailable);
- QVERIFY(sliderInterface->state(PageRight) ^ QAccessible::Unavailable);
-
- slider->setValue(100);
- QVERIFY(sliderInterface->state(PageLeft) ^ QAccessible::Unavailable);
- QVERIFY(sliderInterface->state(Position) ^ QAccessible::Unavailable);
- QVERIFY(sliderInterface->state(PageRight) & QAccessible::Unavailable);
-
- delete sliderInterface;
- delete slider;
-
- // Test that the rects are ok.
- {
- QSlider *slider = new QSlider(Qt::Horizontal);
- slider->show();
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(slider);
- QTest::qWait(100);
-#endif
- QAccessibleInterface * const sliderInterface = QAccessible::queryAccessibleInterface(slider);
- QVERIFY(sliderInterface);
-
- slider->setMinimum(0);
- slider->setMaximum(100);
- slider->setValue(50);
-
- const QRect sliderRect = sliderInterface->rect(0);
- QVERIFY(sliderRect.isValid());
-
- // Verify that the sub-control rects are valid and inside the slider rect.
- for (int i = PageLeft; i <= PageRight; ++i) {
- const QRect testRect = sliderInterface->rect(i);
- QVERIFY(testRect.isValid());
- QVERIFY(sliderRect.contains(testRect));
- }
-
- delete slider;
- delete sliderInterface;
- }
-
- QTestAccessibility::clearEvents();
-#endif //!QT3_SUPPORT
-}
-
void tst_QAccessibility::scrollBarTest()
{
// Test that when we hide() a slider, the PageLeft, Indicator, and PageRight also gets the
@@ -3787,47 +2821,6 @@ void tst_QAccessibility::dockWidgetTest()
#endif // QT_NO_DOCKWIDGET
}
-void tst_QAccessibility::pushButtonTest()
-{
-#if !defined(QT3_SUPPORT)
- QSKIP( "Should never get here without Qt3Support", SkipAll);
-#else
- // Set up a proper main window with two dock widgets
- QWidget *toplevel = createGUI();
- QObject *topRight = toplevel->findChild<QObject *>("topRight");
-
- toplevel->show();
-#if defined(Q_WS_X11)
- qt_x11_wait_for_window_manager(toplevel);
- QTest::qWait(100);
-#endif
- QPushButton *pb = qobject_cast<QPushButton*>(topRight->findChild<QPushButton *>("pbOk"));
- QPoint pt = pb->mapToGlobal(pb->geometry().topLeft());
- QRect rect(pt, pb->geometry().size());
- pt = rect.center();
-
- QAccessibleInterface *accToplevel = QAccessible::queryAccessibleInterface(toplevel);
- QAccessibleInterface *acc;
- QAccessibleInterface *acc2;
- int entry = accToplevel->childAt(pt.x(), pt.y());
- accToplevel->navigate(QAccessible::Child, entry, &acc);
- if (acc) {
- entry = acc->childAt(pt.x(), pt.y());
- acc->navigate(QAccessible::Child, entry, &acc2);
- delete acc;
- acc = acc2;
- }
- QCOMPARE(acc->role(0), QAccessible::PushButton);
- QCOMPARE(acc->rect(0), rect);
- QCOMPARE(acc->childAt(pt.x(), pt.y()), 0);
-
- delete acc;
- delete accToplevel;
- delete toplevel;
- QTestAccessibility::clearEvents();
-#endif //QT3_SUPPORT
-}
-
void tst_QAccessibility::comboBoxTest()
{
#if defined(Q_OS_WINCE)
diff --git a/tests/auto/qcombobox/tst_qcombobox.cpp b/tests/auto/qcombobox/tst_qcombobox.cpp
index d525068893..33a630076e 100644
--- a/tests/auto/qcombobox/tst_qcombobox.cpp
+++ b/tests/auto/qcombobox/tst_qcombobox.cpp
@@ -1230,21 +1230,17 @@ void tst_QComboBox::insertItem_data()
QTest::addColumn<int>("insertIndex");
QTest::addColumn<QString>("itemLabel");
QTest::addColumn<int>("expectedIndex");
- QTest::addColumn<bool>("testQt3Support");
QTest::addColumn<bool>("editable");
QStringList initialItems;
initialItems << "foo" << "bar";
for(int e = 0 ; e<2 ; e++) {
bool editable = (e==0);
- QTest::newRow("Insert less then 0") << initialItems << -1 << "inserted" << 0 << false << editable;
- QTest::newRow("Insert at 0") << initialItems << 0 << "inserted" << 0 << false << editable;
- QTest::newRow("Insert beyond count") << initialItems << 3 << "inserted" << 2 << false << editable;
- QTest::newRow("Insert at count") << initialItems << 2 << "inserted" << 2 << false << editable;
- QTest::newRow("Insert in the middle") << initialItems << 1 << "inserted" << 1 << false << editable;
-#if defined(QT3_SUPPORT)
- QTest::newRow("Qt3Support: Insert less then 0") << initialItems << -1 << "inserted" << 2 << true << editable;
-#endif
+ QTest::newRow("Insert less then 0") << initialItems << -1 << "inserted" << 0 << editable;
+ QTest::newRow("Insert at 0") << initialItems << 0 << "inserted" << 0 << editable;
+ QTest::newRow("Insert beyond count") << initialItems << 3 << "inserted" << 2 << editable;
+ QTest::newRow("Insert at count") << initialItems << 2 << "inserted" << 2 << editable;
+ QTest::newRow("Insert in the middle") << initialItems << 1 << "inserted" << 1 << editable;
}
}
@@ -1254,7 +1250,6 @@ void tst_QComboBox::insertItem()
QFETCH(int, insertIndex);
QFETCH(QString, itemLabel);
QFETCH(int, expectedIndex);
- QFETCH(bool, testQt3Support);
QFETCH(bool, editable);
testWidget->insertItems(0, initialItems);
@@ -1263,16 +1258,7 @@ void tst_QComboBox::insertItem()
testWidget->setEditable(true);
if (editable)
testWidget->setEditText("FOO");
-#if defined (QT3_SUPPORT)
- if (testQt3Support)
- testWidget->insertItem(itemLabel, insertIndex);
- else
- testWidget->insertItem(insertIndex, itemLabel);
-#else
- Q_UNUSED(testQt3Support);
testWidget->insertItem(insertIndex, itemLabel);
-#endif
-
QCOMPARE(testWidget->count(), initialItems.count() + 1);
QCOMPARE(testWidget->itemText(expectedIndex), itemLabel);
diff --git a/tests/auto/qdatastream/tst_qdatastream.cpp b/tests/auto/qdatastream/tst_qdatastream.cpp
index bd5099f03a..d05b664b42 100644
--- a/tests/auto/qdatastream/tst_qdatastream.cpp
+++ b/tests/auto/qdatastream/tst_qdatastream.cpp
@@ -319,12 +319,12 @@ static int dataIndex(const QString &tag)
{
int pos = tag.lastIndexOf("_");
if (pos >= 0) {
- int ret = 0;
- QString count = tag.mid(pos + 1);
- bool ok;
- ret = count.toInt(&ok);
- if (ok)
- return ret;
+ int ret = 0;
+ QString count = tag.mid(pos + 1);
+ bool ok;
+ ret = count.toInt(&ok);
+ if (ok)
+ return ret;
}
return -1;
}
@@ -350,15 +350,15 @@ void tst_QDataStream::stream_data(int noOfElements)
QTest::addColumn<QString>("byteOrder");
for (int d=0; devices[d] != 0; d++) {
- QString device = devices[d];
- for (int b=0; b<2; b++) {
- QString byte_order = b == 0 ? "BigEndian" : "LittleEndian";
-
- QString tag = device + "_" + byte_order;
- for (int e=0; e<noOfElements; e++) {
- QTest::newRow(qPrintable(tag + QString("_%1").arg(e))) << device << QString(byte_order);
- }
- }
+ QString device = devices[d];
+ for (int b=0; b<2; b++) {
+ QString byte_order = b == 0 ? "BigEndian" : "LittleEndian";
+
+ QString tag = device + "_" + byte_order;
+ for (int e=0; e<noOfElements; e++) {
+ QTest::newRow(qPrintable(tag + QString("_%1").arg(e))) << device << QString(byte_order);
+ }
+ }
}
}
@@ -387,50 +387,49 @@ static const char* open_xpm[]={
#define STREAM_IMPL(TYPE) \
QFETCH(QString, device); \
if (device == "bytearray") { \
- QByteArray ba; \
- QDataStream sout(&ba, QIODevice::WriteOnly); \
- write##TYPE(&sout); \
- QDataStream sin(&ba, QIODevice::ReadOnly); \
- read##TYPE(&sin); \
+ QByteArray ba; \
+ QDataStream sout(&ba, QIODevice::WriteOnly); \
+ write##TYPE(&sout); \
+ QDataStream sin(&ba, QIODevice::ReadOnly); \
+ read##TYPE(&sin); \
} else if (device == "file") { \
- QString fileName = "qdatastream.out"; \
- QFile fOut(fileName); \
- QVERIFY(fOut.open(QIODevice::WriteOnly)); \
- QDataStream sout(&fOut); \
- write##TYPE(&sout); \
- fOut.close(); \
- QFile fIn(fileName); \
- QVERIFY(fIn.open(QIODevice::ReadOnly)); \
- QDataStream sin(&fIn); \
- read##TYPE(&sin); \
- fIn.close(); \
+ QString fileName = "qdatastream.out"; \
+ QFile fOut(fileName); \
+ QVERIFY(fOut.open(QIODevice::WriteOnly)); \
+ QDataStream sout(&fOut); \
+ write##TYPE(&sout); \
+ fOut.close(); \
+ QFile fIn(fileName); \
+ QVERIFY(fIn.open(QIODevice::ReadOnly)); \
+ QDataStream sin(&fIn); \
+ read##TYPE(&sin); \
+ fIn.close(); \
} else if (device == "buffer") { \
- QByteArray ba(10000, '\0'); \
- QBuffer bOut(&ba); \
- bOut.open(QIODevice::WriteOnly); \
- QDataStream sout(&bOut); \
- write##TYPE(&sout); \
- bOut.close(); \
- QBuffer bIn(&ba); \
- bIn.open(QIODevice::ReadOnly); \
- QDataStream sin(&bIn); \
- read##TYPE(&sin); \
- bIn.close(); \
+ QByteArray ba(10000, '\0'); \
+ QBuffer bOut(&ba); \
+ bOut.open(QIODevice::WriteOnly); \
+ QDataStream sout(&bOut); \
+ write##TYPE(&sout); \
+ bOut.close(); \
+ QBuffer bIn(&ba); \
+ bIn.open(QIODevice::ReadOnly); \
+ QDataStream sin(&bIn); \
+ read##TYPE(&sin); \
+ bIn.close(); \
}
// ************************************
static QString QStringData(int index)
{
- switch (index)
- {
- case 0: return QString();
- case 1: return QString("");
- case 2: return QString("A");
- case 3: return QString("ABCDE FGHI");
- case 4: return QString("This is a long string");
- case 5: return QString("And again a string with a \nCRLF");
- case 6: return QString("abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRESTUVWXYZ 1234567890 ~`!@#$%^&*()_-+={[}]|\\:;\"'<,>.?/");
+ switch (index) {
+ case 0: return QString();
+ case 1: return QString("");
+ case 2: return QString("A");
+ case 3: return QString("ABCDE FGHI");
+ case 4: return QString("This is a long string");
+ case 5: return QString("And again a string with a \nCRLF");
+ case 6: return QString("abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRESTUVWXYZ 1234567890 ~`!@#$%^&*()_-+={[}]|\\:;\"'<,>.?/");
}
return QString("foo");
}
@@ -489,15 +488,15 @@ void tst_QDataStream::readQString(QDataStream *s)
static QRegExp QRegExpData(int index)
{
- switch (index)
- {
- case 0: return QRegExp();
- case 1: return QRegExp("");
- case 2: return QRegExp("A", Qt::CaseInsensitive);
- case 3: return QRegExp("ABCDE FGHI", Qt::CaseSensitive, QRegExp::Wildcard);
- case 4: return QRegExp("This is a long string", Qt::CaseInsensitive, QRegExp::FixedString);
- case 5: return QRegExp("And again a string with a \nCRLF", Qt::CaseInsensitive, QRegExp::RegExp);
- case 6: {
+ switch (index) {
+ case 0: return QRegExp();
+ case 1: return QRegExp("");
+ case 2: return QRegExp("A", Qt::CaseInsensitive);
+ case 3: return QRegExp("ABCDE FGHI", Qt::CaseSensitive, QRegExp::Wildcard);
+ case 4: return QRegExp("This is a long string", Qt::CaseInsensitive, QRegExp::FixedString);
+ case 5: return QRegExp("And again a string with a \nCRLF", Qt::CaseInsensitive, QRegExp::RegExp);
+ case 6:
+ {
QRegExp rx("abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRESTUVWXYZ 1234567890 ~`!@#$%^&*()_-+={[}]|\\:;\"'<,>.?/");
rx.setMinimal(true);
return rx;
@@ -558,22 +557,21 @@ static Map MapData(int index)
{
Map map;
- switch (index)
- {
- case 0:
- default:
- break;
- case 1:
- map.insert(1, "a");
- map.insert(2, "bbb");
- map.insert(3, "cccccc");
- break;
- case 2:
- map.insert(1, "a");
- map.insert(2, "one");
- map.insertMulti(2, "two");
- map.insertMulti(2, "three");
- map.insert(3, "cccccc");
+ switch (index) {
+ case 0:
+ default:
+ break;
+ case 1:
+ map.insert(1, "a");
+ map.insert(2, "bbb");
+ map.insert(3, "cccccc");
+ break;
+ case 2:
+ map.insert(1, "a");
+ map.insert(2, "one");
+ map.insertMulti(2, "two");
+ map.insertMulti(2, "three");
+ map.insert(3, "cccccc");
}
return map;
}
@@ -615,22 +613,21 @@ static Hash HashData(int index)
{
Hash map;
- switch (index)
- {
- case 0:
- default:
- break;
- case 1:
- map.insert(1, "a");
- map.insert(2, "bbb");
- map.insert(3, "cccccc");
- break;
- case 2:
- map.insert(1, "a");
- map.insert(2, "one");
- map.insertMulti(2, "two");
- map.insertMulti(2, "three");
- map.insert(3, "cccccc");
+ switch (index) {
+ case 0:
+ default:
+ break;
+ case 1:
+ map.insert(1, "a");
+ map.insert(2, "bbb");
+ map.insert(3, "cccccc");
+ break;
+ case 2:
+ map.insert(1, "a");
+ map.insert(2, "one");
+ map.insertMulti(2, "two");
+ map.insertMulti(2, "three");
+ map.insert(3, "cccccc");
}
return map;
}
@@ -672,32 +669,32 @@ static QEasingCurve QEasingCurveData(int index)
switch (index) {
case 0:
- default:
- break;
+ default:
+ break;
case 1:
- easing.setType(QEasingCurve::Linear);
- break;
+ easing.setType(QEasingCurve::Linear);
+ break;
case 2:
- easing.setType(QEasingCurve::OutCubic);
- break;
+ easing.setType(QEasingCurve::OutCubic);
+ break;
case 3:
- easing.setType(QEasingCurve::InOutSine);
- break;
+ easing.setType(QEasingCurve::InOutSine);
+ break;
case 4:
- easing.setType(QEasingCurve::InOutElastic);
- easing.setPeriod(1.5);
- easing.setAmplitude(2.0);
- break;
+ easing.setType(QEasingCurve::InOutElastic);
+ easing.setPeriod(1.5);
+ easing.setAmplitude(2.0);
+ break;
case 5:
- easing.setType(QEasingCurve::OutInBack);
- break;
+ easing.setType(QEasingCurve::OutInBack);
+ break;
case 6:
- easing.setType(QEasingCurve::OutCurve);
- break;
+ easing.setType(QEasingCurve::OutCurve);
+ break;
case 7:
- easing.setType(QEasingCurve::InOutBack);
- easing.setOvershoot(0.5);
- break;
+ easing.setType(QEasingCurve::InOutBack);
+ easing.setOvershoot(0.5);
+ break;
}
return easing;
}
@@ -783,13 +780,12 @@ void tst_QDataStream::readqint64(QDataStream *s)
static bool boolData(int index)
{
- switch (index)
- {
- case 0: return true;
- case 1: return false;
- case 2: return bool(2);
- case 3: return bool(-1);
- case 4: return bool(127);
+ switch (index) {
+ case 0: return true;
+ case 1: return false;
+ case 2: return bool(2);
+ case 3: return bool(-1);
+ case 4: return bool(127);
}
return false;
@@ -824,13 +820,12 @@ void tst_QDataStream::readbool(QDataStream *s)
static QBool QBoolData(int index)
{
- switch (index)
- {
- case 0: return QBool(true);
- case 1: return QBool(false);
- case 2: return QBool(bool(2));
- case 3: return QBool(bool(-1));
- case 4: return QBool(bool(127));
+ switch (index) {
+ case 0: return QBool(true);
+ case 1: return QBool(false);
+ case 2: return QBool(bool(2));
+ case 3: return QBool(bool(-1));
+ case 4: return QBool(bool(127));
}
return QBool(false);
@@ -877,35 +872,34 @@ void tst_QDataStream::stream_QBool_in_4_0()
static void QBitArrayData(QBitArray *b, int index)
{
QString filler = "";
- switch (index)
- {
- case 0: filler = ""; break;
- case 1: filler = ""; break;
- case 2: filler = "0"; break;
- case 3: filler = "1"; break;
- case 4: filler = "0000"; break;
- case 5: filler = "0001"; break;
- case 6: filler = "0010"; break;
- case 7: filler = "0100"; break;
- case 8: filler = "1000"; break;
- case 9: filler = "1111"; break;
- case 10: filler = "00000000"; break;
- case 11: filler = "00000001"; break;
- case 12: filler = "11111111"; break;
- case 13: filler = "000000001"; break;
- case 14: filler = "000000000001"; break;
- case 15: filler = "0000000000000001"; break;
- case 16: filler = "0101010101010101010101010101010101010101010101010101010101010101"; break;
- case 17: filler = "1010101010101010101010101010101010101010101010101010101010101010"; break;
- case 18: filler = "1111111111111111111111111111111111111111111111111111111111111111"; break;
+ switch (index) {
+ case 0: filler = ""; break;
+ case 1: filler = ""; break;
+ case 2: filler = "0"; break;
+ case 3: filler = "1"; break;
+ case 4: filler = "0000"; break;
+ case 5: filler = "0001"; break;
+ case 6: filler = "0010"; break;
+ case 7: filler = "0100"; break;
+ case 8: filler = "1000"; break;
+ case 9: filler = "1111"; break;
+ case 10: filler = "00000000"; break;
+ case 11: filler = "00000001"; break;
+ case 12: filler = "11111111"; break;
+ case 13: filler = "000000001"; break;
+ case 14: filler = "000000000001"; break;
+ case 15: filler = "0000000000000001"; break;
+ case 16: filler = "0101010101010101010101010101010101010101010101010101010101010101"; break;
+ case 17: filler = "1010101010101010101010101010101010101010101010101010101010101010"; break;
+ case 18: filler = "1111111111111111111111111111111111111111111111111111111111111111"; break;
}
b->resize(filler.length());
b->fill(0); // reset all bits to zero
for (int i = 0; i < filler.length(); ++i) {
- if (filler.at(i) == '1')
- b->setBit(i, TRUE);
+ if (filler.at(i) == '1')
+ b->setBit(i, TRUE);
}
}
@@ -940,19 +934,19 @@ void tst_QDataStream::readQBitArray(QDataStream *s)
static QBrush qBrushData(int index)
{
- switch (index)
- {
- case 0: return QBrush(Qt::NoBrush);
- case 1: return QBrush(Qt::SolidPattern);
- case 2: return QBrush(Qt::Dense7Pattern);
- case 3: return QBrush(Qt::red, Qt::NoBrush);
- case 4: return QBrush(Qt::green, Qt::SolidPattern);
- case 5: return QBrush(Qt::blue, Qt::Dense7Pattern);
- case 6: {
- QPixmap pm(open_xpm);
- QBrush custom(Qt::black, pm);
- return custom;
- }
+ switch (index) {
+ case 0: return QBrush(Qt::NoBrush);
+ case 1: return QBrush(Qt::SolidPattern);
+ case 2: return QBrush(Qt::Dense7Pattern);
+ case 3: return QBrush(Qt::red, Qt::NoBrush);
+ case 4: return QBrush(Qt::green, Qt::SolidPattern);
+ case 5: return QBrush(Qt::blue, Qt::Dense7Pattern);
+ case 6:
+ {
+ QPixmap pm(open_xpm);
+ QBrush custom(Qt::black, pm);
+ return custom;
+ }
case 7:
QLinearGradient gradient(QPoint(2.718, 3.142), QPoint(3.1337, 42));
gradient.setCoordinateMode(QGradient::ObjectBoundingMode);
@@ -975,7 +969,7 @@ void tst_QDataStream::stream_QBrush_data()
void tst_QDataStream::stream_QBrush()
{
if (QString(QTest::currentDataTag()).endsWith("6"))
- QSKIP("Custom brushes don't seem to be supported with QDataStream", SkipSingle);
+ QSKIP("Custom brushes don't seem to be supported with QDataStream", SkipSingle);
STREAM_IMPL(QBrush);
}
@@ -999,16 +993,15 @@ void tst_QDataStream::readQBrush(QDataStream *s)
static QColor QColorData(int index)
{
- switch (index)
- {
- case 0: return QColor(0,0,0);
- case 1: return QColor(0,0,0);
- case 2: return QColor(0,0,0);
- case 3: return QColor(0,0,0);
- case 4: return QColor(0,0,0);
- case 5: return QColor(0,0,0);
- case 6: return QColor(0,0,0);
- case 7: return QColor(0,0,0);
+ switch (index) {
+ case 0: return QColor(0,0,0);
+ case 1: return QColor(0,0,0);
+ case 2: return QColor(0,0,0);
+ case 3: return QColor(0,0,0);
+ case 4: return QColor(0,0,0);
+ case 5: return QColor(0,0,0);
+ case 6: return QColor(0,0,0);
+ case 7: return QColor(0,0,0);
}
return QColor(0,0,0);
@@ -1043,16 +1036,15 @@ void tst_QDataStream::readQColor(QDataStream *s)
static QByteArray qByteArrayData(int index)
{
- switch (index)
- {
- case 0: return QByteArray();
- case 1: return QByteArray("");
- case 2: return QByteArray("foo");
- case 3: return QByteArray("foo bar");
- case 4: return QByteArray("two\nlines");
- case 5: return QByteArray("ABCDEFG");
- case 6: return QByteArray("baec zxv 123"); // kept for nostalgic reasons
- case 7: return QByteArray("jbc;UBC;jd clhdbcahd vcbd vgdv dhvb laifv kadf jkhfbvljd khd lhvjh ");
+ switch (index) {
+ case 0: return QByteArray();
+ case 1: return QByteArray("");
+ case 2: return QByteArray("foo");
+ case 3: return QByteArray("foo bar");
+ case 4: return QByteArray("two\nlines");
+ case 5: return QByteArray("ABCDEFG");
+ case 6: return QByteArray("baec zxv 123"); // kept for nostalgic reasons
+ case 7: return QByteArray("jbc;UBC;jd clhdbcahd vcbd vgdv dhvb laifv kadf jkhfbvljd khd lhvjh ");
}
return QByteArray("foo");
@@ -1135,10 +1127,10 @@ void tst_QDataStream::readQCursor(QDataStream *s)
QVERIFY(d5.hotSpot() == test.hotSpot());
QVERIFY((d5.bitmap() != 0 && test.bitmap() != 0) || (d5.bitmap() == 0 && test.bitmap() == 0));
if (d5.bitmap() != 0)
- QVERIFY(pixmapsAreEqual(d5.bitmap(), test.bitmap()));
+ QVERIFY(pixmapsAreEqual(d5.bitmap(), test.bitmap()));
QVERIFY((d5.mask() != 0 && test.mask() != 0) || (d5.mask() == 0 && test.mask() == 0));
if (d5.mask() != 0)
- QVERIFY(pixmapsAreEqual(d5.mask(), test.mask()));
+ QVERIFY(pixmapsAreEqual(d5.mask(), test.mask()));
#endif
}
@@ -1146,24 +1138,23 @@ void tst_QDataStream::readQCursor(QDataStream *s)
static QDate qDateData(int index)
{
- switch (index)
- {
- case 0: return QDate(1752, 9, 14); // the first valid date
- case 1: return QDate(1900, 1, 1);
- case 2: return QDate(1976, 4, 5);
- case 3: return QDate(1960, 5, 27);
- case 4: return QDate(1999, 12, 31); // w2k effects?
- case 5: return QDate(2000, 1, 1);
- case 6: return QDate(2050, 1, 1);// test some values far in the future too
- case 7: return QDate(3001, 12, 31);
- case 8: return QDate(4002, 1, 1);
- case 9: return QDate(4003, 12, 31);
- case 10: return QDate(5004, 1, 1);
- case 11: return QDate(5005, 12, 31);
- case 12: return QDate(6006, 1, 1);
- case 13: return QDate(6007, 12, 31);
- case 14: return QDate(7008, 1, 1);
- case 15: return QDate(7009, 12, 31);
+ switch (index) {
+ case 0: return QDate(1752, 9, 14); // the first valid date
+ case 1: return QDate(1900, 1, 1);
+ case 2: return QDate(1976, 4, 5);
+ case 3: return QDate(1960, 5, 27);
+ case 4: return QDate(1999, 12, 31); // w2k effects?
+ case 5: return QDate(2000, 1, 1);
+ case 6: return QDate(2050, 1, 1);// test some values far in the future too
+ case 7: return QDate(3001, 12, 31);
+ case 8: return QDate(4002, 1, 1);
+ case 9: return QDate(4003, 12, 31);
+ case 10: return QDate(5004, 1, 1);
+ case 11: return QDate(5005, 12, 31);
+ case 12: return QDate(6006, 1, 1);
+ case 13: return QDate(6007, 12, 31);
+ case 14: return QDate(7008, 1, 1);
+ case 15: return QDate(7009, 12, 31);
}
return QDate();
}
@@ -1197,8 +1188,7 @@ void tst_QDataStream::readQDate(QDataStream *s)
static QTime qTimeData(int index)
{
- switch (index)
- {
+ switch (index) {
case 0 : return QTime(0, 0, 0, 0);
case 1 : return QTime(0, 0, 0, 1);
case 2 : return QTime(0, 0, 0, 99);
@@ -1292,24 +1282,23 @@ void tst_QDataStream::readQTime(QDataStream *s)
static QDateTime qDateTimeData(int index)
{
- switch (index)
- {
- case 0: return QDateTime(QDate(1900, 1, 1), QTime(0,0,0,0));
- case 1: return QDateTime(QDate(1900, 1, 2), QTime(1,1,1,1));
- case 2: return QDateTime(QDate(1900, 1, 3), QTime(12,0,0,0));
- case 3: return QDateTime(QDate(1900, 1, 4), QTime(23,59,59,999));
- case 4: return QDateTime(QDate(1999, 1, 1), QTime(0,0,0,0));
- case 5: return QDateTime(QDate(1999, 1, 2), QTime(1,1,1,1));
- case 6: return QDateTime(QDate(1999, 1, 3), QTime(12,0,0,0));
- case 7: return QDateTime(QDate(1999, 1, 4), QTime(23,59,59,999));
- case 8: return QDateTime(QDate(2000, 1, 1), QTime(0,0,0,0));
- case 9: return QDateTime(QDate(2000, 1, 2), QTime(1,1,1,1));
- case 10: return QDateTime(QDate(2000, 1, 3), QTime(12,0,0,0));
- case 11: return QDateTime(QDate(2000, 1, 4), QTime(23,59,59,999));
- case 12: return QDateTime(QDate(2000, 12, 31), QTime(0,0,0,0));
- case 13: return QDateTime(QDate(2000, 12, 31), QTime(1,1,1,1));
- case 14: return QDateTime(QDate(2000, 12, 31), QTime(12,0,0,0));
- case 15: return QDateTime(QDate(2000, 12, 31), QTime(23,59,59,999));
+ switch (index) {
+ case 0: return QDateTime(QDate(1900, 1, 1), QTime(0,0,0,0));
+ case 1: return QDateTime(QDate(1900, 1, 2), QTime(1,1,1,1));
+ case 2: return QDateTime(QDate(1900, 1, 3), QTime(12,0,0,0));
+ case 3: return QDateTime(QDate(1900, 1, 4), QTime(23,59,59,999));
+ case 4: return QDateTime(QDate(1999, 1, 1), QTime(0,0,0,0));
+ case 5: return QDateTime(QDate(1999, 1, 2), QTime(1,1,1,1));
+ case 6: return QDateTime(QDate(1999, 1, 3), QTime(12,0,0,0));
+ case 7: return QDateTime(QDate(1999, 1, 4), QTime(23,59,59,999));
+ case 8: return QDateTime(QDate(2000, 1, 1), QTime(0,0,0,0));
+ case 9: return QDateTime(QDate(2000, 1, 2), QTime(1,1,1,1));
+ case 10: return QDateTime(QDate(2000, 1, 3), QTime(12,0,0,0));
+ case 11: return QDateTime(QDate(2000, 1, 4), QTime(23,59,59,999));
+ case 12: return QDateTime(QDate(2000, 12, 31), QTime(0,0,0,0));
+ case 13: return QDateTime(QDate(2000, 12, 31), QTime(1,1,1,1));
+ case 14: return QDateTime(QDate(2000, 12, 31), QTime(12,0,0,0));
+ case 15: return QDateTime(QDate(2000, 12, 31), QTime(23,59,59,999));
}
return QDateTime(QDate(1900, 1, 1), QTime(0,0,0));
}
@@ -1343,83 +1332,82 @@ void tst_QDataStream::readQDateTime(QDataStream *s)
static QFont qFontData(int index)
{
- switch (index)
- {
- case 0: return QFont("Courier", 20, QFont::Bold, TRUE);
- case 1: return QFont("Courier", 18, QFont::Bold, FALSE);
- case 2: return QFont("Courier", 16, QFont::Light, TRUE);
- case 3: return QFont("Courier", 14, QFont::Normal, FALSE);
- case 4: return QFont("Courier", 12, QFont::DemiBold, TRUE);
- case 5: return QFont("Courier", 10, QFont::Black, FALSE);
- case 6:
- {
- QFont f("Helvetica", 10, QFont::Normal, FALSE);
- f.setPixelSize(2);
- f.setUnderline(FALSE);
- f.setStrikeOut(FALSE);
- f.setFixedPitch(FALSE);
- return f;
- }
- case 7:
- {
- QFont f("Helvetica", 10, QFont::Bold, FALSE);
- f.setPixelSize(4);
- f.setUnderline(TRUE);
- f.setStrikeOut(FALSE);
- f.setFixedPitch(FALSE);
- return f;
- }
- case 8:
- {
- QFont f("Helvetica", 10, QFont::Light, FALSE);
- f.setPixelSize(6);
- f.setUnderline(FALSE);
- f.setStrikeOut(TRUE);
- f.setFixedPitch(FALSE);
- return f;
- }
- case 9:
- {
- QFont f("Helvetica", 10, QFont::DemiBold, FALSE);
- f.setPixelSize(8);
- f.setUnderline(FALSE);
- f.setStrikeOut(FALSE);
- f.setFixedPitch(TRUE);
- return f;
- }
- case 10:
- {
- QFont f("Helvetica", 10, QFont::Black, FALSE);
- f.setPixelSize(10);
- f.setUnderline(TRUE);
- f.setStrikeOut(TRUE);
- f.setFixedPitch(FALSE);
- return f;
- }
- case 11:
- {
- QFont f("Helvetica", 10, QFont::Normal, TRUE);
- f.setPixelSize(12);
- f.setUnderline(FALSE);
- f.setStrikeOut(TRUE);
- f.setFixedPitch(TRUE);
- return f;
- }
- case 12:
- {
- QFont f("Helvetica", 10, QFont::Bold, TRUE);
- f.setPixelSize(14);
- f.setUnderline(TRUE);
- f.setStrikeOut(TRUE);
- f.setFixedPitch(TRUE);
- return f;
- }
- case 13:
- {
- QFont f("Helvetica", 10, QFont::Bold, TRUE);
- f.setStretch(200);
- return f;
- }
+ switch (index) {
+ case 0: return QFont("Courier", 20, QFont::Bold, TRUE);
+ case 1: return QFont("Courier", 18, QFont::Bold, FALSE);
+ case 2: return QFont("Courier", 16, QFont::Light, TRUE);
+ case 3: return QFont("Courier", 14, QFont::Normal, FALSE);
+ case 4: return QFont("Courier", 12, QFont::DemiBold, TRUE);
+ case 5: return QFont("Courier", 10, QFont::Black, FALSE);
+ case 6:
+ {
+ QFont f("Helvetica", 10, QFont::Normal, FALSE);
+ f.setPixelSize(2);
+ f.setUnderline(FALSE);
+ f.setStrikeOut(FALSE);
+ f.setFixedPitch(FALSE);
+ return f;
+ }
+ case 7:
+ {
+ QFont f("Helvetica", 10, QFont::Bold, FALSE);
+ f.setPixelSize(4);
+ f.setUnderline(TRUE);
+ f.setStrikeOut(FALSE);
+ f.setFixedPitch(FALSE);
+ return f;
+ }
+ case 8:
+ {
+ QFont f("Helvetica", 10, QFont::Light, FALSE);
+ f.setPixelSize(6);
+ f.setUnderline(FALSE);
+ f.setStrikeOut(TRUE);
+ f.setFixedPitch(FALSE);
+ return f;
+ }
+ case 9:
+ {
+ QFont f("Helvetica", 10, QFont::DemiBold, FALSE);
+ f.setPixelSize(8);
+ f.setUnderline(FALSE);
+ f.setStrikeOut(FALSE);
+ f.setFixedPitch(TRUE);
+ return f;
+ }
+ case 10:
+ {
+ QFont f("Helvetica", 10, QFont::Black, FALSE);
+ f.setPixelSize(10);
+ f.setUnderline(TRUE);
+ f.setStrikeOut(TRUE);
+ f.setFixedPitch(FALSE);
+ return f;
+ }
+ case 11:
+ {
+ QFont f("Helvetica", 10, QFont::Normal, TRUE);
+ f.setPixelSize(12);
+ f.setUnderline(FALSE);
+ f.setStrikeOut(TRUE);
+ f.setFixedPitch(TRUE);
+ return f;
+ }
+ case 12:
+ {
+ QFont f("Helvetica", 10, QFont::Bold, TRUE);
+ f.setPixelSize(14);
+ f.setUnderline(TRUE);
+ f.setStrikeOut(TRUE);
+ f.setFixedPitch(TRUE);
+ return f;
+ }
+ case 13:
+ {
+ QFont f("Helvetica", 10, QFont::Bold, TRUE);
+ f.setStretch(200);
+ return f;
+ }
}
return QFont("Courier", 18, QFont::Bold, TRUE);
}
@@ -1503,9 +1491,9 @@ void tst_QDataStream::readQImage(QDataStream *s)
// ### (Was like this in 1.44 as well)
//
// for(int i = 0; i < d12.height(); i++)
-// for(int j = 0; j < d12.width(); j++)
-// if (d12.pixel(j, i) != ref.pixel(j, i))
-// qDebug("Feil %i %i", j, i);
+// for(int j = 0; j < d12.width(); j++)
+// if (d12.pixel(j, i) != ref.pixel(j, i))
+// qDebug("Feil %i %i", j, i);
//
}
@@ -1513,56 +1501,63 @@ void tst_QDataStream::readQImage(QDataStream *s)
static QPen qPenData(int index)
{
- switch (index)
- {
- case 0: {
- QPen p(Qt::blue, 0, Qt::NoPen);
- p.setCapStyle(Qt::FlatCap);
- p.setJoinStyle(Qt::MiterJoin);
- return p;
- }
- case 1: {
- QPen p(Qt::red, 1, Qt::SolidLine);
- p.setCapStyle(Qt::SquareCap);
- p.setJoinStyle(Qt::BevelJoin);
- return p;
- }
- case 2: {
- QPen p(Qt::red, 4, Qt::DashDotDotLine);
- p.setCapStyle(Qt::RoundCap);
- p.setJoinStyle(Qt::RoundJoin);
- return p;
- }
- case 3: {
- QPen p(Qt::blue, 12, Qt::NoPen);
- p.setCapStyle(Qt::FlatCap);
- p.setJoinStyle(Qt::RoundJoin);
- return p;
- }
- case 4: {
- QPen p(Qt::red, 99, Qt::SolidLine);
- p.setCapStyle(Qt::SquareCap);
- p.setJoinStyle(Qt::MiterJoin);
- return p;
- }
- case 5: {
- QPen p(Qt::red, 255, Qt::DashDotLine);
- p.setCapStyle(Qt::RoundCap);
- p.setJoinStyle(Qt::BevelJoin);
- return p;
- }
- case 6: {
- QPen p(Qt::red, 256, Qt::DashDotLine);
- p.setCapStyle(Qt::RoundCap);
- p.setJoinStyle(Qt::BevelJoin);
- return p;
- }
- case 7: {
- QPen p(Qt::red, 0.25, Qt::DashDotLine);
- p.setCapStyle(Qt::RoundCap);
- p.setJoinStyle(Qt::BevelJoin);
- return p;
- }
+ switch (index) {
+ case 0:
+ {
+ QPen p(Qt::blue, 0, Qt::NoPen);
+ p.setCapStyle(Qt::FlatCap);
+ p.setJoinStyle(Qt::MiterJoin);
+ return p;
+ }
+ case 1:
+ {
+ QPen p(Qt::red, 1, Qt::SolidLine);
+ p.setCapStyle(Qt::SquareCap);
+ p.setJoinStyle(Qt::BevelJoin);
+ return p;
+ }
+ case 2:
+ {
+ QPen p(Qt::red, 4, Qt::DashDotDotLine);
+ p.setCapStyle(Qt::RoundCap);
+ p.setJoinStyle(Qt::RoundJoin);
+ return p;
+ }
+ case 3:
+ {
+ QPen p(Qt::blue, 12, Qt::NoPen);
+ p.setCapStyle(Qt::FlatCap);
+ p.setJoinStyle(Qt::RoundJoin);
+ return p;
+ }
+ case 4:
+ {
+ QPen p(Qt::red, 99, Qt::SolidLine);
+ p.setCapStyle(Qt::SquareCap);
+ p.setJoinStyle(Qt::MiterJoin);
+ return p;
+ }
+ case 5:
+ {
+ QPen p(Qt::red, 255, Qt::DashDotLine);
+ p.setCapStyle(Qt::RoundCap);
+ p.setJoinStyle(Qt::BevelJoin);
+ return p;
+ }
+ case 6:
+ {
+ QPen p(Qt::red, 256, Qt::DashDotLine);
+ p.setCapStyle(Qt::RoundCap);
+ p.setJoinStyle(Qt::BevelJoin);
+ return p;
+ }
+ case 7:
+ {
+ QPen p(Qt::red, 0.25, Qt::DashDotLine);
+ p.setCapStyle(Qt::RoundCap);
+ p.setJoinStyle(Qt::BevelJoin);
+ return p;
+ }
}
return QPen();
@@ -1678,19 +1673,18 @@ void tst_QDataStream::readQIcon(QDataStream *s)
QPoint qPointData(int index)
{
- switch (index)
- {
- case 0: return QPoint(0, 0);
- case 1: return QPoint(-1, 0);
- case 2: return QPoint(0, -1);
- case 3: return QPoint(1, 0);
- case 4: return QPoint(0, 1);
- case 5: return QPoint(-1, -1);
- case 6: return QPoint(1, 1);
- case 7: return QPoint(255, 255);
- case 8: return QPoint(256, 256);
- case 9: return QPoint(-254, -254);
- case 10: return QPoint(-255, -255);
+ switch (index) {
+ case 0: return QPoint(0, 0);
+ case 1: return QPoint(-1, 0);
+ case 2: return QPoint(0, -1);
+ case 3: return QPoint(1, 0);
+ case 4: return QPoint(0, 1);
+ case 5: return QPoint(-1, -1);
+ case 6: return QPoint(1, 1);
+ case 7: return QPoint(255, 255);
+ case 8: return QPoint(256, 256);
+ case 9: return QPoint(-254, -254);
+ case 10: return QPoint(-255, -255);
}
return QPoint();
@@ -1733,19 +1727,18 @@ void tst_QDataStream::readQPoint(QDataStream *s)
static QRect qRectData(int index)
{
- switch (index)
- {
- case 0: return QRect(0, 0, 0, 0);
- case 1: return QRect(1, 1, 1, 1);
- case 2: return QRect(1, 2, 3, 4);
- case 3: return QRect(-1, -1, -1, -1);
- case 4: return QRect(-1, -2, -3, -4);
- case 5: return QRect(255, -5, 256, -6);
- case 6: return QRect(-7, 255, -8, 256);
- case 7: return QRect(9, -255, 10, -255);
- case 8: return QRect(-255, 11, -255, 12);
- case 9: return QRect(256, 512, 1024, 2048);
- case 10: return QRect(-256, -512, -1024, -2048);
+ switch (index) {
+ case 0: return QRect(0, 0, 0, 0);
+ case 1: return QRect(1, 1, 1, 1);
+ case 2: return QRect(1, 2, 3, 4);
+ case 3: return QRect(-1, -1, -1, -1);
+ case 4: return QRect(-1, -2, -3, -4);
+ case 5: return QRect(255, -5, 256, -6);
+ case 6: return QRect(-7, 255, -8, 256);
+ case 7: return QRect(9, -255, 10, -255);
+ case 8: return QRect(-255, 11, -255, 12);
+ case 9: return QRect(256, 512, 1024, 2048);
+ case 10: return QRect(-256, -512, -1024, -2048);
}
return QRect();
}
@@ -1802,57 +1795,63 @@ static QPolygon qPolygonData(int index)
QPoint p13(-99998, -34567);
QPoint p14(45678, -99999);
- switch (index)
- {
- case 0: return QPolygon(0);
- case 1: {
- QPolygon p(1);
- p.setPoint(0, p0);
- return p;
- }
- case 2: {
- QPolygon p(1);
- p.setPoint(0, p5);
- return p;
- }
- case 3: {
- QPolygon p(1);
- p.setPoint(0, p12);
- return p;
- }
- case 4: {
- QPolygon p(3);
- p.setPoint(0, p1);
- p.setPoint(1, p10);
- p.setPoint(2, p13);
- return p;
- }
- case 5: {
- QPolygon p(6);
- p.setPoint(0, p2);
- p.setPoint(1, p11);
- p.setPoint(2, p14);
- return p;
- }
- case 6: {
- QPolygon p(15);
- p.setPoint(0, p0);
- p.setPoint(1, p1);
- p.setPoint(2, p2);
- p.setPoint(3, p3);
- p.setPoint(4, p4);
- p.setPoint(5, p5);
- p.setPoint(6, p6);
- p.setPoint(7, p7);
- p.setPoint(8, p8);
- p.setPoint(9, p9);
- p.setPoint(10, p10);
- p.setPoint(11, p11);
- p.setPoint(12, p12);
- p.setPoint(13, p13);
- p.setPoint(14, p14);
- return p;
- }
+ switch (index) {
+ case 0:
+ return QPolygon(0);
+ case 1:
+ {
+ QPolygon p(1);
+ p.setPoint(0, p0);
+ return p;
+ }
+ case 2:
+ {
+ QPolygon p(1);
+ p.setPoint(0, p5);
+ return p;
+ }
+ case 3:
+ {
+ QPolygon p(1);
+ p.setPoint(0, p12);
+ return p;
+ }
+ case 4:
+ {
+ QPolygon p(3);
+ p.setPoint(0, p1);
+ p.setPoint(1, p10);
+ p.setPoint(2, p13);
+ return p;
+ }
+ case 5:
+ {
+ QPolygon p(6);
+ p.setPoint(0, p2);
+ p.setPoint(1, p11);
+ p.setPoint(2, p14);
+ return p;
+ }
+ case 6:
+ {
+ QPolygon p(15);
+ p.setPoint(0, p0);
+ p.setPoint(1, p1);
+ p.setPoint(2, p2);
+ p.setPoint(3, p3);
+ p.setPoint(4, p4);
+ p.setPoint(5, p5);
+ p.setPoint(6, p6);
+ p.setPoint(7, p7);
+ p.setPoint(8, p8);
+ p.setPoint(9, p9);
+ p.setPoint(10, p10);
+ p.setPoint(11, p11);
+ p.setPoint(12, p12);
+ p.setPoint(13, p13);
+ p.setPoint(14, p14);
+ return p;
+ }
}
return QRect();
}
@@ -1893,32 +1892,32 @@ void tst_QDataStream::readQPolygon(QDataStream *s)
static QRegion qRegionData(int index)
{
- switch (index)
- {
- case 0: return QRegion(0, 0, 0, 0, QRegion::Rectangle);
- case 1: {
- QRegion r(1, 2, 300, 400, QRegion::Rectangle);
- if (r != QRegion(1, 2, 300, 400, QRegion::Rectangle))
- qDebug("Error creating a region");
- return r;
- }
- case 2: return QRegion(100, 100, 1024, 768, QRegion::Rectangle);
- case 3: return QRegion(-100, -100, 1024, 1024, QRegion::Rectangle);
- case 4: return QRegion(100, -100, 2048, 4096, QRegion::Rectangle);
- case 5: return QRegion(-100, 100, 4096, 2048, QRegion::Rectangle);
- case 6: return QRegion(0, 0, 0, 0, QRegion::Ellipse);
+ switch (index) {
+ case 0: return QRegion(0, 0, 0, 0, QRegion::Rectangle);
+ case 1:
+ {
+ QRegion r(1, 2, 300, 400, QRegion::Rectangle);
+ if (r != QRegion(1, 2, 300, 400, QRegion::Rectangle))
+ qDebug("Error creating a region");
+ return r;
+ }
+ case 2: return QRegion(100, 100, 1024, 768, QRegion::Rectangle);
+ case 3: return QRegion(-100, -100, 1024, 1024, QRegion::Rectangle);
+ case 4: return QRegion(100, -100, 2048, 4096, QRegion::Rectangle);
+ case 5: return QRegion(-100, 100, 4096, 2048, QRegion::Rectangle);
+ case 6: return QRegion(0, 0, 0, 0, QRegion::Ellipse);
#if defined(Q_OS_SYMBIAN) || (!defined(Q_OS_UNIX) && !defined(Q_OS_WINCE)) // all our Unix platforms use X regions.
- case 7: return QRegion(1, 2, 300, 400, QRegion::Ellipse);
- case 8: return QRegion(100, 100, 1024, 768, QRegion::Ellipse);
- case 9: return QRegion(-100, -100, 1024, 1024, QRegion::Ellipse);
- case 10: return QRegion(100, -100, 2048, 4096, QRegion::Ellipse);
- case 11: return QRegion(-100, 100, 4096, 2048, QRegion::Ellipse);
- // simplest X11 case that fails:
- case 12: return QRegion(0, 0, 3, 3, QRegion::Ellipse);
+ case 7: return QRegion(1, 2, 300, 400, QRegion::Ellipse);
+ case 8: return QRegion(100, 100, 1024, 768, QRegion::Ellipse);
+ case 9: return QRegion(-100, -100, 1024, 1024, QRegion::Ellipse);
+ case 10: return QRegion(100, -100, 2048, 4096, QRegion::Ellipse);
+ case 11: return QRegion(-100, 100, 4096, 2048, QRegion::Ellipse);
+ // simplest X11 case that fails:
+ case 12: return QRegion(0, 0, 3, 3, QRegion::Ellipse);
#else
- case 7:
- qWarning("Skipping streaming of elliptical regions on embedded, Mac OS X, and X11;"
- " our pointarray stuff is not that great at approximating.");
+ case 7:
+ qWarning("Skipping streaming of elliptical regions on embedded, Mac OS X, and X11;"
+ " our pointarray stuff is not that great at approximating.");
#endif
}
return QRegion();
@@ -1953,19 +1952,18 @@ void tst_QDataStream::readQRegion(QDataStream *s)
static QSize qSizeData(int index)
{
- switch (index)
- {
- case 0: return QSize(0, 0);
- case 1: return QSize(-1, 0);
- case 2: return QSize(0, -1);
- case 3: return QSize(1, 0);
- case 4: return QSize(0, 1);
- case 5: return QSize(-1, -1);
- case 6: return QSize(1, 1);
- case 7: return QSize(255, 255);
- case 8: return QSize(256, 256);
- case 9: return QSize(-254, -254);
- case 10: return QSize(-255, -255);
+ switch (index) {
+ case 0: return QSize(0, 0);
+ case 1: return QSize(-1, 0);
+ case 2: return QSize(0, -1);
+ case 3: return QSize(1, 0);
+ case 4: return QSize(0, 1);
+ case 5: return QSize(-1, -1);
+ case 6: return QSize(1, 1);
+ case 7: return QSize(255, 255);
+ case 8: return QSize(256, 256);
+ case 9: return QSize(-254, -254);
+ case 10: return QSize(-255, -255);
}
return QSize();
}
@@ -2013,60 +2011,60 @@ void tst_QDataStream::stream_atEnd()
{
QFETCH(QString, device);
if (device == "bytearray") {
- QByteArray ba;
- QDataStream sout(&ba, QIODevice::WriteOnly);
- writeQString(&sout);
+ QByteArray ba;
+ QDataStream sout(&ba, QIODevice::WriteOnly);
+ writeQString(&sout);
- QDataStream sin(&ba, QIODevice::ReadOnly);
- readQString(&sin);
- QVERIFY(sin.atEnd());
+ QDataStream sin(&ba, QIODevice::ReadOnly);
+ readQString(&sin);
+ QVERIFY(sin.atEnd());
} else if (device == "file") {
- QString fileName = "qdatastream.out";
- QFile fOut(fileName);
- QVERIFY(fOut.open(QIODevice::WriteOnly));
- QDataStream sout(&fOut);
- writeQString(&sout);
- fOut.close();
-
- QFile fIn(fileName);
- QVERIFY(fIn.open(QIODevice::ReadOnly));
- QDataStream sin(&fIn);
- readQString(&sin);
- QVERIFY(sin.atEnd());
- fIn.close();
+ QString fileName = "qdatastream.out";
+ QFile fOut(fileName);
+ QVERIFY(fOut.open(QIODevice::WriteOnly));
+ QDataStream sout(&fOut);
+ writeQString(&sout);
+ fOut.close();
+
+ QFile fIn(fileName);
+ QVERIFY(fIn.open(QIODevice::ReadOnly));
+ QDataStream sin(&fIn);
+ readQString(&sin);
+ QVERIFY(sin.atEnd());
+ fIn.close();
} else if (device == "buffer") {
- {
- QByteArray ba(0);
- QBuffer bOut(&ba);
- bOut.open(QIODevice::WriteOnly);
- QDataStream sout(&bOut);
- writeQString(&sout);
- bOut.close();
-
- QBuffer bIn(&ba);
- bIn.open(QIODevice::ReadOnly);
- QDataStream sin(&bIn);
- readQString(&sin);
- QVERIFY(sin.atEnd());
- bIn.close();
- }
-
- // Do the same test again, but this time with an initial size for the bytearray.
- {
+ {
+ QByteArray ba(0);
+ QBuffer bOut(&ba);
+ bOut.open(QIODevice::WriteOnly);
+ QDataStream sout(&bOut);
+ writeQString(&sout);
+ bOut.close();
+
+ QBuffer bIn(&ba);
+ bIn.open(QIODevice::ReadOnly);
+ QDataStream sin(&bIn);
+ readQString(&sin);
+ QVERIFY(sin.atEnd());
+ bIn.close();
+ }
+
+ // Do the same test again, but this time with an initial size for the bytearray.
+ {
QByteArray ba(10000, '\0');
- QBuffer bOut(&ba);
- bOut.open(QIODevice::WriteOnly | QIODevice::Truncate);
- QDataStream sout(&bOut);
- writeQString(&sout);
- bOut.close();
-
- QBuffer bIn(&ba);
- bIn.open(QIODevice::ReadOnly);
- QDataStream sin(&bIn);
- readQString(&sin);
- QVERIFY(sin.atEnd());
- bIn.close();
- }
+ QBuffer bOut(&ba);
+ bOut.open(QIODevice::WriteOnly | QIODevice::Truncate);
+ QDataStream sout(&bOut);
+ writeQString(&sout);
+ bOut.close();
+
+ QBuffer bIn(&ba);
+ bIn.open(QIODevice::ReadOnly);
+ QDataStream sin(&bIn);
+ readQString(&sin);
+ QVERIFY(sin.atEnd());
+ bIn.close();
+ }
}
}
@@ -2152,8 +2150,6 @@ void tst_QDataStream::setVersion_data()
for (int vers = 1; vers <= latest.version(); ++vers)
QTest::newRow(qPrintable(QString("v_%1").arg(vers))) << vers;
-
-
}
void tst_QDataStream::setVersion()
@@ -2161,8 +2157,8 @@ void tst_QDataStream::setVersion()
QDataStream latest;
QFETCH(int, vers);
- /*
- Test QKeySequence.
+ /*
+ Test QKeySequence.
*/
QByteArray ba1;
{
@@ -2186,12 +2182,11 @@ void tst_QDataStream::setVersion()
QVERIFY(deadbeef == 0xDEADBEEF);
}
- /*
- Test QPalette.
+ /*
+ Test QPalette.
*/
-
- // revise the test if new color roles or color groups are added
+ // revise the test if new color roles or color groups are added
QVERIFY(QPalette::NColorRoles == QPalette::ToolTipText + 1);
QVERIFY(QPalette::NColorGroups == 3);
@@ -2199,7 +2194,7 @@ void tst_QDataStream::setVersion()
QPalette pal1, pal2;
for (int grp = 0; grp < (int)QPalette::NColorGroups; ++grp) {
for (int role = 0; role < (int)QPalette::NColorRoles; ++role) {
- // random stuff
+ // random stuff
pal1.setColor((QPalette::ColorGroup)grp, (QPalette::ColorRole)role,
QColor(grp * 13, 255 - grp, role));
pal2.setColor((QPalette::ColorGroup)grp, (QPalette::ColorRole)role,
diff --git a/tests/auto/qmenubar/tst_qmenubar.cpp b/tests/auto/qmenubar/tst_qmenubar.cpp
index 6e12d7b7dc..ab5dba5000 100644
--- a/tests/auto/qmenubar/tst_qmenubar.cpp
+++ b/tests/auto/qmenubar/tst_qmenubar.cpp
@@ -44,9 +44,6 @@
#include <qapplication.h>
#include <qmainwindow.h>
#include <qmenubar.h>
-#ifdef QT3_SUPPORT
-#include <q3popupmenu.h>
-#endif
#include <qstyle.h>
#include <qwindowsstyle.h>
#include <qdesktopwidget.h>
@@ -105,14 +102,7 @@ public:
tst_QMenuBar();
virtual ~tst_QMenuBar();
-#ifdef QT3_SUPPORT
- void initSimpleMenubar();
-#endif
void initSimpleMenubar_noQt3();
-
-#ifdef QT3_SUPPORT
- void initComplexMenubar();
-#endif
void initComplexMenubar_noQt3();
public slots:
@@ -132,17 +122,6 @@ private slots:
void accel_noQt3();
void activatedCount_noQt3();
void allowActiveAndDisabled();
-#ifdef QT3_SUPPORT
- void clear();
- void removeItemAt_data();
- void removeItemAt();
- void removeItem_data();
- void removeItem();
- void count();
- void insertItem_QString_QObject();
- void accel();
- void activatedCount();
-#endif
void check_accelKeys();
void check_cursorKeys1();
@@ -151,9 +130,6 @@ private slots:
void check_homeKey();
void check_endKey();
-#ifdef QT3_SUPPORT
- void check_escKey();
-#endif
void check_escKey_noQt3();
// void check_mouse1_data();
@@ -170,19 +146,10 @@ private slots:
void taskQTBUG4965_escapeEaten();
void taskQTBUG11823_crashwithInvisibleActions();
-#if defined(QT3_SUPPORT)
- void indexBasedInsertion_data();
- void indexBasedInsertion();
-#endif
-
protected slots:
-#ifdef QT3_SUPPORT
- void onActivated( int );
-#endif
void onActivated_noQt3( QAction*);
private:
-
void initTestCase_noQt3();
QtTestSlot *menu1;
@@ -204,24 +171,13 @@ private:
void reset() { resetSlots(); resetCount(); };
-#ifdef QT3_SUPPORT
- int last_accel_id;
-#endif
QAction* last_accel_id_Qt4;
int activated_count;
-#ifdef QT3_SUPPORT
- int idAccel;
- int idAccel1;
-#endif
QAction *action;
QAction *action1;
QMainWindow *mw;
QMenuBar *mb;
-#ifdef QT3_SUPPORT
- Q3PopupMenu *pm1;
- Q3PopupMenu *pm2;
-#endif
QMenu *pm1_Qt4;
QMenu *pm2_Qt4;
};
@@ -240,10 +196,6 @@ void tst_QMenuBar::getSetCheck()
delete var1;
}
-////
-
-
-
#include <qcursor.h>
const int RESET = 0;
@@ -278,11 +230,6 @@ tst_QMenuBar::tst_QMenuBar()
activated_count = 0;
mb = 0;
-#ifdef QT3_SUPPORT
- pm1 = 0;
- pm2 = 0;
- last_accel_id = RESET;
-#endif
pm1_Qt4 = 0;
pm2_Qt4 = 0;
last_accel_id_Qt4 = 0;
@@ -296,35 +243,7 @@ tst_QMenuBar::~tst_QMenuBar()
void tst_QMenuBar::initTestCase()
{
-#ifdef QT3_SUPPORT
- // create a default mainwindow
- // If you run a widget test, this will be replaced in the testcase by the
- // widget under test
- mw = new QMainWindow(0, Qt::X11BypassWindowManagerHint);
- mb = new QMenuBar( mw, "menubar" );
- connect( mb, SIGNAL(activated(int)), this, SLOT(onActivated(int)) );
-
- initSimpleMenubar();
-
- qApp->setMainWidget( mw );
- mw->show();
- qApp->setActiveWindow(mw);
-
- menu1 = new QtTestSlot( mw );
- menu2 = new QtTestSlot( mw );
- menu3 = new QtTestSlot( mw );
- menu4 = new QtTestSlot( mw );
- item1_A = new QtTestSlot( mw );
- item1_B = new QtTestSlot( mw );
- item2_C = new QtTestSlot( mw );
- item2_D = new QtTestSlot( mw );
- item2_E = new QtTestSlot( mw );
- item2_F = new QtTestSlot( mw );
- item2_G = new QtTestSlot( mw );
- item2_H = new QtTestSlot( mw );
-#else
initTestCase_noQt3();
-#endif
}
void tst_QMenuBar::initTestCase_noQt3()
@@ -361,33 +280,6 @@ void tst_QMenuBar::cleanupTestCase()
delete mw;
}
-#if defined(QT3_SUPPORT)
-void tst_QMenuBar::initSimpleMenubar()
-{
- mb->hide();
- mb->clear();
-
- delete pm1;
- pm1 = new Q3PopupMenu( mb );
- idAccel = pm1->insertItem( "menu1", 123 );
-// pm->setAccel( ALT + Key_A, idAccel );
- pm1->setAccel( Qt::CTRL + Qt::Key_A, idAccel );
- mb->insertItem( "&accel", pm1 );
- connect( pm1, SIGNAL(activated(int)), this, SLOT(onActivated(int)));
-
- delete pm2;
- pm2 = new Q3PopupMenu( mb );
-// idAccel1 = pm2->insertItem( "&Open...", this, SLOT(onActivated(int)), Qt::Key_O, 456 );
- idAccel1 = pm2->insertItem( "&Open...", 0, 0, Qt::Key_O, 456 );
- connect(pm2, SIGNAL(activated(int)), this, SLOT(onActivated(int)));
- mb->insertItem( "accel1", pm2 );
-
- mb->show();
- qApp->syncX();
- qApp->processEvents();
-}
-#endif
-
void tst_QMenuBar::initSimpleMenubar_noQt3()
{
mb->hide();
@@ -438,22 +330,10 @@ void tst_QMenuBar::resetSlots()
void tst_QMenuBar::resetCount()
{
-#ifdef QT3_SUPPORT
- last_accel_id = RESET;
-#endif
last_accel_id_Qt4 = 0;
activated_count = 0;
}
-#ifdef QT3_SUPPORT
-void tst_QMenuBar::onActivated( int i )
-{
- last_accel_id = i;
- activated_count++;
-// printf( QString("acceleratorId: %1, count: %1\n").arg( i ).arg(activated_count) );
-}
-#endif
-
void tst_QMenuBar::onActivated_noQt3( QAction* action )
{
last_accel_id_Qt4 = action;
@@ -461,22 +341,6 @@ void tst_QMenuBar::onActivated_noQt3( QAction* action )
// printf( QString("acceleratorId: %1, count: %1\n").arg( i ).arg(activated_count) );
}
-#ifdef QT3_SUPPORT
-void tst_QMenuBar::accel()
-{
-#ifdef Q_WS_MAC
- QSKIP("On Mac, native key events are needed to test menu action activation", SkipAll);
-#endif
- // create a popup menu with menu items set the accelerators later...
- initSimpleMenubar();
-// QTest::keyClick( 0, Qt::Key_A, AltKey );
- QTest::keyClick( 0, Qt::Key_A, Qt::ControlModifier );
- QTest::qWait(300);
-
- QCOMPARE( last_accel_id, idAccel );
-}
-#endif //QT3_SUPPORT
-
void tst_QMenuBar::accel_noQt3()
{
#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
@@ -495,21 +359,6 @@ void tst_QMenuBar::accel_noQt3()
QCOMPARE( last_accel_id_Qt4, action );
}
-#ifdef QT3_SUPPORT
-void tst_QMenuBar::activatedCount()
-{
-#ifdef Q_WS_MAC
- QSKIP("On Mac, native key events are needed to test menu action activation", SkipAll);
-#endif
- // create a popup menu with menu items set the accelerators later...
- initSimpleMenubar();
-
- QTest::keyClick( 0, Qt::Key_A, Qt::ControlModifier );
-//wait(5000);
- QCOMPARE( activated_count, 2 ); //1 from the popupmenu and 1 from the menubar
-}
-#endif //QT3_SUPPORT
-
void tst_QMenuBar::activatedCount_noQt3()
{
#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
@@ -680,183 +529,6 @@ void tst_QMenuBar::removeItemAt_noQt3()
QVERIFY( menuBarActions2.size() == 2 );
}
-#ifdef QT3_SUPPORT
-void tst_QMenuBar::clear()
-{
- mb->clear();
- QVERIFY( mb->count() == 0 );
-
- mb->clear();
- for (uint i=0; i<10; i++) {
- Q3PopupMenu *pm = new Q3PopupMenu( mb );
- for (uint k=0; k<i; k++)
- pm->insertItem( QString("Item %1").arg(i*10 + k) );
- mb->insertItem( QString("Menu %1").arg(i), pm );
- QCOMPARE( mb->count(), (uint)i+1 );
- }
- QCOMPARE( mb->count(), 10u );
-
- mb->clear();
- QVERIFY( mb->count() == 0 );
-}
-
-void tst_QMenuBar::count()
-{
- mb->clear();
- QVERIFY( mb->count() == 0 );
-
- for (uint i=0; i<10; i++) {
- Q3PopupMenu *pm = new Q3PopupMenu( mb );
- mb->insertItem( QString("Menu %1").arg(i), pm );
- QCOMPARE( mb->count(), i+1 );
- }
-}
-
-void tst_QMenuBar::removeItemAt_data()
-{
- QTest::addColumn<int>("removeIndex");
- QTest::newRow( "first" ) << 0;
- QTest::newRow( "middle" ) << 1;
- QTest::newRow( "last" ) << 2;
-}
-
-void tst_QMenuBar::removeItemAt()
-{
- mb->clear();
-
- Q3PopupMenu *pm;
- pm = new Q3PopupMenu( mb );
- pm->insertItem( QString("Item 10") );
- mb->insertItem( QString("Menu 1"), pm );
-
- pm = new Q3PopupMenu( mb );
- pm->insertItem( QString("Item 20") );
- pm->insertItem( QString("Item 21") );
- mb->insertItem( QString("Menu 2"), pm );
-
- pm = new Q3PopupMenu( mb );
- pm->insertItem( QString("Item 30") );
- pm->insertItem( QString("Item 31") );
- pm->insertItem( QString("Item 32") );
- mb->insertItem( QString("Menu 3"), pm );
-
- QCOMPARE( mb->text( mb->idAt(0) ), QString("Menu 1") );
- QCOMPARE( mb->text( mb->idAt(1) ), QString("Menu 2") );
- QCOMPARE( mb->text( mb->idAt(2) ), QString("Menu 3") );
-
- // Ok, now that we know we have created the menu we expect, lets remove an item...
- QFETCH( int, removeIndex );
- mb->removeItemAt( removeIndex );
- switch (removeIndex )
- {
- case 0:
- QCOMPARE( mb->text( mb->idAt(0) ), QString("Menu 2") );
- QCOMPARE( mb->text( mb->idAt(1) ), QString("Menu 3") );
- break;
- case 1:
- QCOMPARE( mb->text( mb->idAt(0) ), QString("Menu 1") );
- QCOMPARE( mb->text( mb->idAt(1) ), QString("Menu 3") );
- break;
- case 2:
- QCOMPARE( mb->text( mb->idAt(0) ), QString("Menu 1") );
- QCOMPARE( mb->text( mb->idAt(1) ), QString("Menu 2") );
- break;
- }
-
- QVERIFY( mb->count() == 2 );
-}
-
-void tst_QMenuBar::removeItem_data()
-{
- QTest::addColumn<int>("removeIndex");
- QTest::newRow( "first" ) << 0;
- QTest::newRow( "middle" ) << 1;
- QTest::newRow( "last" ) << 2;
-}
-
-// Basically the same test as removeItemAt, except that we remember and remove id's.
-void tst_QMenuBar::removeItem()
-{
- mb->clear();
-
- Q3PopupMenu *pm;
- pm = new Q3PopupMenu( mb );
- pm->insertItem( QString("Item 10") );
- int id1 = mb->insertItem( QString("Menu 1"), pm );
-
- pm = new Q3PopupMenu( mb );
- pm->insertItem( QString("Item 20") );
- pm->insertItem( QString("Item 21") );
- int id2 = mb->insertItem( QString("Menu 2"), pm );
-
- pm = new Q3PopupMenu( mb );
- pm->insertItem( QString("Item 30") );
- pm->insertItem( QString("Item 31") );
- pm->insertItem( QString("Item 32") );
- int id3 = mb->insertItem( QString("Menu 3"), pm );
-
- QCOMPARE( mb->text( id1 ), QString("Menu 1") );
- QCOMPARE( mb->text( id2 ), QString("Menu 2") );
- QCOMPARE( mb->text( id3 ), QString("Menu 3") );
-
- QVERIFY( mb->idAt(0) == id1 );
- QVERIFY( mb->idAt(1) == id2 );
- QVERIFY( mb->idAt(2) == id3 );
-
- // Ok, now that we know we have created the menu we expect, lets remove an item...
- QFETCH( int, removeIndex );
- switch (removeIndex )
- {
- case 0:
- mb->removeItem( id1 );
- QCOMPARE( mb->text( mb->idAt(0) ), QString("Menu 2") );
- QCOMPARE( mb->text( mb->idAt(1) ), QString("Menu 3") );
- break;
- case 1:
- mb->removeItem( id2 );
- QCOMPARE( mb->text( mb->idAt(0) ), QString("Menu 1") );
- QCOMPARE( mb->text( mb->idAt(1) ), QString("Menu 3") );
- break;
- case 2:
- mb->removeItem( id3 );
- QCOMPARE( mb->text( mb->idAt(0) ), QString("Menu 1") );
- QCOMPARE( mb->text( mb->idAt(1) ), QString("Menu 2") );
- break;
- }
-
- QVERIFY( mb->count() == 2 );
-}
-
-void tst_QMenuBar::initComplexMenubar() // well, complex....
-{
- mb->hide();
- mb->clear();
-
- delete pm1;
- pm1 = new Q3PopupMenu( mb, "popup1" );
- pm1->insertItem( QString("Item A"), item1_A, SLOT(selected()), Qt::CTRL+Qt::Key_A );
- pm1->insertItem( QString("Item B"), item1_B, SLOT(selected()), Qt::CTRL+Qt::Key_B );
- // use the form insertItem( QString, Q3PopupMenu )
- mb->insertItem( "Menu &1", pm1 );
-
- delete pm2;
- pm2 = new Q3PopupMenu( mb, "popup2" );
- pm2->insertItem( QString("Item C"), item2_C, SLOT(selected()), Qt::CTRL+Qt::Key_C );
- pm2->insertItem( QString("Item D"), item2_D, SLOT(selected()), Qt::CTRL+Qt::Key_D );
- pm2->insertItem( QString("Item E"), item2_E, SLOT(selected()), Qt::CTRL+Qt::Key_E );
- pm2->insertItem( QString("Item F"), item2_F, SLOT(selected()), Qt::CTRL+Qt::Key_F );
- pm2->insertSeparator();
- pm2->insertItem( QString("Item G"), item2_G, SLOT(selected()), Qt::CTRL+Qt::Key_G );
- pm2->insertItem( QString("Item H"), item2_H, SLOT(selected()), Qt::CTRL+Qt::Key_H );
- // use the form insertItem( QString, Q3PopupMenu )
- mb->insertItem( "Menu &2", pm2 );
-
- // use the form insertItem( QString, QObject, slot, keysequence )
- mb->insertItem( QString("M&enu 3"), menu3, SLOT(selected()), Qt::ALT+Qt::Key_J );
- mb->show();
-}
-#endif
-
void tst_QMenuBar::initComplexMenubar_noQt3() // well, complex....
{
mb->hide();
@@ -889,17 +561,6 @@ void tst_QMenuBar::initComplexMenubar_noQt3() // well, complex....
used less frequently.
*/
-#ifdef QT3_SUPPORT
-void tst_QMenuBar::insertItem_QString_QObject()
-{
- initComplexMenubar();
- QCOMPARE( mb->text( mb->idAt( 0 ) ), QString("Menu &1") );
- QCOMPARE( mb->text( mb->idAt( 1 ) ), QString("Menu &2") );
- QCOMPARE( mb->text( mb->idAt( 2 ) ), QString("M&enu 3") );
- QCOMPARE( mb->text( mb->idAt( 3 ) ), QString() ); // there is no menu 4!
-}
-#endif
-
void tst_QMenuBar::insertItem_QString_QObject_noQt3()
{
initComplexMenubar_noQt3();
@@ -917,11 +578,7 @@ void tst_QMenuBar::check_accelKeys()
#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
QSKIP("On Mac/WinCE, native key events are needed to test menu action activation", SkipAll);
#endif
-#ifdef QT3_SUPPORT
- initComplexMenubar();
-#else
initComplexMenubar_noQt3();
-#endif
// start with a bogus key that shouldn't trigger anything
QTest::keyClick(0, Qt::Key_I, Qt::ControlModifier);
@@ -991,11 +648,7 @@ void tst_QMenuBar::check_cursorKeys1()
QSKIP("Qt/Mac,WinCE does not use the native popups/menubar", SkipAll);
#endif
-#ifdef QT3_SUPPORT
- initComplexMenubar();
-#else
initComplexMenubar_noQt3();
-#endif
// start with a ALT + 1 that activates the first popupmenu
QTest::keyClick( 0, Qt::Key_1, Qt::AltModifier );
@@ -1026,11 +679,7 @@ void tst_QMenuBar::check_cursorKeys2()
QSKIP("Qt/Mac,WinCE does not use the native popups/menubar", SkipAll);
#endif
-#ifdef QT3_SUPPORT
- initComplexMenubar();
-#else
initComplexMenubar_noQt3();
-#endif
// select popupmenu2
QTest::keyClick( 0, Qt::Key_2, Qt::AltModifier );
@@ -1060,11 +709,7 @@ void tst_QMenuBar::check_cursorKeys3()
QSKIP("Qt/Mac,WinCE does not use the native popups/menubar", SkipAll);
#endif
-#ifdef QT3_SUPPORT
- initComplexMenubar();
-#else
initComplexMenubar_noQt3();
-#endif
// select Popupmenu 2
QTest::keyClick( 0, Qt::Key_2, Qt::AltModifier );
@@ -1095,11 +740,7 @@ void tst_QMenuBar::check_homeKey()
QEXPECT_FAIL( "0", "Popupmenu should respond to a Home key", Abort );
-#ifdef QT3_SUPPORT
- initComplexMenubar();
-#else
initComplexMenubar_noQt3();
-#endif
// select Popupmenu 2
QTest::keyClick( 0, Qt::Key_2, Qt::AltModifier );
@@ -1137,11 +778,7 @@ void tst_QMenuBar::check_endKey()
QEXPECT_FAIL( "0", "Popupmenu should respond to an End key", Abort );
-#ifdef QT3_SUPPORT
- initComplexMenubar();
-#else
initComplexMenubar_noQt3();
-#endif
// select Popupmenu 2
QTest::keyClick( 0, Qt::Key_2, Qt::AltModifier );
@@ -1170,46 +807,6 @@ void tst_QMenuBar::check_endKey()
If Down is pressed next the popup is activated again.
*/
-#ifdef QT3_SUPPORT
-void tst_QMenuBar::check_escKey()
-{
-#ifdef Q_WS_MAC
- QSKIP("Qt/Mac does not use the native popups/menubar", SkipAll);
-#endif
-
- initComplexMenubar();
-
- QVERIFY( !pm1->isActiveWindow() );
- QVERIFY( !pm2->isActiveWindow() );
-
- // select Popupmenu 2
- QTest::keyClick( 0, Qt::Key_2, Qt::AltModifier );
- QVERIFY( !pm1->isActiveWindow() );
- QVERIFY( pm2->isActiveWindow() );
-
- // If we press ESC, the popup should disappear
- QTest::keyClick( 0, Qt::Key_Escape );
- QVERIFY( !pm1->isActiveWindow() );
- QVERIFY( !pm2->isActiveWindow() );
-
- if (!QApplication::style()->inherits("QWindowsStyle"))
- return;
-
- // but the menubar item should stay selected
- QVERIFY( mb->isItemActive(mb->idAt(1)) );
-
- // If we press Down the popupmenu should be active again
- QTest::keyClick( 0, Qt::Key_Down );
- QVERIFY( !pm1->isActiveWindow() );
- QVERIFY( pm2->isActiveWindow() );
-
- // and press ENTER
- QTest::keyClick( pm2, Qt::Key_Enter );
- // Let's see if the correct slot is called...
- QVERIFY2( item2_C->selCount() == 1, "Expected item 2C to be selected" );
-}
-#endif
-
void tst_QMenuBar::check_escKey_noQt3()
{
#if defined(Q_WS_MAC) || defined(Q_OS_WINCE_WM)
@@ -1403,11 +1000,7 @@ void tst_QMenuBar::check_altPress()
arg( qApp->style()->objectName() ).toAscii(), SkipAll );
}
-#ifdef QT3_SUPPORT
- initSimpleMenubar();
-#else
initSimpleMenubar_noQt3();
-#endif
qApp->setActiveWindow(mw);
mw->setFocus();
@@ -1423,11 +1016,7 @@ void tst_QMenuBar::check_shortcutPress()
QSKIP("Qt/Mac,WinCE does not use the native popups/menubar", SkipAll);
#endif
-#ifdef QT3_SUPPORT
- initComplexMenubar();
-#else
initComplexMenubar_noQt3();
-#endif
qApp->setActiveWindow(mw);
QCOMPARE(menu3->selCount(), 0u);
@@ -1437,17 +1026,9 @@ void tst_QMenuBar::check_shortcutPress()
QVERIFY(!mb->activeAction());
QTest::keyClick(mw, Qt::Key_1, Qt::AltModifier );
-#ifdef QT3_SUPPORT
- QVERIFY(pm1->isActiveWindow());
-#else
QVERIFY(pm1_Qt4->isActiveWindow());
-#endif
QTest::keyClick(mb, Qt::Key_2);
-#ifdef QT3_SUPPORT
- QVERIFY(pm1->isActiveWindow()); // Should still be the active window
-#else
QVERIFY(pm1_Qt4->isActiveWindow());
-#endif
}
void tst_QMenuBar::check_menuPosition()
@@ -1459,11 +1040,7 @@ void tst_QMenuBar::check_menuPosition()
QSKIP("Qt/CE uses native menubar", SkipAll);
#endif
Menu menu;
-#ifdef QT3_SUPPORT
- initComplexMenubar();
-#else
initComplexMenubar_noQt3();
-#endif
menu.setTitle("&menu");
QRect availRect = QApplication::desktop()->availableGeometry(mw);
QRect screenRect = QApplication::desktop()->screenGeometry(mw);
@@ -1720,47 +1297,5 @@ void tst_QMenuBar::taskQTBUG11823_crashwithInvisibleActions()
QCOMPARE(menubar.activeAction(), m); //the active action shouldn't have changed
}
-
-#if defined(QT3_SUPPORT)
-void tst_QMenuBar::indexBasedInsertion_data()
-{
- QTest::addColumn<int>("indexForInsertion");
- QTest::addColumn<int>("expectedIndex");
-
- QTest::newRow("negative-index-appends") << -1 << 1;
- QTest::newRow("prepend") << 0 << 0;
- QTest::newRow("append") << 1 << 1;
-}
-
-void tst_QMenuBar::indexBasedInsertion()
-{
- // test the compat'ed index based insertion
-
- QFETCH(int, indexForInsertion);
- QFETCH(int, expectedIndex);
-
- {
- QMenuBar menu;
- menu.addAction("Regular Item");
-
- menu.insertItem("New Item", -1 /*id*/, indexForInsertion);
-
- QAction *act = menu.actions().value(expectedIndex);
- QVERIFY(act);
- QCOMPARE(act->text(), QString("New Item"));
- }
- {
- QMenuBar menu;
- menu.addAction("Regular Item");
-
- menu.insertSeparator(indexForInsertion);
-
- QAction *act = menu.actions().value(expectedIndex);
- QVERIFY(act);
- QVERIFY(act->isSeparator());
- }
-}
-#endif
-
QTEST_MAIN(tst_QMenuBar)
#include "tst_qmenubar.moc"
diff --git a/tests/auto/qsharedpointer/externaltests.cpp b/tests/auto/qsharedpointer/externaltests.cpp
index b0490c9e59..9999d9a9bc 100644
--- a/tests/auto/qsharedpointer/externaltests.cpp
+++ b/tests/auto/qsharedpointer/externaltests.cpp
@@ -371,8 +371,6 @@ namespace QTest {
sourceCode += "#include <QtOpenGL/QtOpenGL>\n";
if (qtModules & QExternalTest::QtSql)
sourceCode += "#include <QtSql/QtSql>\n";
- if (qtModules & QExternalTest::Qt3Support)
- sourceCode += "#include <Qt3Support/Qt3Support>\n";
if (qtModules & QExternalTest::QtSvg)
sourceCode += "#include <QtSvg/QtSvg>\n";
if (qtModules & QExternalTest::QtScript)
@@ -543,8 +541,6 @@ namespace QTest {
projectFile.write("QT += opengl\n");
if (qtModules & QExternalTest::QtSql)
projectFile.write("QT += sql\n");
- if (qtModules & QExternalTest::Qt3Support)
- projectFile.write("QT += qt3support\n");
if (qtModules & QExternalTest::QtSvg)
projectFile.write("QT += svg\n");
if (qtModules & QExternalTest::QtScript)
diff --git a/tests/auto/qsharedpointer/externaltests.h b/tests/auto/qsharedpointer/externaltests.h
index ca20cb0c30..1bf642abb6 100644
--- a/tests/auto/qsharedpointer/externaltests.h
+++ b/tests/auto/qsharedpointer/externaltests.h
@@ -72,13 +72,12 @@ namespace QTest {
QtXmlPatterns=0x0010,
QtOpenGL = 0x0020,
QtSql = 0x0040,
- Qt3Support = 0x0080,
- QtSvg = 0x0100,
- QtScript = 0x0200,
- QtTest = 0x0400,
- QtDBus = 0x0800,
- QtWebKit = 0x1000,
- Phonon = 0x2000 // odd man out
+ QtSvg = 0x0080,
+ QtScript = 0x0100,
+ QtTest = 0x0200,
+ QtDBus = 0x0400,
+ QtWebKit = 0x0800,
+ Phonon = 0x1000 // odd man out
};
Q_DECLARE_FLAGS(QtModules, QtModule)
diff --git a/tests/auto/qsplitter/tst_qsplitter.cpp b/tests/auto/qsplitter/tst_qsplitter.cpp
index 60be94417d..84db2c20a6 100644
--- a/tests/auto/qsplitter/tst_qsplitter.cpp
+++ b/tests/auto/qsplitter/tst_qsplitter.cpp
@@ -81,8 +81,6 @@ public slots:
private slots:
void getSetCheck();
void sizes(); // bare (as in empty)
- void setSizes3();
- void setSizes3_data();
void setSizes();
void setSizes_data();
void saveAndRestoreState();
@@ -147,9 +145,6 @@ void tst_QSplitter::initTestCase()
w2 = new QWidget;
splitter->addWidget(w1);
splitter->addWidget(w2);
-#if defined(QT3_SUPPORT)
- qApp->setMainWidget(splitter);
-#endif
}
void tst_QSplitter::init()
@@ -183,16 +178,13 @@ void tst_QSplitter::addThirdWidget()
void tst_QSplitter::cleanupTestCase()
{
-#if defined(QT3_SUPPORT)
- delete qApp->mainWidget();
-#endif
}
typedef QList<int> IntList;
Q_DECLARE_METATYPE(IntList)
-void tst_QSplitter::setSizes3()
+void tst_QSplitter::setSizes()
{
QFETCH(IntList, minimumSizes);
QFETCH(IntList, splitterSizes);
@@ -212,7 +204,7 @@ void tst_QSplitter::setSizes3()
QTEST(splitter->sizes(), "expectedSizes");
}
-void tst_QSplitter::setSizes3_data()
+void tst_QSplitter::setSizes_data()
{
QTest::addColumn<IntList>("minimumSizes");
QTest::addColumn<IntList>("splitterSizes");
@@ -255,653 +247,6 @@ void tst_QSplitter::setSizes3_data()
}
}
-void tst_QSplitter::setSizes()
-{
-#if !defined(QT3_SUPPORT)
- QSKIP("No Qt3Support", SkipAll);
-#else
- QFETCH(int, minSize1);
- QFETCH(int, minSize2);
- QFETCH(int, splitterSize1);
- QFETCH(int, splitterSize2);
- QFETCH(bool, collapse1);
- QFETCH(bool, collapse2);
- QFETCH(bool, childrencollapse);
- QFETCH(int, resizeMode1);
- QFETCH(int, resizeMode2);
- QList<int> mySizes;
- mySizes << splitterSize1 << splitterSize2;
- w1->setMinimumWidth(minSize1);
- w2->setMinimumWidth(minSize2);
- splitter->setCollapsible(w1, collapse1);
- splitter->setCollapsible(w2, collapse2);
- splitter->setChildrenCollapsible(childrencollapse);
- splitter->setResizeMode(w1, (QSplitter::ResizeMode)resizeMode1);
- splitter->setResizeMode(w2, (QSplitter::ResizeMode)resizeMode2);
- splitter->setSizes(mySizes);
- mySizes = splitter->sizes();
- QTEST(mySizes[0], "expected1");
- QTEST(mySizes[1], "expected2");
-#endif
-}
-
-void tst_QSplitter::setSizes_data()
-{
-#if defined(QT3_SUPPORT)
- QTest::addColumn<int>("minSize1");
- QTest::addColumn<int>("minSize2");
- QTest::addColumn<int>("splitterSize1");
- QTest::addColumn<int>("splitterSize2");
- QTest::addColumn<int>("expected1");
- QTest::addColumn<int>("expected2");
- QTest::addColumn<bool>("collapse1");
- QTest::addColumn<bool>("collapse2");
- QTest::addColumn<bool>("childrencollapse");
- QTest::addColumn<int>("resizeMode1");
- QTest::addColumn<int>("resizeMode2");
- QTest::newRow("ok00") << 100 << 50 << 100 << 300 << 100 << 300
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok01") << 100 << 100 << 50 << 350 << 100 << 300
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok02") << 100 << 100 << 350 << 50 << 300 << 100
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok03") << 200 << 200 << 350 << 50 << 200 << 200
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok04") << 200 << 200 << 200 << 200 << 200 << 200
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok05") << 200 << 200 << 0 << 350 << 0 << 400
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok06") << 200 << 200 << 350 << 0 << 400 << 0
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok07") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)true << (bool)false << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok08") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)false << (bool)false << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok09") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok10") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)false << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
-
- QTest::newRow("ok20") << 100 << 50 << 100 << 300 << 100 << 300
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok21") << 100 << 100 << 50 << 350 << 100 << 300
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok22") << 100 << 100 << 350 << 50 << 300 << 100
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok23") << 200 << 200 << 350 << 50 << 200 << 200
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok24") << 200 << 200 << 200 << 200 << 200 << 200
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok25") << 200 << 200 << 0 << 350 << 0 << 400
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok26") << 200 << 200 << 350 << 0 << 400 << 0
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok27") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)true << (bool)false << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok28") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)false << (bool)false << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok29") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok30") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)false << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Auto;
- QTest::newRow("ok40") << 100 << 50 << 100 << 300 << 100 << 300
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok41") << 100 << 100 << 50 << 350 << 100 << 300
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok42") << 100 << 100 << 350 << 50 << 300 << 100
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok43") << 200 << 200 << 350 << 50 << 200 << 200
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok44") << 200 << 200 << 200 << 200 << 200 << 200
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok45") << 200 << 200 << 0 << 350 << 0 << 400
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok46") << 200 << 200 << 350 << 0 << 400 << 0
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok47") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)true << (bool)false << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok48") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)false << (bool)false << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok49") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok50") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)false << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
-
- QTest::newRow("ok60") << 100 << 50 << 100 << 300 << 100 << 300
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok61") << 100 << 100 << 50 << 350 << 100 << 300
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok62") << 100 << 100 << 350 << 50 << 300 << 100
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok63") << 200 << 200 << 350 << 50 << 200 << 200
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok64") << 200 << 200 << 200 << 200 << 200 << 200
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok65") << 200 << 200 << 0 << 350 << 0 << 400
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok66") << 200 << 200 << 350 << 0 << 400 << 0
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok67") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)true << (bool)false << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok68") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)false << (bool)false << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok69") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
- QTest::newRow("ok70") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)false << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Auto;
-
- QTest::newRow("ok80") << 100 << 50 << 100 << 300 << 100 << 300
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok81") << 100 << 100 << 50 << 350 << 100 << 300
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok82") << 100 << 100 << 350 << 50 << 300 << 100
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok83") << 200 << 200 << 350 << 50 << 200 << 200
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok84") << 200 << 200 << 200 << 200 << 200 << 200
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok85") << 200 << 200 << 0 << 350 << 0 << 400
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok86") << 200 << 200 << 350 << 0 << 400 << 0
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok87") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)true << (bool)false << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok88") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)false << (bool)false << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok89") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok90") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)false << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
-
- QTest::newRow("ok100") << 100 << 50 << 100 << 300 << 100 << 300
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok101") << 100 << 100 << 50 << 350 << 100 << 300
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok102") << 100 << 100 << 350 << 50 << 300 << 100
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok103") << 200 << 200 << 350 << 50 << 200 << 200
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok104") << 200 << 200 << 200 << 200 << 200 << 200
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok105") << 200 << 200 << 0 << 350 << 0 << 400
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok106") << 200 << 200 << 350 << 0 << 400 << 0
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok107") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)true << (bool)false << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok108") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)false << (bool)false << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok109") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
- QTest::newRow("ok110") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)false << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::Stretch;
-
- QTest::newRow("ok120") << 100 << 50 << 100 << 300 << 100 << 300
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok121") << 100 << 100 << 50 << 350 << 100 << 300
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok122") << 100 << 100 << 350 << 50 << 300 << 100
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok123") << 200 << 200 << 350 << 50 << 200 << 200
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok124") << 200 << 200 << 200 << 200 << 200 << 200
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok125") << 200 << 200 << 0 << 350 << 0 << 400
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok126") << 200 << 200 << 350 << 0 << 400 << 0
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok127") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)true << (bool)false << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok128") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)false << (bool)false << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok129") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok130") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)false << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
-
- QTest::newRow("ok140") << 100 << 50 << 100 << 300 << 100 << 300
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok141") << 100 << 100 << 50 << 350 << 100 << 300
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok142") << 100 << 100 << 350 << 50 << 300 << 100
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok143") << 200 << 200 << 350 << 50 << 200 << 200
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok144") << 200 << 200 << 200 << 200 << 200 << 200
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok145") << 200 << 200 << 0 << 350 << 0 << 400
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok146") << 200 << 200 << 350 << 0 << 400 << 0
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok147") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)true << (bool)false << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok148") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)false << (bool)false << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok149") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok150") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)false << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Auto;
- QTest::newRow("ok160") << 100 << 50 << 100 << 300 << 100 << 300
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok161") << 100 << 100 << 50 << 350 << 100 << 300
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok162") << 100 << 100 << 350 << 50 << 300 << 100
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok163") << 200 << 200 << 350 << 50 << 200 << 200
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok164") << 200 << 200 << 200 << 200 << 200 << 200
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok165") << 200 << 200 << 0 << 350 << 0 << 400
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok166") << 200 << 200 << 350 << 0 << 400 << 0
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok167") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)true << (bool)false << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok168") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)false << (bool)false << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok169") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)true << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok170") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)false << (bool)true
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok180") << 100 << 50 << 100 << 300 << 100 << 300
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok181") << 100 << 100 << 50 << 350 << 100 << 300
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok182") << 100 << 100 << 350 << 50 << 300 << 100
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok183") << 200 << 200 << 350 << 50 << 200 << 200
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok184") << 200 << 200 << 200 << 200 << 200 << 200
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok185") << 200 << 200 << 0 << 350 << 0 << 400
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok186") << 200 << 200 << 350 << 0 << 400 << 0
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok187") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)true << (bool)false << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok188") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)false << (bool)false << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok189") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)true << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok190") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)false << (bool)false
- << (int)QSplitter::Auto << (int)QSplitter::KeepSize;
- QTest::newRow("ok200") << 100 << 50 << 100 << 300 << 100 << 300
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok201") << 100 << 100 << 50 << 350 << 100 << 300
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok202") << 100 << 100 << 350 << 50 << 300 << 100
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok203") << 200 << 200 << 350 << 50 << 200 << 200
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok204") << 200 << 200 << 200 << 200 << 200 << 200
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok205") << 200 << 200 << 0 << 350 << 0 << 400
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok206") << 200 << 200 << 350 << 0 << 400 << 0
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok207") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)true << (bool)false << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok208") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)false << (bool)false << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok209") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok210") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)false << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok220") << 100 << 50 << 100 << 300 << 100 << 300
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok221") << 100 << 100 << 50 << 350 << 100 << 300
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok222") << 100 << 100 << 350 << 50 << 300 << 100
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok223") << 200 << 200 << 350 << 50 << 200 << 200
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok224") << 200 << 200 << 200 << 200 << 200 << 200
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok225") << 200 << 200 << 0 << 350 << 0 << 400
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok226") << 200 << 200 << 350 << 0 << 400 << 0
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok227") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)true << (bool)false << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok228") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)false << (bool)false << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok229") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok230") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)false << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::Stretch;
- QTest::newRow("ok240") << 100 << 50 << 100 << 300 << 100 << 300
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok241") << 100 << 100 << 50 << 350 << 100 << 300
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok242") << 100 << 100 << 350 << 50 << 300 << 100
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok243") << 200 << 200 << 350 << 50 << 200 << 200
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok244") << 200 << 200 << 200 << 200 << 200 << 200
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok245") << 200 << 200 << 0 << 350 << 0 << 400
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok246") << 200 << 200 << 350 << 0 << 400 << 0
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok247") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)true << (bool)false << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok248") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)false << (bool)false << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok249") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)true << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok250") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)false << (bool)true
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok260") << 100 << 50 << 100 << 300 << 100 << 300
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok261") << 100 << 100 << 50 << 350 << 100 << 300
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok262") << 100 << 100 << 350 << 50 << 300 << 100
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok263") << 200 << 200 << 350 << 50 << 200 << 200
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok264") << 200 << 200 << 200 << 200 << 200 << 200
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok265") << 200 << 200 << 0 << 350 << 0 << 400
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok266") << 200 << 200 << 350 << 0 << 400 << 0
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok267") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)true << (bool)false << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok268") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)false << (bool)false << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok269") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)true << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok270") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)false << (bool)false
- << (int)QSplitter::Stretch << (int)QSplitter::KeepSize;
- QTest::newRow("ok280") << 100 << 50 << 100 << 300 << 100 << 300
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok281") << 100 << 100 << 50 << 350 << 100 << 300
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok282") << 100 << 100 << 350 << 50 << 300 << 100
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok283") << 200 << 200 << 350 << 50 << 200 << 200
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok284") << 200 << 200 << 200 << 200 << 200 << 200
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok285") << 200 << 200 << 0 << 350 << 0 << 400
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok286") << 200 << 200 << 350 << 0 << 400 << 0
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok287") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)true << (bool)false << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok288") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)false << (bool)false << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok289") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok290") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)false << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok300") << 100 << 50 << 100 << 300 << 100 << 300
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok301") << 100 << 100 << 50 << 350 << 100 << 300
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok302") << 100 << 100 << 350 << 50 << 300 << 100
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok303") << 200 << 200 << 350 << 50 << 200 << 200
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok304") << 200 << 200 << 200 << 200 << 200 << 200
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok305") << 200 << 200 << 0 << 350 << 0 << 400
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok306") << 200 << 200 << 350 << 0 << 400 << 0
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok307") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)true << (bool)false << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok308") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)false << (bool)false << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok309") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok310") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)false << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::Stretch;
- QTest::newRow("ok320") << 100 << 50 << 100 << 300 << 100 << 300
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok321") << 100 << 100 << 50 << 350 << 100 << 300
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok322") << 100 << 100 << 350 << 50 << 300 << 100
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok323") << 200 << 200 << 350 << 50 << 200 << 200
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok324") << 200 << 200 << 200 << 200 << 200 << 200
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok325") << 200 << 200 << 0 << 350 << 0 << 400
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok326") << 200 << 200 << 350 << 0 << 400 << 0
- << (bool)true << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok327") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)true << (bool)false << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok328") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)false << (bool)false << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok329") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)true << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok330") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)false << (bool)true
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok340") << 100 << 50 << 100 << 300 << 100 << 300
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok341") << 100 << 100 << 50 << 350 << 100 << 300
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok342") << 100 << 100 << 350 << 50 << 300 << 100
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok343") << 200 << 200 << 350 << 50 << 200 << 200
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok344") << 200 << 200 << 200 << 200 << 200 << 200
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok345") << 200 << 200 << 0 << 350 << 0 << 400
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok346") << 200 << 200 << 350 << 0 << 400 << 0
- << (bool)true << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok347") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)true << (bool)false << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok348") << 200 << 200 << 350 << 0 << 200 << 200
- << (bool)false << (bool)false << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok349") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)true << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
- QTest::newRow("ok350") << 200 << 200 << 0 << 350 << 200 << 200
- << (bool)false << (bool)false << (bool)false
- << (int)QSplitter::KeepSize << (int)QSplitter::KeepSize;
-#endif
-}
-
void tst_QSplitter::saveAndRestoreState_data()
{
saveState_data();
diff --git a/tests/auto/qtipc/lackey/lackey.pro b/tests/auto/qtipc/lackey/lackey.pro
index 39123125f3..2fa364c4c9 100644
--- a/tests/auto/qtipc/lackey/lackey.pro
+++ b/tests/auto/qtipc/lackey/lackey.pro
@@ -1,6 +1,7 @@
include(../qsharedmemory/src/src.pri)
QT = core script
+QT += core-private
CONFIG += qtestlib
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.cpp
index 2b1e87ccac..3993cc9e28 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.cpp
@@ -84,10 +84,8 @@ bool AbstractItemContainer::event(QEvent *e)
bool AbstractItemContainer::eventFilter(QObject *obj, QEvent *event)
{
if (event->type()==QEvent::GraphicsSceneResize && m_itemView) {
-#if (QT_VERSION >= 0x040600)
const bool caching = m_itemView->listItemCaching();
m_itemView->setListItemCaching(false);
-#endif
QSizeF s = m_itemView->size();
s.setWidth(s.width()-m_itemView->verticalScrollBar()->size().width());
@@ -96,9 +94,7 @@ bool AbstractItemContainer::eventFilter(QObject *obj, QEvent *event)
m_itemView->updateViewContent();
updateItemBuffer();
-#if (QT_VERSION >= 0x040600)
m_itemView->setListItemCaching(caching);
-#endif
}
return QGraphicsWidget::eventFilter(obj, event);
@@ -373,7 +369,6 @@ void AbstractItemContainer::updateContent()
m_items.at(i)->updateItemContents();
}
-#if (QT_VERSION >= 0x040600)
void AbstractItemContainer::setSubtreeCacheEnabled(bool enabled)
{
for (int i = 0; i <m_items.count(); ++i)
@@ -381,7 +376,6 @@ void AbstractItemContainer::setSubtreeCacheEnabled(bool enabled)
if (m_prototype)
m_prototype->setSubtreeCacheEnabled(enabled);
}
-#endif
void AbstractItemContainer::setTwoColumns(const bool enabled)
{
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.h
index 249f7a76ea..495ef89c0a 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemcontainer.h
@@ -74,10 +74,8 @@ public:
virtual void setTwoColumns(const bool enabled);
bool twoColumns();
-#if (QT_VERSION >= 0x040600)
void setSubtreeCacheEnabled(const bool enabled);
virtual void setListItemCaching(const bool enabled, const int index) = 0;
-#endif
protected:
virtual void adjustVisibleContainerSize(const QSizeF &size) = 0;
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp
index 63ab2f9313..b617a44029 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.cpp
@@ -415,10 +415,8 @@ void AbstractItemView::scrollContentsBy(qreal dx, qreal dy)
for (int i = 0; i<itemsInContainer; ++i) {
AbstractViewItem *changedItem = m_container->itemAt(i);
- changedItem->setModelIndex(m_model->index(startRow+i,0));
-#if (QT_VERSION >= 0x040600)
+ changedItem->setModelIndex(m_model->index(startRow+i,0));
m_container->setListItemCaching(listItemCaching(), i);
-#endif
}
qreal diff = vPos-startRow*itemH;
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.h
index 2e286fb002..a94d673368 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractitemview.h
@@ -76,10 +76,8 @@ public:
void updateViewContent();
virtual void scrollContentsBy(qreal dx, qreal dy);
-#if (QT_VERSION >= 0x040600)
virtual bool listItemCaching() const = 0;
virtual void setListItemCaching(bool enabled) = 0;
-#endif
protected:
virtual bool event(QEvent *e);
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.cpp
index 2787a2e178..ff782bd37f 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.cpp
@@ -106,12 +106,10 @@ void AbstractViewItem::themeChange()
; // No impl yet
}
-#if (QT_VERSION >= 0x040600)
/*virtual*/
void AbstractViewItem::setSubtreeCacheEnabled(bool enabled)
{
Q_UNUSED(enabled)
; // No impl
}
-#endif
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.h
index 1eace4e501..a4a3c476e9 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/abstractviewitem.h
@@ -69,9 +69,7 @@ public:
virtual void updateItemContents();
virtual void themeChange();
-#if (QT_VERSION >= 0x040600)
virtual void setSubtreeCacheEnabled(bool enabled);
-#endif
virtual QSizeF effectiveSizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.cpp
index 718c1b8a48..93c3d8acd4 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.cpp
@@ -41,10 +41,7 @@
#include <QtGui>
#include <QSvgRenderer>
-
-#if (QT_VERSION >= 0x040600)
#include <QGraphicsEffect>
-#endif
#include "iconitem.h"
@@ -52,9 +49,7 @@ IconItem::IconItem(const QString &filename, QGraphicsItem *parent)
: GvbWidget(parent)
, m_filename(filename)
, m_rotation(0.0)
-#if (QT_VERSION >= 0x040600)
, m_opacityEffect(0)
-#endif
, m_smoothTransformation(false)
{
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
@@ -140,7 +135,6 @@ void IconItem::setFileName(const QString &filename)
}
}
-#if (QT_VERSION >= 0x040600)
void IconItem::setOpacityEffectEnabled(const bool enable)
{
if (!m_opacityEffect)
@@ -166,4 +160,3 @@ bool IconItem::isOpacityEffectEnabled() const
return false;
}
-#endif
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.h
index ea9e9a5cc1..29fafb705b 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/iconitem.h
@@ -46,9 +46,7 @@
#include "gvbwidget.h"
-#if (QT_VERSION >= 0x040600)
class QGraphicsOpacityEffect;
-#endif
class QPainter;
class IconItem : public GvbWidget
@@ -64,10 +62,9 @@ public:
QString fileName() const;
void setFileName(const QString &filename);
-#if (QT_VERSION >= 0x040600)
void setOpacityEffectEnabled(const bool enable);
bool isOpacityEffectEnabled() const;
-#endif
+
void setRotation(const qreal rotation) { m_rotation = rotation; }
qreal rotation() const { return m_rotation; }
@@ -87,9 +84,7 @@ private:
QString m_filename;
QPixmap m_pixmap;
qreal m_rotation;
-#if (QT_VERSION >= 0x040600)
QGraphicsOpacityEffect *m_opacityEffect;
-#endif
bool m_smoothTransformation;
};
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp
index 06c7b14b19..d5cd877bfb 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglist.cpp
@@ -161,10 +161,8 @@ void ItemRecyclingList::themeChange()
// Update icons
item->icon(ListItem::LeftIcon)->setRotation(Theme::p()->iconRotation(ListItem::LeftIcon));
item->icon(ListItem::RightIcon)->setRotation(Theme::p()->iconRotation(ListItem::RightIcon));
-#if (QT_VERSION >= 0x040600)
item->icon(ListItem::LeftIcon)->setOpacityEffectEnabled(Theme::p()->isIconOpacityEffectEnabled(ListItem::LeftIcon));
item->icon(ListItem::RightIcon)->setOpacityEffectEnabled(Theme::p()->isIconOpacityEffectEnabled(ListItem::RightIcon));
-#endif
item->icon(ListItem::LeftIcon)->setSmoothTransformationEnabled(Theme::p()->isIconSmoothTransformationEnabled(ListItem::LeftIcon));
item->icon(ListItem::RightIcon)->setSmoothTransformationEnabled(Theme::p()->isIconSmoothTransformationEnabled(ListItem::RightIcon));
}
@@ -208,25 +206,17 @@ void ItemRecyclingList::keyPressEvent(QKeyEvent *event)
bool ItemRecyclingList::listItemCaching() const
{
-#if (QT_VERSION >= 0x040600)
ListItemContainer *container =
static_cast<ListItemContainer *>(m_container);
return container->listItemCaching();
-#else
- return false;
-#endif
}
void ItemRecyclingList::setListItemCaching(bool enabled)
{
-#if (QT_VERSION >= 0x040600)
ListItemContainer *container =
static_cast<ListItemContainer *>(m_container);
container->setListItemCaching(enabled);
-#else
- Q_UNUSED(enabled)
-#endif
}
void ItemRecyclingList::updateListItemBackgrounds(int index)
@@ -255,17 +245,13 @@ void ItemRecyclingList::setTwoColumns(const bool enabled)
if (twoColumns() == enabled)
return;
-#if (QT_VERSION >= 0x040600)
const bool caching = listItemCaching();
setListItemCaching(false);
-#endif
m_container->setTwoColumns(enabled);
refreshContainerGeometry();
-#if (QT_VERSION >= 0x040600)
setListItemCaching(caching);
-#endif
}
bool ItemRecyclingList::twoColumns()
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.h
index 9798fe5cf1..1c19d2c36b 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/itemrecyclinglistview.h
@@ -51,10 +51,8 @@ public:
virtual ~ItemRecyclingListView();
void setCurrentRow(const int row);
int rows() const;
-#if (QT_VERSION >= 0x040600)
virtual bool listItemCaching() const = 0;
virtual void setListItemCaching(bool enabled) = 0;
-#endif
protected:
void rowsInserted(const QModelIndex &parent, int start, int end);
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.cpp
index ad73ca98f7..25acb02fef 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/label.cpp
@@ -50,10 +50,8 @@ Label::Label(const QString& text, QGraphicsItem *parent)
setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
setContentsMargins(0, 0, 0, 0);
setText(text);
-#if QT_VERSION >= 0x040600
// This flag was introduced in Qt 4.6.
setFlag(QGraphicsItem::ItemHasNoContents, true);
-#endif
}
Label::~Label()
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.cpp
index e9ce6fb15d..4d8ccbf6b0 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitem.cpp
@@ -175,18 +175,14 @@ QVariant ListItem::data(int role) const
data.icons[ListItem::LeftIcon] = icon(ListItem::LeftIcon)->fileName();
data.iconRotations[ListItem::LeftIcon] = icon(ListItem::LeftIcon)->rotation();
data.iconSmoothTransformations[ListItem::LeftIcon] = icon(ListItem::LeftIcon)->isSmoothTransformationEnabled();
-#if (QT_VERSION >= 0x040600)
data.iconOpacityEffets[ListItem::LeftIcon] = icon(ListItem::LeftIcon)->isOpacityEffectEnabled();
-#endif
}
if (icon(ListItem::RightIcon)) {
data.icons[ListItem::RightIcon] = icon(ListItem::RightIcon)->fileName();
data.iconRotations[ListItem::RightIcon] = icon(ListItem::RightIcon)->rotation();
data.iconSmoothTransformations[ListItem::RightIcon] = icon(ListItem::RightIcon)->isSmoothTransformationEnabled();
-#if (QT_VERSION >= 0x040600)
data.iconOpacityEffets[ListItem::RightIcon] = icon(ListItem::RightIcon)->isOpacityEffectEnabled();
-#endif
}
data.borderPen = m_borderPen;
@@ -226,17 +222,13 @@ void ListItem::setData(const QVariant &value, int role)
if (icon(ListItem::LeftIcon)) {
icon(ListItem::LeftIcon)->setRotation(data.iconRotations[ListItem::LeftIcon]);
icon(ListItem::LeftIcon)->setSmoothTransformationEnabled(data.iconSmoothTransformations[ListItem::LeftIcon]);
-#if (QT_VERSION >= 0x040600)
icon(ListItem::LeftIcon)->setOpacityEffectEnabled(data.iconOpacityEffets[ListItem::LeftIcon]);
-#endif
}
if (icon(ListItem::RightIcon)) {
icon(ListItem::RightIcon)->setRotation(data.iconRotations[ListItem::RightIcon]);
icon(ListItem::RightIcon)->setSmoothTransformationEnabled(data.iconSmoothTransformations[ListItem::RightIcon]);
-#if (QT_VERSION >= 0x040600)
icon(ListItem::RightIcon)->setOpacityEffectEnabled(data.iconOpacityEffets[ListItem::RightIcon]);
-#endif
}
m_borderPen = data.borderPen;
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.cpp
index 6633bd10be..323814e2cb 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.cpp
@@ -47,19 +47,14 @@
#include "abstractviewitem.h"
#include "recycledlistitem.h"
-
-#if (QT_VERSION >= 0x040600)
#include "listitemcache.h"
#include "itemrecyclinglist.h"
-#endif
ListItemContainer::ListItemContainer(int bufferSize, ItemRecyclingList *view, QGraphicsWidget *parent)
: AbstractItemContainer(bufferSize, parent)
, m_view(view)
, m_layout(new QGraphicsLinearLayout(Qt::Vertical))
-#if (QT_VERSION >= 0x040600)
, m_listItemCaching(false)
-#endif
{
setContentsMargins(0,0,0,0);
m_layout->setContentsMargins(0,0,0,0);
@@ -70,9 +65,7 @@ ListItemContainer::ListItemContainer(int bufferSize, ItemRecyclingList *view, QG
/*virtual*/
ListItemContainer::~ListItemContainer()
{
-#if (QT_VERSION >= 0x040600)
setListItemCaching(false);
-#endif
for (int i = 0; i < m_items.count(); ++i) {
m_layout->removeItem(m_items.at(i));
m_items.at(i)->setParentItem(0);
@@ -81,7 +74,6 @@ ListItemContainer::~ListItemContainer()
m_items.clear();
}
-#if (QT_VERSION >= 0x040600)
bool ListItemContainer::listItemCaching() const
{
return m_listItemCaching;
@@ -99,7 +91,6 @@ void ListItemContainer::setListItemCaching(const bool enabled)
for (int i = 0; i < itemCount; ++i)
setListItemCaching(enabled, i);
}
-#endif
/*virtual*/
void ListItemContainer::adjustVisibleContainerSize(const QSizeF &size)
@@ -112,9 +103,7 @@ void ListItemContainer::addItemToVisibleLayout(int index, AbstractViewItem *item
{
m_layout->insertItem(index,item);
-#if (QT_VERSION >= 0x040600)
setListItemCaching(m_listItemCaching, index);
-#endif
}
/*virtual*/
@@ -122,7 +111,6 @@ void ListItemContainer::removeItemFromVisibleLayout(AbstractViewItem *item)
{
m_layout->removeItem(item);
-#if (QT_VERSION >= 0x040600)
RecycledListItem *recycledItem = static_cast<RecycledListItem*>(item);
if (!recycledItem)
@@ -131,7 +119,6 @@ void ListItemContainer::removeItemFromVisibleLayout(AbstractViewItem *item)
ListItem *listItem = recycledItem->item();
setListItemCaching(false, listItem);
-#endif
}
/*virtual*/
@@ -168,7 +155,6 @@ int ListItemContainer::maxItemCountInItemBuffer() const
return count;
}
-#if (QT_VERSION >= 0x040600)
void ListItemContainer::setListItemCaching(const bool enabled, const int index)
{
RecycledListItem *recycledItem = static_cast<RecycledListItem*>(m_layout->itemAt(index));
@@ -198,8 +184,6 @@ void ListItemContainer::setListItemCaching(const bool enabled, ListItem *listIte
listItem->setGraphicsEffect(cache);
}
}
-#endif
-
void ListItemContainer::setTwoColumns(const bool twoColumns)
{
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.h
index 80d6d25131..ccbb76293d 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listitemcontainer.h
@@ -63,11 +63,9 @@ public:
virtual void setTwoColumns(const bool twoColumns);
-#if (QT_VERSION >= 0x040600)
bool listItemCaching() const;
void setListItemCaching(const bool enabled);
virtual void setListItemCaching(const bool enabled, const int index);
-#endif
protected:
@@ -82,11 +80,9 @@ private:
ItemRecyclingList *m_view;
QGraphicsLinearLayout *m_layout;
-#if (QT_VERSION >= 0x040600)
+
void setListItemCaching(const bool enabled, ListItem *listItem);
bool m_listItemCaching;
-#endif
};
-
#endif // LISTITEMCONTAINER_H
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.cpp
index bf9369c0a1..ff46ec8e90 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.cpp
@@ -109,7 +109,6 @@ ScrollBar* ListWidget::verticalScrollBar() const
return 0;
}
-#if (QT_VERSION >= 0x040600)
bool ListWidget::listItemCaching() const
{
return m_listView->listItemCaching();
@@ -119,7 +118,6 @@ void ListWidget::setListItemCaching(bool enable)
{
m_listView->setListItemCaching(enable);
}
-#endif
void ListWidget::setTwoColumns(const bool twoColumns)
{
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.h
index bcc15875de..78e4faa291 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/listwidget.h
@@ -64,10 +64,8 @@ public:
QGraphicsWidget* takeItem(int row);
QGraphicsWidget* itemAt(int row);
int itemCount() const;
-#if (QT_VERSION >= 0x040600)
bool listItemCaching() const;
void setListItemCaching(bool enable);
-#endif
ScrollBar* verticalScrollBar() const;
void setTwoColumns(const bool twoColumns);
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp
index 3e3f5bb84b..e1d6b61d1e 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelist.cpp
@@ -102,20 +102,12 @@ ScrollBar* SimpleList::verticalScrollBar() const
bool SimpleList::listItemCaching() const
{
-#if (QT_VERSION >= 0x040600)
return m_list->listItemCaching();
-#else
- return false;
-#endif
}
void SimpleList::setListItemCaching(bool enable)
{
-#if (QT_VERSION >= 0x040600)
m_list->setListItemCaching(enable);
-#else
- Q_UNUSED(enable)
-#endif
}
void SimpleList::keyPressEvent(QKeyEvent *event)
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp
index 3f2fb8baa8..a62f742f02 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.cpp
@@ -46,9 +46,7 @@
#include "simplelistview.h"
#include "scrollbar.h"
#include "listitem.h"
-#if (QT_VERSION >= 0x040600)
#include "listitemcache.h"
-#endif
#include "theme.h"
class SimpleListViewPrivate
@@ -62,9 +60,7 @@ public:
, m_layout(0)
, m_twoColumns(false)
, q_ptr(button)
-#if (QT_VERSION >= 0x040600)
, m_listItemCaching(false)
-#endif
{
Q_Q(SimpleListView);
@@ -99,10 +95,9 @@ public:
if (!m_content)
return;
-#if (QT_VERSION >= 0x040600)
const bool caching = q->listItemCaching();
q->setListItemCaching(false);
-#endif
+
m_content->resize(q->viewport()->size().width(),
m_layout->preferredHeight());
const bool clip =
@@ -112,9 +107,7 @@ public:
q->viewport()->setFlag(
QGraphicsItem::ItemClipsChildrenToShape, clip);
-#if (QT_VERSION >= 0x040600)
q->setListItemCaching(caching);
-#endif
}
void resizeScrollBars()
@@ -161,12 +154,11 @@ public:
void updateListContents()
{
-#if (QT_VERSION >= 0x040600)
Q_Q(SimpleListView);
const bool caching = q->listItemCaching();
q->setListItemCaching(false);
-#endif
+
const QString defaultIcon = Theme::p()->pixmapPath()+"contact_default_icon.svg";
const int itemCount = m_layout->count();
@@ -209,26 +201,21 @@ public:
// Update icons
item->icon(ListItem::LeftIcon)->setRotation(Theme::p()->iconRotation(ListItem::LeftIcon));
item->icon(ListItem::RightIcon)->setRotation(Theme::p()->iconRotation(ListItem::RightIcon));
-#if (QT_VERSION >= 0x040600)
item->icon(ListItem::LeftIcon)->setOpacityEffectEnabled(Theme::p()->isIconOpacityEffectEnabled(ListItem::LeftIcon));
item->icon(ListItem::RightIcon)->setOpacityEffectEnabled(Theme::p()->isIconOpacityEffectEnabled(ListItem::RightIcon));
-#endif
item->icon(ListItem::LeftIcon)->setSmoothTransformationEnabled(Theme::p()->isIconSmoothTransformationEnabled(ListItem::LeftIcon));
item->icon(ListItem::RightIcon)->setSmoothTransformationEnabled(Theme::p()->isIconSmoothTransformationEnabled(ListItem::RightIcon));
}
-#if (QT_VERSION >= 0x040600)
q->setListItemCaching(caching);
-#endif
}
void updateListItemBackgrounds(int index)
{
-#if (QT_VERSION >= 0x040600)
Q_Q(SimpleListView);
const bool caching = q->listItemCaching();
q->setListItemCaching(false);
-#endif
+
const int itemCount = m_layout->count();
for (int i=index; i<itemCount; ++i) {
@@ -243,9 +230,7 @@ public:
}
}
-#if (QT_VERSION >= 0x040600)
q->setListItemCaching(caching);
-#endif
}
void setTwoColumns(const bool twoColumns)
@@ -256,10 +241,9 @@ public:
Q_Q(SimpleListView);
m_twoColumns = twoColumns;
-#if (QT_VERSION >= 0x040600)
bool cache = q->listItemCaching();
q->setListItemCaching(false);
-#endif
+
QList<QGraphicsLayoutItem *> moveditems;
if(twoColumns) {
int half = m_layout->count()/2;
@@ -293,9 +277,7 @@ public:
resizeContents(q->size());
resizeScrollBars();
-#if (QT_VERSION >= 0x040600)
q->setListItemCaching(cache);
-#endif
}
bool twoColumns()
@@ -307,9 +289,7 @@ public:
QGraphicsGridLayout *m_layout;
bool m_twoColumns;
SimpleListView *q_ptr;
-#if (QT_VERSION >= 0x040600)
bool m_listItemCaching;
-#endif
};
SimpleListView::SimpleListView(QGraphicsWidget *parent)
@@ -361,11 +341,9 @@ void SimpleListView::insertItem(int index, QGraphicsWidget *item)
d->m_layout->addItem(moveditems.at(i), d->m_layout->count(), 0);
}
-#if (QT_VERSION >= 0x040600)
ListItemCache *cache = new ListItemCache;
item->setGraphicsEffect(cache);
cache->setEnabled(listItemCaching());
-#endif
d->resizeScrollBars();
d->updateListItemBackgrounds(index);
@@ -416,7 +394,6 @@ int SimpleListView::itemCount()
return d->m_layout->count();
}
-#if (QT_VERSION >= 0x040600)
bool SimpleListView::listItemCaching() const
{
Q_D(const SimpleListView);
@@ -439,7 +416,6 @@ void SimpleListView::setListItemCaching(bool enabled)
cache->setEnabled(enabled);
}
}
-#endif
void SimpleListView::scrollContentsBy(qreal dx, qreal dy)
{
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.h
index e2fcfff6d0..c119309fdc 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/simplelistview.h
@@ -72,10 +72,8 @@ public:
public slots:
void themeChange();
-#if (QT_VERSION >= 0x040600)
bool listItemCaching() const;
void setListItemCaching(bool enabled);
-#endif
protected:
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.cpp b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.cpp
index 06baf7729c..970bc9f9fa 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.cpp
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.cpp
@@ -60,9 +60,7 @@ Theme::Theme(QObject *parent)
, m_listItemBackgroundOpacityOdd()
, m_listItemBorderPen(QPen())
, m_listItemRounding()
-#if (QT_VERSION >= 0x040600)
, m_iconOpacityEffectEnabled()
-#endif
, m_iconRotation()
, m_iconSmoothTransformation()
{
@@ -156,10 +154,9 @@ void Theme::setBlueTheme()
m_listItemBorderPen = QPen(Qt::NoPen);
m_listItemRounding = QSize(0.0, 0.0);
-#if (QT_VERSION >= 0x040600)
m_iconOpacityEffectEnabled[ListItem::LeftIcon] = false;
m_iconOpacityEffectEnabled[ListItem::RightIcon] = false;
-#endif
+
m_iconRotation[ListItem::LeftIcon] = 0.0;
m_iconRotation[ListItem::RightIcon] = 0.0;
@@ -207,10 +204,9 @@ void Theme::setLimeTheme()
m_listItemBorderPen = QPen(QColor(0,0,0,55), 3, Qt::SolidLine);
m_listItemRounding = QSize(12.0, 12.0);
-#if (QT_VERSION >= 0x040600)
m_iconOpacityEffectEnabled[ListItem::LeftIcon] = true;
m_iconOpacityEffectEnabled[ListItem::RightIcon] = false;
-#endif
+
m_iconRotation[ListItem::LeftIcon] = -4.0;
m_iconRotation[ListItem::RightIcon] = 0.0;
diff --git a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.h b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.h
index 04972b7ca2..414a741cf3 100644
--- a/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.h
+++ b/tests/benchmarks/gui/graphicsview/functional/GraphicsViewBenchmark/widgets/theme.h
@@ -93,9 +93,8 @@ public:
QPen listItemBorderPen() const { return m_listItemBorderPen; }
QSize listItemRounding() const { return m_listItemRounding; }
-#if (QT_VERSION >= 0x040600)
bool isIconOpacityEffectEnabled(const ListItem::IconItemPos iconPos) const { return m_iconOpacityEffectEnabled[iconPos]; }
-#endif
+
qreal iconRotation(const ListItem::IconItemPos iconPos) const { return m_iconRotation[iconPos]; }
bool isIconSmoothTransformationEnabled(const ListItem::IconItemPos iconPos) const { return m_iconSmoothTransformation[iconPos]; }
@@ -124,9 +123,7 @@ private:
QPen m_listItemBorderPen;
QSize m_listItemRounding;
-#if (QT_VERSION >= 0x040600)
QHash<ListItem::IconItemPos, bool> m_iconOpacityEffectEnabled;
-#endif
QHash<ListItem::IconItemPos, qreal> m_iconRotation;
QHash<ListItem::IconItemPos, bool> m_iconSmoothTransformation;
};
diff --git a/tests/benchmarks/gui/painting/qtbench/benchmarktests.h b/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
index f5bc717cfb..c20cbfaef1 100644
--- a/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
+++ b/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
@@ -48,10 +48,7 @@
#include <QTextLayout>
#include <QFontMetrics>
#include <QDebug>
-
-#if QT_VERSION >= QT_VERSION_CHECK(4, 7, 0)
-# include <QStaticText>
-#endif
+#include <QStaticText>
class Benchmark
{
@@ -472,13 +469,10 @@ public:
PainterQPointMode,
LayoutMode,
DocumentMode,
- PixmapMode
-
-#if QT_VERSION >= 0x040700
- , StaticTextMode,
+ PixmapMode,
+ StaticTextMode,
StaticTextWithMaximumSizeMode,
StaticTextBackendOptimizations
-#endif
};
DrawText(const QString &text, Mode mode)
@@ -487,12 +481,8 @@ public:
}
virtual void begin(QPainter *p, int iterations) {
-#if QT_VERSION >= 0x040700
m_staticTexts.clear();
m_currentStaticText = 0;
-#else
- Q_UNUSED(iterations);
-#endif
m_pixmaps.clear();
m_currentPixmap = 0;
QRect m_bounds = QRect(0,0,p->device()->width(), p->device()->height());
@@ -536,7 +526,6 @@ public:
m_size = m_layout.boundingRect().toRect().size();
break; }
-#if QT_VERSION >= 0x040700
case StaticTextWithMaximumSizeMode: {
QStaticText staticText;
m_size = (p->boundingRect(m_bounds, 0, m_text)).size();
@@ -570,8 +559,6 @@ public:
break;
}
-#endif
-
case PainterQPointMode: {
QFontMetrics fm(p->font());
m_size = QSize(fm.width(m_text, m_text.length()), fm.height());
@@ -602,8 +589,6 @@ public:
case LayoutMode:
m_layout.draw(p, rect.topLeft());
break;
-
-#if QT_VERSION >= 0x040700
case StaticTextWithMaximumSizeMode:
case StaticTextMode:
p->drawStaticText(rect.topLeft(), m_staticTexts.at(0));
@@ -612,7 +597,6 @@ public:
p->drawStaticText(rect.topLeft(), m_staticTexts.at(m_currentStaticText));
m_currentStaticText = (m_currentStaticText + 1) % m_staticTexts.size();
break;
-#endif
}
}
@@ -628,12 +612,9 @@ public:
case LayoutMode: type = "layout.draw()"; break;
case DocumentMode: type = "doc.drawContents()"; break;
case PixmapMode: type = "pixmap cached text"; break;
-
-#if QT_VERSION >= 0x040700
case StaticTextMode: type = "drawStaticText()"; break;
case StaticTextWithMaximumSizeMode: type = "drawStaticText() w/ maxsize"; break;
case StaticTextBackendOptimizations: type = "drawStaticText() w/ backend optimizations"; break;
-#endif
}
return QString::fromLatin1("%3, len=%1, lines=%2")
@@ -651,15 +632,10 @@ private:
QList<QPixmap> m_pixmaps;
int m_currentPixmap;
-#if QT_VERSION >= 0x040700
int m_currentStaticText;
QList<QStaticText> m_staticTexts;
-#endif
};
-
-
-
class ClippedDrawRectBenchmark : public Benchmark
{
public:
diff --git a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp
index d8082cc2e0..a61610786f 100644
--- a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp
+++ b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp
@@ -213,7 +213,6 @@ void tst_QtBench::qtBench_data()
benchmarks << (new DrawText(longString, DrawText::PixmapMode));
benchmarks << (new DrawText(superLongString, DrawText::PixmapMode));
-#if QT_VERSION >= 0x040700
benchmarks << (new DrawText(shortString, DrawText::StaticTextMode));
benchmarks << (new DrawText(middleString, DrawText::StaticTextMode));
benchmarks << (new DrawText(longString, DrawText::StaticTextMode));
@@ -228,7 +227,6 @@ void tst_QtBench::qtBench_data()
benchmarks << (new DrawText(middleString, DrawText::StaticTextBackendOptimizations));
benchmarks << (new DrawText(longString, DrawText::StaticTextBackendOptimizations));
benchmarks << (new DrawText(superLongString, DrawText::StaticTextBackendOptimizations));
-#endif
foreach (Benchmark *benchmark, benchmarks)
QTest::newRow(qPrintable(benchmark->name())) << reinterpret_cast<void *>(benchmark);