Merge branch 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging

* 'master' of git://scm.dev.nokia.troll.no/qt/qtbase-staging:
  Compile IPC tests.
  Always call XInitThreads.
  Remove redundant #ifdef's from benchmarks
  Improve coding style of qdatastream test
  Don't use Qt3Support in arthur test suite.
  Remove Qt3Support code from QMenuBar autotest
  Remove Qt3Support code from QSplitter autotest
  Remove Qt3Support code from QSharedPointer autotest
  Remove Qt3Support code from QComboBox autotest
  Remove Qt3Support test code from accessibility autotest
  tests: allow unstable tests to be marked with CONFIG+=insignificant_test
This commit is contained in:
Qt Continuous Integration System 2011-05-19 20:04:29 +10:00
commit 77cd5455b2
43 changed files with 549 additions and 3069 deletions

View File

@ -38,6 +38,10 @@ embedded: check.commands += -qws
# Allow for custom arguments to tests
check.commands += $(TESTARGS)
# If the test is marked as insignificant, discard the exit code
insignificant_test:check.commands = -$${check.commands}
QMAKE_EXTRA_TARGETS *= check
!debug_and_release|build_pass {

View File

@ -1740,8 +1740,8 @@ void qt_init(QApplicationPrivate *priv, int,
} else {
// Qt controls everything (default)
if (QApplication::testAttribute(Qt::AA_X11InitThreads))
XInitThreads();
// With the threaded QML renderer, we always need this.
XInitThreads();
// Set application name and class
char *app_class = 0;

View File

@ -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

View File

@ -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)
{

View File

@ -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);

View File

@ -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

View File

@ -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 \

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -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);

File diff suppressed because it is too large Load Diff

View File

@ -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"

View File

@ -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)

View File

@ -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)

View File

@ -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();

View File

@ -1,6 +1,7 @@
include(../qsharedmemory/src/src.pri)
QT = core script
QT += core-private
CONFIG += qtestlib

View File

@ -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)
{

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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;
};

View File

@ -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()

View File

@ -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);

View File

@ -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()

View File

@ -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;

View File

@ -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)
{

View File

@ -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

View File

@ -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)
{

View File

@ -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);

View File

@ -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)

View File

@ -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)
{

View File

@ -72,10 +72,8 @@ public:
public slots:
void themeChange();
#if (QT_VERSION >= 0x040600)
bool listItemCaching() const;
void setListItemCaching(bool enabled);
#endif
protected:

View File

@ -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;

View File

@ -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;
};

View File

@ -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:

View File

@ -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);