summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2019-07-10 17:04:42 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2019-07-13 10:43:15 +0200
commit2f33e030b8c80b4665cc2c120df7833469c05145 (patch)
treec82580c8ef761ddd5e22f695dc5934753429436d /tests/auto
parente89b2f72c7147e46dcf606c3dcc507e2ae2841ce (diff)
Remove usages of deprecated APIs of qtbase/gui
- Replaced the usages of deprecated APIs by corresponding alternatives in the library code and documentation. - Modified the tests to make them build when deprecated APIs disabled: * Made the the parts of the tests testing the deprecated APIs to be compiled conditionally, only when the corresponding methods are enabled. * If the test-case tests only the deprecated API, but not the corresponding replacement, added tests for the replacement. Change-Id: Ic38245015377fc0c8127eb5458c184ffd4b450f1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/corelib/io/qsettings/tst_qsettings.cpp4
-rw-r--r--tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp8
-rw-r--r--tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp44
-rw-r--r--tests/auto/gui/kernel/qdrag/tst_qdrag.cpp9
-rw-r--r--tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp2
-rw-r--r--tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp4
-rw-r--r--tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp3
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp68
-rw-r--r--tests/auto/gui/painting/qpathclipper/paths.cpp2
-rw-r--r--tests/auto/gui/text/qfont/tst_qfont.cpp4
-rw-r--r--tests/auto/gui/text/qtexttable/qtexttable.pro2
-rw-r--r--tests/auto/gui/text/qtexttable/tst_qtexttable.cpp42
-rw-r--r--tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp4
-rw-r--r--tests/auto/other/lancelot/paintcommands.cpp2
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp2
15 files changed, 172 insertions, 28 deletions
diff --git a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
index a71a68e457..289590a233 100644
--- a/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
+++ b/tests/auto/corelib/io/qsettings/tst_qsettings.cpp
@@ -1366,7 +1366,9 @@ void tst_QSettings::testVariantTypes()
if (format >= QSettings::InvalidFormat) {
testVal("keysequence", QKeySequence(Qt::ControlModifier + Qt::Key_F1), QKeySequence, KeySequence);
} else {
- testVal("keysequence", QKeySequence(Qt::ControlModifier + Qt::Key_F1), QString, String);
+ testVal("keysequence",
+ QKeySequence(Qt::ControlModifier + Qt::Key_F1).toString(QKeySequence::NativeText),
+ QString, String);
}
#undef testVal
diff --git a/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp b/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp
index b8778e4e98..8197c386c5 100644
--- a/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp
+++ b/tests/auto/corelib/serialization/qdatastream/tst_qdatastream.cpp
@@ -2391,10 +2391,10 @@ void tst_QDataStream::setVersion()
if (vers == 1) {
for (int grp = 0; grp < (int)QPalette::NColorGroups; ++grp) {
- QVERIFY(pal1.color((QPalette::ColorGroup)grp, QPalette::Foreground)
- == inPal1.color((QPalette::ColorGroup)grp, QPalette::Foreground));
- QVERIFY(pal1.color((QPalette::ColorGroup)grp, QPalette::Background)
- == inPal1.color((QPalette::ColorGroup)grp, QPalette::Background));
+ QVERIFY(pal1.color((QPalette::ColorGroup)grp, QPalette::WindowText)
+ == inPal1.color((QPalette::ColorGroup)grp, QPalette::WindowText));
+ QVERIFY(pal1.color((QPalette::ColorGroup)grp, QPalette::Window)
+ == inPal1.color((QPalette::ColorGroup)grp, QPalette::Window));
QVERIFY(pal1.color((QPalette::ColorGroup)grp, QPalette::Light)
== inPal1.color((QPalette::ColorGroup)grp, QPalette::Light));
QVERIFY(pal1.color((QPalette::ColorGroup)grp, QPalette::Dark)
diff --git a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
index 158530428d..3158883ef5 100644
--- a/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/auto/gui/image/qpixmapcache/tst_qpixmapcache.cpp
@@ -104,18 +104,28 @@ void tst_QPixmapCache::cacheLimit()
void tst_QPixmapCache::setCacheLimit()
{
+ QPixmap res;
QPixmap *p1 = new QPixmap(2, 3);
QPixmapCache::insert("P1", *p1);
+#if QT_DEPRECATED_SINCE(5, 13)
QVERIFY(QPixmapCache::find("P1") != 0);
+#endif
+ QVERIFY(QPixmapCache::find("P1", &res));
delete p1;
QPixmapCache::setCacheLimit(0);
+#if QT_DEPRECATED_SINCE(5, 13)
QVERIFY(!QPixmapCache::find("P1"));
+#endif
+ QVERIFY(!QPixmapCache::find("P1", &res));
p1 = new QPixmap(2, 3);
QPixmapCache::setCacheLimit(1000);
QPixmapCache::insert("P1", *p1);
+#if QT_DEPRECATED_SINCE(5, 13)
QVERIFY(QPixmapCache::find("P1") != 0);
+#endif
+ QVERIFY(QPixmapCache::find("P1", &res));
delete p1;
@@ -200,6 +210,7 @@ void tst_QPixmapCache::find()
QVERIFY(QPixmapCache::insert("P1", p1));
QPixmap p2;
+#if QT_DEPRECATED_SINCE(5, 13)
QVERIFY(QPixmapCache::find("P1", p2));
QCOMPARE(p2.width(), 10);
QCOMPARE(p2.height(), 10);
@@ -209,6 +220,12 @@ void tst_QPixmapCache::find()
QPixmap *p3 = QPixmapCache::find("P1");
QVERIFY(p3);
QCOMPARE(p1, *p3);
+#endif
+
+ QVERIFY(QPixmapCache::find("P1", &p2));
+ QCOMPARE(p2.width(), 10);
+ QCOMPARE(p2.height(), 10);
+ QCOMPARE(p1, p2);
//The int part of the API
QPixmapCache::Key key = QPixmapCache::insert(p1);
@@ -261,6 +278,7 @@ void tst_QPixmapCache::insert()
}
int num = 0;
+#if QT_DEPRECATED_SINCE(5, 13)
for (int k = 0; k < numberOfKeys; ++k) {
if (QPixmapCache::find(QString::number(k)))
++num;
@@ -268,6 +286,16 @@ void tst_QPixmapCache::insert()
if (QPixmapCache::find("0"))
++num;
+ num = 0;
+#endif
+ QPixmap res;
+ for (int k = 0; k < numberOfKeys; ++k) {
+ if (QPixmapCache::find(QString::number(k), &res))
+ ++num;
+ }
+
+ if (QPixmapCache::find("0", &res))
+ ++num;
QVERIFY(num <= estimatedNum);
QPixmap p3;
@@ -340,17 +368,17 @@ void tst_QPixmapCache::remove()
p1.fill(Qt::yellow);
QPixmap p2;
- QVERIFY(QPixmapCache::find("red", p2));
+ QVERIFY(QPixmapCache::find("red", &p2));
QVERIFY(p1.toImage() != p2.toImage());
QVERIFY(p1.toImage() == p1.toImage()); // sanity check
QPixmapCache::remove("red");
- QVERIFY(!QPixmapCache::find("red"));
+ QVERIFY(!QPixmapCache::find("red", &p2));
QPixmapCache::remove("red");
- QVERIFY(!QPixmapCache::find("red"));
+ QVERIFY(!QPixmapCache::find("red", &p2));
QPixmapCache::remove("green");
- QVERIFY(!QPixmapCache::find("green"));
+ QVERIFY(!QPixmapCache::find("green", &p2));
//The int part of the API
QPixmapCache::clear();
@@ -392,7 +420,7 @@ void tst_QPixmapCache::remove()
key = QPixmapCache::insert(p1);
QPixmapCache::remove(key);
QVERIFY(QPixmapCache::find(key, &p1) == 0);
- QVERIFY(QPixmapCache::find("red") != 0);
+ QVERIFY(QPixmapCache::find("red", &p1) != 0);
}
void tst_QPixmapCache::clear()
@@ -408,14 +436,14 @@ void tst_QPixmapCache::clear()
const int numberOfKeys = estimatedNum + 1000;
for (int i = 0; i < numberOfKeys; ++i)
- QVERIFY(QPixmapCache::find("x" + QString::number(i)) == 0);
+ QVERIFY(!QPixmapCache::find("x" + QString::number(i), &p1));
for (int j = 0; j < numberOfKeys; ++j)
QPixmapCache::insert(QString::number(j), p1);
int num = 0;
for (int k = 0; k < numberOfKeys; ++k) {
- if (QPixmapCache::find(QString::number(k), p1))
+ if (QPixmapCache::find(QString::number(k), &p1))
++num;
}
QVERIFY(num > 0);
@@ -423,7 +451,7 @@ void tst_QPixmapCache::clear()
QPixmapCache::clear();
for (int k = 0; k < numberOfKeys; ++k)
- QVERIFY(!QPixmapCache::find(QString::number(k)));
+ QVERIFY(!QPixmapCache::find(QString::number(k), &p1));
//The int part of the API
QPixmap p2(10, 10);
diff --git a/tests/auto/gui/kernel/qdrag/tst_qdrag.cpp b/tests/auto/gui/kernel/qdrag/tst_qdrag.cpp
index 68852f5a3f..d67b17fd43 100644
--- a/tests/auto/gui/kernel/qdrag/tst_qdrag.cpp
+++ b/tests/auto/gui/kernel/qdrag/tst_qdrag.cpp
@@ -68,10 +68,17 @@ void tst_QDrag::getSetCheck()
QCOMPARE((QMimeData *)0, obj1.mimeData());
// delete var1; // No delete, since QDrag takes ownership
- Qt::DropAction result = obj1.start();
+ Qt::DropAction result = obj1.exec();
+ QCOMPARE(result, Qt::IgnoreAction);
+ result = obj1.exec(Qt::MoveAction | Qt::LinkAction);
+ QCOMPARE(result, Qt::IgnoreAction);
+
+#if QT_DEPRECATED_SINCE(5, 13)
+ result = obj1.start();
QCOMPARE(result, Qt::IgnoreAction);
result = obj1.start(Qt::MoveAction | Qt::LinkAction);
QCOMPARE(result, Qt::IgnoreAction);
+#endif
}
QTEST_MAIN(tst_QDrag)
diff --git a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
index b2572188b9..3ce65a6785 100644
--- a/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
+++ b/tests/auto/gui/kernel/qguimetatype/tst_qguimetatype.cpp
@@ -191,7 +191,7 @@ template<> struct TestValueFactory<QMetaType::QTextLength> {
static QTextLength *create() { return new QTextLength(QTextLength::PercentageLength, 50); }
};
template<> struct TestValueFactory<QMetaType::QTextFormat> {
- static QTextFormat *create() { return new QTextFormat(QTextFormat::TableFormat); }
+ static QTextFormat *create() { return new QTextFormat(QTextFormat::FrameFormat); }
};
template<> struct TestValueFactory<QMetaType::QMatrix> {
static QMatrix *create() { return new QMatrix(10, 20, 30, 40, 50, 60); }
diff --git a/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp b/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
index 96d983c8f7..e19f76d830 100644
--- a/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
+++ b/tests/auto/gui/math3d/qmatrixnxn/tst_qmatrixnxn.cpp
@@ -2861,8 +2861,10 @@ void tst_QMatrixNxN::convertGeneric()
QMatrix4x4 m4(m1);
QVERIFY(isSame(m4, unique4x4));
+#if QT_DEPRECATED_SINCE(5, 0)
QMatrix4x4 m5 = qGenericMatrixToMatrix4x4(m1);
QVERIFY(isSame(m5, unique4x4));
+#endif
static float const conv4x4[12] = {
1.0f, 2.0f, 3.0f, 4.0f,
@@ -2874,8 +2876,10 @@ void tst_QMatrixNxN::convertGeneric()
QMatrix4x3 m10 = m9.toGenericMatrix<4, 3>();
QVERIFY(isSame(m10, conv4x4));
+#if QT_DEPRECATED_SINCE(5, 0)
QMatrix4x3 m11 = qGenericMatrixFromMatrix4x4<4, 3>(m9);
QVERIFY(isSame(m11, conv4x4));
+#endif
}
// Copy of "flagBits" in qmatrix4x4.h.
diff --git a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
index 097dd111d3..8041fb5439 100644
--- a/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
+++ b/tests/auto/gui/math3d/qquaternion/tst_qquaternion.cpp
@@ -778,7 +778,10 @@ void tst_QQuaternion::conjugate()
QQuaternion v1(w1, x1, y1, z1);
QQuaternion v2(w1, -x1, -y1, -z1);
+#if QT_DEPRECATED_SINCE(5, 5)
QCOMPARE(v1.conjugate(), v2);
+#endif
+ QCOMPARE(v1.conjugated(), v2);
}
// Test quaternion creation from an axis and an angle.
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index 2b53169a45..0efeb9b356 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -123,14 +123,18 @@ private slots:
void drawPath2();
void drawPath3();
+#if QT_DEPRECATED_SINCE(5, 13)
void drawRoundRect_data() { fillData(); }
void drawRoundRect();
+#endif
+ void drawRoundedRect_data() { fillData(); }
+ void drawRoundedRect();
void qimageFormats_data();
void qimageFormats();
void textOnTransparentImage();
-#ifndef QT_NO_WIDGETS
+#if !defined(QT_NO_WIDGETS) && QT_DEPRECATED_SINCE(5, 13)
void initFrom();
#endif
@@ -679,12 +683,14 @@ static QRect getPaintedSize(const QPixmap &pm, const QColor &background)
}
#ifndef QT_NO_WIDGETS
+
+#if QT_DEPRECATED_SINCE(5, 13)
void tst_QPainter::initFrom()
{
QWidget *widget = new QWidget();
QPalette pal = widget->palette();
- pal.setColor(QPalette::Foreground, QColor(255, 0, 0));
- pal.setBrush(QPalette::Background, QColor(0, 255, 0));
+ pal.setColor(QPalette::WindowText, QColor(255, 0, 0));
+ pal.setBrush(QPalette::Window, QColor(0, 255, 0));
widget->setPalette(pal);
widget->show();
@@ -698,11 +704,12 @@ void tst_QPainter::initFrom()
p.initFrom(widget);
QCOMPARE(p.font(), font);
- QCOMPARE(p.pen().color(), pal.color(QPalette::Foreground));
+ QCOMPARE(p.pen().color(), pal.color(QPalette::WindowText));
QCOMPARE(p.background(), pal.window());
delete widget;
}
+#endif
void tst_QPainter::drawBorderPixmap()
{
@@ -1546,6 +1553,7 @@ void tst_QPainter::drawClippedEllipse()
}
+#if QT_DEPRECATED_SINCE(5, 13)
void tst_QPainter::drawRoundRect()
{
QFETCH(QRect, rect);
@@ -1580,6 +1588,42 @@ void tst_QPainter::drawRoundRect()
QCOMPARE(painted.height(), rect.height() + increment);
}
}
+#endif
+
+void tst_QPainter::drawRoundedRect()
+{
+ QFETCH(QRect, rect);
+ QFETCH(bool, usePen);
+
+#ifdef Q_OS_DARWIN
+ if (QTest::currentDataTag() == QByteArray("rect(6, 12, 3, 14) with pen") ||
+ QTest::currentDataTag() == QByteArray("rect(6, 17, 3, 25) with pen") ||
+ QTest::currentDataTag() == QByteArray("rect(10, 6, 10, 3) with pen") ||
+ QTest::currentDataTag() == QByteArray("rect(10, 12, 10, 14) with pen") ||
+ QTest::currentDataTag() == QByteArray("rect(13, 45, 17, 80) with pen") ||
+ QTest::currentDataTag() == QByteArray("rect(13, 50, 17, 91) with pen") ||
+ QTest::currentDataTag() == QByteArray("rect(17, 6, 24, 3) with pen") ||
+ QTest::currentDataTag() == QByteArray("rect(24, 12, 38, 14) with pen"))
+ QSKIP("The Mac paint engine is off-by-one on certain rect sizes");
+#endif
+ QPixmap pixmap(rect.x() + rect.width() + 10,
+ rect.y() + rect.height() + 10);
+ {
+ pixmap.fill(Qt::white);
+ QPainter p(&pixmap);
+ p.setRenderHint(QPainter::Qt4CompatiblePainting);
+ p.setPen(usePen ? QPen(Qt::black) : QPen(Qt::NoPen));
+ p.setBrush(Qt::black);
+ p.drawRoundedRect(rect, 25, 25, Qt::RelativeSize);
+ p.end();
+
+ int increment = usePen ? 1 : 0;
+
+ const QRect painted = getPaintedSize(pixmap, Qt::white);
+ QCOMPARE(painted.width(), rect.width() + increment);
+ QCOMPARE(painted.height(), rect.height() + increment);
+ }
+}
void tst_QPainter::qimageFormats_data()
{
@@ -1662,9 +1706,13 @@ void tst_QPainter::combinedMatrix()
p.translate(0.5, 0.5);
+ QTransform ct = p.combinedTransform();
+#if QT_DEPRECATED_SINCE(5, 13)
QMatrix cm = p.combinedMatrix();
+ QCOMPARE(cm, ct.toAffine());
+#endif
- QPointF pt = QPointF(0, 0) * cm;
+ QPointF pt = QPointF(0, 0) * ct.toAffine();
QCOMPARE(pt.x(), 48.0);
QCOMPARE(pt.y(), 16.0);
@@ -1979,7 +2027,7 @@ void tst_QPainter::clippedFillPath_data()
<< pen2;
path = QPainterPath();
- path.addRoundRect(QRect(15, 15, 50, 50), 20);
+ path.addRoundedRect(QRect(15, 15, 50, 50), 20, Qt::RelativeSize);
QTest::newRow("round rect 0") << QSize(100, 100) << path
<< QRect(15, 15, 49, 49)
<< QBrush(Qt::NoBrush)
@@ -4088,14 +4136,18 @@ void tst_QPainter::inactivePainter()
p.setClipRegion(region);
p.setClipping(true);
+#if QT_DEPRECATED_SINCE(5, 13)
p.combinedMatrix();
+#endif
p.combinedTransform();
p.compositionMode();
p.setCompositionMode(QPainter::CompositionMode_Plus);
p.device();
+#if QT_DEPRECATED_SINCE(5, 13)
p.deviceMatrix();
+#endif
p.deviceTransform();
p.font();
@@ -4119,7 +4171,9 @@ void tst_QPainter::inactivePainter()
p.setRenderHint(QPainter::Antialiasing, true);
p.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform, false);
+#if QT_DEPRECATED_SINCE(5, 13)
p.resetMatrix();
+#endif
p.resetTransform();
p.rotate(1);
p.scale(2, 2);
@@ -4135,8 +4189,10 @@ void tst_QPainter::inactivePainter()
p.window();
p.setWindow(QRect(10, 10, 620, 460));
+#if QT_DEPRECATED_SINCE(5, 13)
p.worldMatrix();
p.setWorldMatrix(QMatrix().translate(43, 21), true);
+#endif
p.setWorldMatrixEnabled(true);
p.transform();
diff --git a/tests/auto/gui/painting/qpathclipper/paths.cpp b/tests/auto/gui/painting/qpathclipper/paths.cpp
index 077527e1a0..1328befd1b 100644
--- a/tests/auto/gui/painting/qpathclipper/paths.cpp
+++ b/tests/auto/gui/painting/qpathclipper/paths.cpp
@@ -578,7 +578,7 @@ QPainterPath Paths::node()
m_rect.setHeight(100);
QPainterPath shape;
- shape.addRoundRect(m_rect, 25);
+ shape.addRoundedRect(m_rect, 25, Qt::RelativeSize);
const int conWidth = 10;
const int xOffset = 7;
diff --git a/tests/auto/gui/text/qfont/tst_qfont.cpp b/tests/auto/gui/text/qfont/tst_qfont.cpp
index 901284e131..96f3b1c1d7 100644
--- a/tests/auto/gui/text/qfont/tst_qfont.cpp
+++ b/tests/auto/gui/text/qfont/tst_qfont.cpp
@@ -58,7 +58,9 @@ private slots:
void insertAndRemoveSubstitutions();
void serialize_data();
void serialize();
+#if QT_DEPRECATED_SINCE(5, 13)
void lastResortFont();
+#endif
void styleName();
void defaultFamily_data();
void defaultFamily();
@@ -484,6 +486,7 @@ void tst_QFont::serialize()
}
}
+#if QT_DEPRECATED_SINCE(5, 13)
// QFont::lastResortFont() may abort with qFatal() on QWS/QPA
// if absolutely no font is found. Just as ducumented for QFont::lastResortFont().
// This happens on our CI machines which run QWS autotests.
@@ -494,6 +497,7 @@ void tst_QFont::lastResortFont()
QFont font;
QVERIFY(!font.lastResortFont().isEmpty());
}
+#endif
void tst_QFont::styleName()
{
diff --git a/tests/auto/gui/text/qtexttable/qtexttable.pro b/tests/auto/gui/text/qtexttable/qtexttable.pro
index 2faadfcb0d..73e94d5735 100644
--- a/tests/auto/gui/text/qtexttable/qtexttable.pro
+++ b/tests/auto/gui/text/qtexttable/qtexttable.pro
@@ -1,6 +1,6 @@
CONFIG += testcase
TARGET = tst_qtexttable
-QT += testlib
+QT += testlib gui-private
qtHaveModule(widgets): QT += widgets
SOURCES += tst_qtexttable.cpp
diff --git a/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp b/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
index 22f00c677d..f21b969aa7 100644
--- a/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
+++ b/tests/auto/gui/text/qtexttable/tst_qtexttable.cpp
@@ -44,6 +44,7 @@
#include <QPainter>
#include <QPaintEngine>
#endif
+#include <private/qpagedpaintdevice_p.h>
typedef QList<int> IntList;
@@ -91,7 +92,7 @@ private slots:
void QTBUG11282_insertBeforeMergedEnding();
#endif
void QTBUG22011_insertBeforeRowSpan();
-#ifndef QT_NO_PRINTER
+#if !defined(QT_NO_PRINTER) && defined(QT_BUILD_INTERNAL)
void QTBUG31330_renderBackground();
#endif
@@ -1025,7 +1026,7 @@ void tst_QTextTable::QTBUG22011_insertBeforeRowSpan()
QCOMPARE(table->columns(), 6);
}
-#ifndef QT_NO_PRINTER
+#if !defined(QT_NO_PRINTER) && defined(QT_BUILD_INTERNAL)
namespace {
class QTBUG31330_PaintDevice : public QPagedPaintDevice
{
@@ -1065,11 +1066,46 @@ public:
{}
};
+ class QDummyPagedPaintDevicePrivate : public QPagedPaintDevicePrivate
+ {
+ bool setPageLayout(const QPageLayout &newPageLayout) override
+ {
+ m_pageLayout = newPageLayout;
+ return m_pageLayout.isEquivalentTo(newPageLayout);
+ }
+
+ bool setPageSize(const QPageSize &pageSize) override
+ {
+ m_pageLayout.setPageSize(pageSize);
+ return m_pageLayout.pageSize().isEquivalentTo(pageSize);
+ }
+
+ bool setPageOrientation(QPageLayout::Orientation orientation) override
+ {
+ m_pageLayout.setOrientation(orientation);
+ return m_pageLayout.orientation() == orientation;
+ }
+
+ bool setPageMargins(const QMarginsF &margins, QPageLayout::Unit units) override
+ {
+ m_pageLayout.setUnits(units);
+ m_pageLayout.setMargins(margins);
+ return m_pageLayout.margins() == margins && m_pageLayout.units() == units;
+ }
+
+ QPageLayout pageLayout() const override
+ {
+ return m_pageLayout;
+ }
+
+ QPageLayout m_pageLayout;
+ };
+
int pages;
QPaintEngine* engine;
QTBUG31330_PaintDevice(QPaintEngine* engine)
- : pages(1), engine(engine)
+ : QPagedPaintDevice(new QDummyPagedPaintDevicePrivate), pages(1), engine(engine)
{
QPageLayout layout = pageLayout();
layout.setUnits(QPageLayout::Point);
diff --git a/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp b/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
index add23d46cf..4d95345de9 100644
--- a/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
+++ b/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
@@ -39,7 +39,9 @@ class tst_qdesktopservices : public QObject
private slots:
void openUrl();
void handlers();
+#if QT_DEPRECATED_SINCE(5, 0)
void testDataLocation();
+#endif
};
void tst_qdesktopservices::openUrl()
@@ -89,6 +91,7 @@ void tst_qdesktopservices::handlers()
#define Q_XDG_PLATFORM
#endif
+#if QT_DEPRECATED_SINCE(5, 0)
void tst_qdesktopservices::testDataLocation()
{
// This is the one point where QDesktopServices and QStandardPaths differ.
@@ -115,6 +118,7 @@ void tst_qdesktopservices::testDataLocation()
#endif
}
}
+#endif
QTEST_MAIN(tst_qdesktopservices)
diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp
index 8a2934049e..dc71253f3e 100644
--- a/tests/auto/other/lancelot/paintcommands.cpp
+++ b/tests/auto/other/lancelot/paintcommands.cpp
@@ -1202,7 +1202,7 @@ void PaintCommands::command_drawRoundRect(QRegularExpressionMatch re)
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
- m_painter->drawRoundRect(x, y, w, h, xs, ys);
+ m_painter->drawRoundedRect(x, y, w, h, xs, ys, Qt::RelativeSize);
QT_WARNING_POP
}
diff --git a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
index 85b42e54fe..d3477be986 100644
--- a/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
@@ -2905,7 +2905,7 @@ public:
Q_UNUSED(widget);
qreal w = rect().width();
QRectF box(0, 0, w, 2400/w);
- painter->drawRoundRect(box);
+ painter->drawRoundedRect(box, 25, 25, Qt::RelativeSize);
painter->drawLine(box.topLeft(), box.bottomRight());
painter->drawLine(box.bottomLeft(), box.topRight());
}