summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/painting
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/painting')
-rw-r--r--tests/auto/gui/painting/qbrush/qbrush.pro1
-rw-r--r--tests/auto/gui/painting/qcolor/qcolor.pro1
-rw-r--r--tests/auto/gui/painting/qpagelayout/qpagelayout.pro2
-rw-r--r--tests/auto/gui/painting/qpagesize/qpagesize.pro2
-rw-r--r--tests/auto/gui/painting/qpaintengine/qpaintengine.pro1
-rw-r--r--tests/auto/gui/painting/qpainter/qpainter.pro2
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp78
-rw-r--r--tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp8
-rw-r--r--tests/auto/gui/painting/qpainterpathstroker/qpainterpathstroker.pro1
-rw-r--r--tests/auto/gui/painting/qpathclipper/qpathclipper.pro1
-rw-r--r--tests/auto/gui/painting/qpdfwriter/qpdfwriter.pro2
-rw-r--r--tests/auto/gui/painting/qpen/qpen.pro1
-rw-r--r--tests/auto/gui/painting/qpolygon/qpolygon.pro1
-rw-r--r--tests/auto/gui/painting/qregion/qregion.pro1
-rw-r--r--tests/auto/gui/painting/qtransform/qtransform.pro1
-rw-r--r--tests/auto/gui/painting/qtransform/tst_qtransform.cpp26
-rw-r--r--tests/auto/gui/painting/qwmatrix/qwmatrix.pro1
-rw-r--r--tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp27
18 files changed, 38 insertions, 119 deletions
diff --git a/tests/auto/gui/painting/qbrush/qbrush.pro b/tests/auto/gui/painting/qbrush/qbrush.pro
index 0cb11398dc..5016267e66 100644
--- a/tests/auto/gui/painting/qbrush/qbrush.pro
+++ b/tests/auto/gui/painting/qbrush/qbrush.pro
@@ -1,5 +1,4 @@
CONFIG += testcase
-CONFIG += parallel_test
TARGET = tst_qbrush
QT += testlib gui-private
SOURCES += tst_qbrush.cpp
diff --git a/tests/auto/gui/painting/qcolor/qcolor.pro b/tests/auto/gui/painting/qcolor/qcolor.pro
index 44d65bb50b..c8aab4ab75 100644
--- a/tests/auto/gui/painting/qcolor/qcolor.pro
+++ b/tests/auto/gui/painting/qcolor/qcolor.pro
@@ -1,5 +1,4 @@
CONFIG += testcase
-CONFIG += parallel_test
TARGET = tst_qcolor
SOURCES += tst_qcolor.cpp
QT += testlib gui-private core-private
diff --git a/tests/auto/gui/painting/qpagelayout/qpagelayout.pro b/tests/auto/gui/painting/qpagelayout/qpagelayout.pro
index 38a1064357..21fc8e0bb7 100644
--- a/tests/auto/gui/painting/qpagelayout/qpagelayout.pro
+++ b/tests/auto/gui/painting/qpagelayout/qpagelayout.pro
@@ -1,9 +1,7 @@
CONFIG += testcase
-CONFIG += parallel_test
TARGET = tst_qpagelayout
SOURCES += tst_qpagelayout.cpp
QT += gui-private testlib
DEFINES += QT_USE_USING_NAMESPACE
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/gui/painting/qpagesize/qpagesize.pro b/tests/auto/gui/painting/qpagesize/qpagesize.pro
index 5836dc9ba0..5e1cdb64eb 100644
--- a/tests/auto/gui/painting/qpagesize/qpagesize.pro
+++ b/tests/auto/gui/painting/qpagesize/qpagesize.pro
@@ -1,9 +1,7 @@
CONFIG += testcase
-CONFIG += parallel_test
TARGET = tst_qpagesize
SOURCES += tst_qpagesize.cpp
QT += testlib
DEFINES += QT_USE_USING_NAMESPACE
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/gui/painting/qpaintengine/qpaintengine.pro b/tests/auto/gui/painting/qpaintengine/qpaintengine.pro
index 1cf79af0a7..810dd81311 100644
--- a/tests/auto/gui/painting/qpaintengine/qpaintengine.pro
+++ b/tests/auto/gui/painting/qpaintengine/qpaintengine.pro
@@ -1,5 +1,4 @@
CONFIG += testcase
-CONFIG += parallel_test
TARGET = tst_qpaintengine
SOURCES += tst_qpaintengine.cpp
QT += testlib
diff --git a/tests/auto/gui/painting/qpainter/qpainter.pro b/tests/auto/gui/painting/qpainter/qpainter.pro
index e90b516ef2..d4f1d43a74 100644
--- a/tests/auto/gui/painting/qpainter/qpainter.pro
+++ b/tests/auto/gui/painting/qpainter/qpainter.pro
@@ -1,5 +1,4 @@
CONFIG += testcase
-CONFIG += parallel_test
TARGET = tst_qpainter
QT += testlib gui-private core-private
@@ -9,7 +8,6 @@ SOURCES += tst_qpainter.cpp
TESTDATA += drawEllipse/* drawLine_rop_bitmap/* drawPixmap_rop/* drawPixmap_rop_bitmap/* \
task217400.png
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
android: !android-no-sdk {
RESOURCES += \
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index 1ed78fa0ef..266b1c2896 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -81,14 +81,9 @@ Q_OBJECT
public:
tst_QPainter();
- virtual ~tst_QPainter();
-
-public slots:
- void init();
- void cleanup();
- void cleanupTestCase();
private slots:
+ void cleanupTestCase();
void getSetCheck();
#ifndef QT_NO_WIDGETS
void drawPixmap_comp_data();
@@ -392,18 +387,6 @@ tst_QPainter::tst_QPainter()
QGuiApplication::setDesktopSettingsAware(true);
}
-tst_QPainter::~tst_QPainter()
-{
-}
-
-void tst_QPainter::init()
-{
-}
-
-void tst_QPainter::cleanup()
-{
-}
-
void tst_QPainter::cleanupTestCase()
{
QFile::remove(QLatin1String("dest.png"));
@@ -663,7 +646,7 @@ QColor tst_QPainter::baseColor( int k, int intensity )
QImage tst_QPainter::getResImage( const QString &dir, const QString &addition, const QString &extension )
{
QImage res;
- QString resFilename = dir + QString( "/res_%1." ).arg( addition ) + extension;
+ QString resFilename = dir + QLatin1String("/res_") + addition + QLatin1Char('.') + extension;
if ( !res.load( resFilename ) ) {
QWARN(QString("Could not load result data %s %1").arg(resFilename).toLatin1());
return QImage();
@@ -674,14 +657,14 @@ QImage tst_QPainter::getResImage( const QString &dir, const QString &addition, c
QBitmap tst_QPainter::getBitmap( const QString &dir, const QString &filename, bool mask )
{
QBitmap bm;
- QString bmFilename = dir + QString( "/%1.xbm" ).arg( filename );
+ QString bmFilename = dir + QLatin1Char('/') + filename + QLatin1String(".xbm");
if ( !bm.load( bmFilename ) ) {
QWARN(QString("Could not load bitmap '%1'").arg(bmFilename).toLatin1());
return QBitmap();
}
if ( mask ) {
QBitmap mask;
- QString maskFilename = dir + QString( "/%1-mask.xbm" ).arg( filename );
+ QString maskFilename = dir + QLatin1Char('/') + filename + QLatin1String("-mask.xbm");
if (!mask.load(maskFilename)) {
QWARN(QString("Could not load mask '%1'").arg(maskFilename).toLatin1());
return QBitmap();
@@ -1521,10 +1504,11 @@ void tst_QPainter::drawEllipse_data()
// ratio between width and hight is too large/small (task 114874). Those
// ratios are therefore currently avoided.
for (int w = 10; w < 128; w += 7) {
+ const QByteArray wB = QByteArray::number(w);
for (int h = w/2; h < qMin(2*w, 128); h += 13) {
- QString s = QString("%1x%2").arg(w).arg(h);
- QTest::newRow(QString("%1 with pen").arg(s).toLatin1()) << QSize(w, h) << true;
- QTest::newRow(QString("%1 no pen").arg(s).toLatin1()) << QSize(w, h) << false;
+ const QByteArray sB = wB + 'x' + QByteArray::number(h);
+ QTest::newRow((sB + " with pen").constData()) << QSize(w, h) << true;
+ QTest::newRow((sB + " no pen").constData()) << QSize(w, h) << false;
}
}
}
@@ -1562,16 +1546,17 @@ void tst_QPainter::drawClippedEllipse_data()
QTest::addColumn<QRect>("rect");
for (int w = 20; w < 128; w += 7) {
+ const QByteArray wB = QByteArray::number(w);
for (int h = w/2; h < qMin(2*w, 128); h += 13) {
- QString s = QString("%1x%2").arg(w).arg(h);
- QTest::newRow(QString("%1 top").arg(s).toLatin1()) << QRect(0, -h/2, w, h);
- QTest::newRow(QString("%1 topright").arg(s).toLatin1()) << QRect(w/2, -h/2, w, h);
- QTest::newRow(QString("%1 right").arg(s).toLatin1()) << QRect(w/2, 0, w, h);
- QTest::newRow(QString("%1 bottomright").arg(s).toLatin1()) << QRect(w/2, h/2, w, h);
- QTest::newRow(QString("%1 bottom").arg(s).toLatin1()) << QRect(0, h/2, w, h);
- QTest::newRow(QString("%1 bottomleft").arg(s).toLatin1()) << QRect(-w/2, h/2, w, h);
- QTest::newRow(QString("%1 left").arg(s).toLatin1()) << QRect(-w/2, 0, w, h);
- QTest::newRow(QString("%1 topleft").arg(s).toLatin1()) << QRect(-w/2, -h/2, w, h);
+ const QByteArray sB = wB + 'x' + QByteArray::number(h);
+ QTest::newRow((sB + " top").constData()) << QRect(0, -h/2, w, h);
+ QTest::newRow((sB + " topright").constData()) << QRect(w/2, -h/2, w, h);
+ QTest::newRow((sB + " right").constData()) << QRect(w/2, 0, w, h);
+ QTest::newRow((sB + " bottomright").constData()) << QRect(w/2, h/2, w, h);
+ QTest::newRow((sB + " bottom").constData()) << QRect(0, h/2, w, h);
+ QTest::newRow((sB + " bottomleft").constData()) << QRect(-w/2, h/2, w, h);
+ QTest::newRow((sB + " left").constData()) << QRect(-w/2, 0, w, h);
+ QTest::newRow((sB + " topleft").constData()) << QRect(-w/2, -h/2, w, h);
}
}
}
@@ -1678,13 +1663,14 @@ void tst_QPainter::fillData()
QTest::addColumn<bool>("usePen");
for (int w = 3; w < 50; w += 7) {
+ const QByteArray wB = QByteArray::number(w);
for (int h = 3; h < 50; h += 11) {
int x = w/2 + 5;
int y = h/2 + 5;
- QTest::newRow(QString("rect(%1, %2, %3, %4) with pen").arg(x).arg(y).arg(w).arg(h).toLatin1())
- << QRect(x, y, w, h) << true;
- QTest::newRow(QString("rect(%1, %2, %3, %4) no pen").arg(x).arg(y).arg(w).arg(h).toLatin1())
- << QRect(x, y, w, h) << false;
+ const QByteArray rB = "rect(" + QByteArray::number(x) + ", " + QByteArray::number(y)
+ + ", " + QByteArray::number(w) + ", " + QByteArray::number(h) + ')';
+ QTest::newRow((rB + " with pen").constData()) << QRect(x, y, w, h) << true;
+ QTest::newRow((rB + " no pen").constData()) << QRect(x, y, w, h) << false;
}
}
}
@@ -2167,21 +2153,23 @@ void tst_QPainter::clippedLines_data()
<< QLineF(15, 50, 66, 50);
foreach (QLineF line, lines) {
- QString desc = QString("line (%1, %2, %3, %4) %5").arg(line.x1())
- .arg(line.y1()).arg(line.x2()).arg(line.y2());
- QTest::newRow(qPrintable(desc.arg(0))) << QSize(100, 100) << line
+ const QByteArray desc = "line (" + QByteArray::number(line.x1())
+ + ", " + QByteArray::number(line.y1()) + ", "
+ + QByteArray::number(line.x2()) + ", " + QByteArray::number(line.y2())
+ + ") ";
+ QTest::newRow((desc + '0').constData()) << QSize(100, 100) << line
<< QRect(15, 15, 49, 49)
<< QPen(Qt::black);
- QTest::newRow(qPrintable(desc.arg(1))) << QSize(100, 100) << line
+ QTest::newRow((desc + '1').constData()) << QSize(100, 100) << line
<< QRect(15, 15, 50, 50)
<< QPen(Qt::black);
- QTest::newRow(qPrintable(desc.arg(2))) << QSize(100, 100) << line
+ QTest::newRow((desc + '2').constData()) << QSize(100, 100) << line
<< QRect(15, 15, 51, 51)
<< QPen(Qt::black);
- QTest::newRow(qPrintable(desc.arg(3))) << QSize(100, 100) << line
+ QTest::newRow((desc + '3').constData()) << QSize(100, 100) << line
<< QRect(15, 15, 51, 51)
<< QPen(Qt::NoPen);
- QTest::newRow(qPrintable(desc.arg(4))) << QSize(100, 100) << line
+ QTest::newRow((desc + '4').constData()) << QSize(100, 100) << line
<< QRect(15, 15, 51, 51)
<< pen2;
}
@@ -4487,7 +4475,7 @@ void tst_QPainter::QTBUG5939_attachPainterPrivate()
TestWidget *widget = new TestWidget();
proxy->setWidget(widget);
scene->addItem(proxy);
- proxy->rotate(45);
+ proxy->setTransform(QTransform().rotate(45));
w->resize(scene->sceneRect().size().toSize());
w->show();
diff --git a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
index ae30719ee7..b5e2ef96d1 100644
--- a/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
+++ b/tests/auto/gui/painting/qpainterpath/tst_qpainterpath.cpp
@@ -270,13 +270,13 @@ void tst_QPainterPath::contains_QPointF_data()
inside.addEllipse(base_rect.adjusted(5, 5, -5, -5));
QPolygonF inside_poly = inside.toFillPolygon();
for (int i=0; i<inside_poly.size(); ++i)
- QTest::newRow(qPrintable(QString("inside_ellipse %1").arg(i))) << path << inside_poly.at(i) << true;
+ QTest::newRow(("inside_ellipse " + QByteArray::number(i)).constData()) << path << inside_poly.at(i) << true;
QPainterPath outside;
outside.addEllipse(base_rect.adjusted(-5, -5, 5, 5));
QPolygonF outside_poly = outside.toFillPolygon();
for (int i=0; i<outside_poly.size(); ++i)
- QTest::newRow(qPrintable(QString("outside_ellipse %1").arg(i))) << path << outside_poly.at(i) << false;
+ QTest::newRow(("outside_ellipse " + QByteArray::number(i)).constData()) << path << outside_poly.at(i) << false;
path = QPainterPath();
base_rect = QRectF(50, 50, 200, 200);
@@ -852,8 +852,10 @@ void tst_QPainterPath::testArcMoveTo_data()
<< QRectF(100, 100, -100, -100);
for (int domain=0; domain<rects.size(); ++domain) {
+ const QByteArray dB = QByteArray::number(domain);
for (int i=-360; i<=360; ++i) {
- QTest::newRow(qPrintable(QString("test %1 %2").arg(domain).arg(i))) << rects.at(domain) << (qreal) i;
+ QTest::newRow(("test " + dB + ' ' + QByteArray::number(i)).constData())
+ << rects.at(domain) << (qreal) i;
}
// test low angles
diff --git a/tests/auto/gui/painting/qpainterpathstroker/qpainterpathstroker.pro b/tests/auto/gui/painting/qpainterpathstroker/qpainterpathstroker.pro
index 8ad476b498..218183da3d 100644
--- a/tests/auto/gui/painting/qpainterpathstroker/qpainterpathstroker.pro
+++ b/tests/auto/gui/painting/qpainterpathstroker/qpainterpathstroker.pro
@@ -1,5 +1,4 @@
CONFIG += testcase
-CONFIG += parallel_test
TARGET = tst_qpainterpathstroker
SOURCES += tst_qpainterpathstroker.cpp
QT += testlib
diff --git a/tests/auto/gui/painting/qpathclipper/qpathclipper.pro b/tests/auto/gui/painting/qpathclipper/qpathclipper.pro
index b90bca8df3..2536cb24c0 100644
--- a/tests/auto/gui/painting/qpathclipper/qpathclipper.pro
+++ b/tests/auto/gui/painting/qpathclipper/qpathclipper.pro
@@ -1,5 +1,4 @@
CONFIG += testcase
-CONFIG += parallel_test
TARGET = tst_qpathclipper
INCLUDEPATH += .
HEADERS += paths.h
diff --git a/tests/auto/gui/painting/qpdfwriter/qpdfwriter.pro b/tests/auto/gui/painting/qpdfwriter/qpdfwriter.pro
index fda0fad3b5..4d2dd70e26 100644
--- a/tests/auto/gui/painting/qpdfwriter/qpdfwriter.pro
+++ b/tests/auto/gui/painting/qpdfwriter/qpdfwriter.pro
@@ -1,9 +1,7 @@
CONFIG += testcase
-CONFIG += parallel_test
TARGET = tst_qpdfwriter
SOURCES += tst_qpdfwriter.cpp
QT += gui-private testlib
DEFINES += QT_USE_USING_NAMESPACE
-DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
diff --git a/tests/auto/gui/painting/qpen/qpen.pro b/tests/auto/gui/painting/qpen/qpen.pro
index cafec29947..762b8f47d4 100644
--- a/tests/auto/gui/painting/qpen/qpen.pro
+++ b/tests/auto/gui/painting/qpen/qpen.pro
@@ -1,5 +1,4 @@
CONFIG += testcase
-CONFIG += parallel_test
TARGET = tst_qpen
SOURCES += tst_qpen.cpp
QT += testlib
diff --git a/tests/auto/gui/painting/qpolygon/qpolygon.pro b/tests/auto/gui/painting/qpolygon/qpolygon.pro
index 4783e4b5d4..9385b6458d 100644
--- a/tests/auto/gui/painting/qpolygon/qpolygon.pro
+++ b/tests/auto/gui/painting/qpolygon/qpolygon.pro
@@ -1,5 +1,4 @@
CONFIG += testcase
-CONFIG += parallel_test
TARGET = tst_qpolygon
QT += testlib
SOURCES += tst_qpolygon.cpp
diff --git a/tests/auto/gui/painting/qregion/qregion.pro b/tests/auto/gui/painting/qregion/qregion.pro
index 01eb9dd937..e9dff9a32e 100644
--- a/tests/auto/gui/painting/qregion/qregion.pro
+++ b/tests/auto/gui/painting/qregion/qregion.pro
@@ -1,5 +1,4 @@
CONFIG += testcase
-CONFIG += parallel_test
TARGET = tst_qregion
QT += gui-private testlib
diff --git a/tests/auto/gui/painting/qtransform/qtransform.pro b/tests/auto/gui/painting/qtransform/qtransform.pro
index d59c040fb8..62c7518da0 100644
--- a/tests/auto/gui/painting/qtransform/qtransform.pro
+++ b/tests/auto/gui/painting/qtransform/qtransform.pro
@@ -1,5 +1,4 @@
CONFIG += testcase
-CONFIG += parallel_test
TARGET = tst_qtransform
SOURCES += tst_qtransform.cpp
QT += testlib
diff --git a/tests/auto/gui/painting/qtransform/tst_qtransform.cpp b/tests/auto/gui/painting/qtransform/tst_qtransform.cpp
index 60b89aa6ab..fa6a11022d 100644
--- a/tests/auto/gui/painting/qtransform/tst_qtransform.cpp
+++ b/tests/auto/gui/painting/qtransform/tst_qtransform.cpp
@@ -43,14 +43,6 @@ class tst_QTransform : public QObject
{
Q_OBJECT
-public:
- tst_QTransform();
- virtual ~tst_QTransform();
-
-
-public slots:
- void init();
- void cleanup();
private slots:
void mapRect_data();
void mapToPolygon_data();
@@ -80,24 +72,6 @@ private:
Q_DECLARE_METATYPE(QTransform)
-tst_QTransform::tst_QTransform()
-{
-}
-
-tst_QTransform::~tst_QTransform()
-{
-}
-
-void tst_QTransform::init()
-{
- // No initialisation is required
-}
-
-void tst_QTransform::cleanup()
-{
- // No cleanup is required.
-}
-
#if defined(Q_OS_WIN) && !defined(M_PI)
#define M_PI 3.14159265897932384626433832795f
#endif
diff --git a/tests/auto/gui/painting/qwmatrix/qwmatrix.pro b/tests/auto/gui/painting/qwmatrix/qwmatrix.pro
index b3bec3d4ff..efa2963091 100644
--- a/tests/auto/gui/painting/qwmatrix/qwmatrix.pro
+++ b/tests/auto/gui/painting/qwmatrix/qwmatrix.pro
@@ -1,5 +1,4 @@
CONFIG += testcase
-CONFIG += parallel_test
TARGET = tst_qwmatrix
SOURCES += tst_qwmatrix.cpp
QT += testlib
diff --git a/tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp b/tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp
index c4c4789b7a..9d87bddbe7 100644
--- a/tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp
+++ b/tests/auto/gui/painting/qwmatrix/tst_qwmatrix.cpp
@@ -42,14 +42,6 @@ class tst_QWMatrix : public QObject
{
Q_OBJECT
-public:
- tst_QWMatrix();
- virtual ~tst_QWMatrix();
-
-
-public slots:
- void init();
- void cleanup();
private slots:
void mapRect_data();
void mapToPolygon_data();
@@ -65,25 +57,6 @@ private:
void mapping_data();
};
-
-tst_QWMatrix::tst_QWMatrix()
-{
-}
-
-tst_QWMatrix::~tst_QWMatrix()
-{
-}
-
-void tst_QWMatrix::init()
-{
- // No initialisation is required
-}
-
-void tst_QWMatrix::cleanup()
-{
- // No cleanup is required.
-}
-
void tst_QWMatrix::mapRect_data()
{
mapping_data();