summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-08-20 14:26:05 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-08-20 22:27:46 +0000
commitce73b4db62574fc966192e6a4f65b7e2b2280e38 (patch)
treed73af1000b0114f031ac4aee9f42fa44e740434f /tests/auto
parent4dab6184f5f885bac21eef9e17a87219e64ba7dc (diff)
Remove dead code from Qt 4 times
The benefit of keeping this code around was to inspire or inform changes in the areas to take into account possibly missing features in Qt 5, but at this point that benefit is questionable. We can always use the history to learn about missing pieces if needed. Change-Id: I87a02dc451e9027be9b97554427bf8a1c6b2c025 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/gui/image/qpixmap/tst_qpixmap.cpp13
-rw-r--r--tests/auto/gui/painting/qcolor/tst_qcolor.cpp60
-rw-r--r--tests/auto/gui/painting/qpainter/tst_qpainter.cpp5
-rw-r--r--tests/auto/gui/painting/qregion/tst_qregion.cpp24
-rw-r--r--tests/auto/opengl/qglthreads/tst_qglthreads.cpp3
-rw-r--r--tests/auto/other/lancelot/paintcommands.cpp11
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp3
-rw-r--r--tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp3
-rw-r--r--tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp3
-rw-r--r--tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp2
10 files changed, 0 insertions, 127 deletions
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
index 4d31d80246..ba5df809f2 100644
--- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
@@ -267,10 +267,6 @@ void tst_QPixmap::fromImage()
image.fill(0x7f7f7f7f);
const QPixmap pixmap = QPixmap::fromImage(image);
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- if (pixmap.handle()->classId() == QPlatformPixmap::X11Class && !pixmap.x11PictureHandle())
- QSKIP("Requires XRender support");
-#endif
const QImage result = pixmap.toImage();
image = image.convertToFormat(result.format());
QCOMPARE(result, image);
@@ -491,11 +487,6 @@ void tst_QPixmap::fill()
else
pm = QPixmap(400, 400);
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- if (!bitmap && pm.handle()->classId() == QPlatformPixmap::X11Class && !pm.x11PictureHandle())
- QSKIP("Requires XRender support");
-#endif
-
pm.fill(color);
if (syscolor && !bitmap && pm.depth() < 24) {
QSKIP("Test does not work on displays without true color");
@@ -521,10 +512,6 @@ void tst_QPixmap::fill()
void tst_QPixmap::fill_transparent()
{
QPixmap pixmap(10, 10);
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- if (pixmap.handle()->classId() == QPlatformPixmap::X11Class && !pixmap.x11PictureHandle())
- QSKIP("Requires XRender support");
-#endif
pixmap.fill(Qt::transparent);
QVERIFY(pixmap.hasAlphaChannel());
}
diff --git a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
index 90a216e14a..c1c231089a 100644
--- a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
+++ b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp
@@ -111,10 +111,6 @@ private slots:
void qcolorprofile_data();
void qcolorprofile();
-
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- void setallowX11ColorNames();
-#endif
};
// Testing get/set functions
@@ -1460,62 +1456,6 @@ void tst_QColor::achromaticHslHue()
QCOMPARE(hsl.hslHue(), -1);
}
-#if 0 // Used to be included in Qt4 for Q_WS_X11
-void tst_QColor::setallowX11ColorNames()
-{
- RGBData x11RgbTbl[] = {
- // a few standard X11 color names
- { "DodgerBlue1", qRgb(30, 144, 255) },
- { "DodgerBlue2", qRgb(28, 134, 238) },
- { "DodgerBlue3", qRgb(24, 116, 205) },
- { "DodgerBlue4", qRgb(16, 78, 139) },
- { "SteelBlue1", qRgb(99, 184, 255) },
- { "SteelBlue2", qRgb(92, 172, 238) },
- { "SteelBlue3", qRgb(79, 148, 205) },
- { "SteelBlue4", qRgb(54, 100, 139) },
- { "DeepSkyBlue1", qRgb(0, 191, 255) },
- { "DeepSkyBlue2", qRgb(0, 178, 238) },
- { "DeepSkyBlue3", qRgb(0, 154, 205) },
- { "DeepSkyBlue4", qRgb(0, 104, 139) },
- { "SkyBlue1", qRgb(135, 206, 255) },
- { "SkyBlue2", qRgb(126, 192, 238) },
- { "SkyBlue3", qRgb(108, 166, 205) },
- { "SkyBlue4", qRgb(74, 112, 139) }
- };
- static const int x11RgbTblSize = sizeof(x11RgbTbl) / sizeof(RGBData);
-
- // X11 color names should not work by default
- QVERIFY(!QColor::allowX11ColorNames());
- for (int i = 0; i < x11RgbTblSize; ++i) {
- QString colorName = QLatin1String(x11RgbTbl[i].name);
- QColor color;
- color.setNamedColor(colorName);
- QVERIFY(!color.isValid());
- }
-
- // enable X11 color names
- QColor::setAllowX11ColorNames(true);
- QVERIFY(QColor::allowX11ColorNames());
- for (int i = 0; i < x11RgbTblSize; ++i) {
- QString colorName = QLatin1String(x11RgbTbl[i].name);
- QColor color;
- color.setNamedColor(colorName);
- QColor expected(x11RgbTbl[i].value);
- QCOMPARE(color, expected);
- }
-
- // should be able to turn off X11 color names
- QColor::setAllowX11ColorNames(false);
- QVERIFY(!QColor::allowX11ColorNames());
- for (int i = 0; i < x11RgbTblSize; ++i) {
- QString colorName = QLatin1String(x11RgbTbl[i].name);
- QColor color;
- color.setNamedColor(colorName);
- QVERIFY(!color.isValid());
- }
-}
-#endif
-
void tst_QColor::premultiply()
{
// Tests that qPremultiply(qUnpremultiply(x)) returns x.
diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
index 0efeb9b356..4cf23455e1 100644
--- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp
@@ -461,11 +461,6 @@ void tst_QPainter::drawPixmap_comp()
destPm.fill(c1);
srcPm.fill(c2);
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- if (!destPm.x11PictureHandle())
- QSKIP("Requires XRender support");
-#endif
-
QPainter p(&destPm);
p.drawPixmap(0, 0, srcPm);
p.end();
diff --git a/tests/auto/gui/painting/qregion/tst_qregion.cpp b/tests/auto/gui/painting/qregion/tst_qregion.cpp
index 24c4583819..d1ea7706b9 100644
--- a/tests/auto/gui/painting/qregion/tst_qregion.cpp
+++ b/tests/auto/gui/painting/qregion/tst_qregion.cpp
@@ -33,9 +33,6 @@
#include <qbitmap.h>
#include <qpainter.h>
#include <qpolygon.h>
-#if 0 // Used to be included in Qt4 for Q_WS_X11
-#include <private/qt_x11_p.h>
-#endif
class tst_QRegion : public QObject
{
@@ -79,9 +76,6 @@ private slots:
void isEmpty_data();
void isEmpty();
-#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && defined(QT_BUILD_INTERNAL)
- void clipRectangles();
-#endif
void regionFromPath();
void scaleRegions_data();
@@ -910,24 +904,6 @@ void tst_QRegion::isEmpty()
#endif
}
-#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && defined(QT_BUILD_INTERNAL)
-void tst_QRegion::clipRectangles()
-{
- QRegion region(30, 30, 30, 30);
- int num = 0;
- qt_getClipRects(region, num);
- QCOMPARE(num, 1);
-
- region += QRegion(10, 10, 10, 10);
- XRectangle *rects2 = static_cast<XRectangle *>(qt_getClipRects(region, num));
- QCOMPARE(num, 2);
-
- // Here's the important part (Y-sorted):
- QCOMPARE(int(rects2[0].y), 10);
- QCOMPARE(int(rects2[1].y), 30);
-}
-#endif
-
void tst_QRegion::regionFromPath()
{
{
diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
index 8a38d0f517..e12f6d9c18 100644
--- a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
+++ b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp
@@ -606,9 +606,6 @@ void tst_QGLThreads::painterOnPixmapInThread()
if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL)
|| !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedPixmaps))
QSKIP("No platformsupport for ThreadedOpenGL or ThreadedPixmaps");
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- QSKIP("Drawing text in threads onto X11 drawables currently crashes on some X11 servers.");
-#endif
PaintThreadManager<PixmapWrapper> painterThreads(5);
painterThreads.start();
diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp
index dc71253f3e..032580e0f6 100644
--- a/tests/auto/other/lancelot/paintcommands.cpp
+++ b/tests/auto/other/lancelot/paintcommands.cpp
@@ -2478,12 +2478,6 @@ void PaintCommands::command_surface_begin(QRegularExpressionMatch re)
m_painter->fillRect(QRect(0, 0, qRound(w), qRound(h)), Qt::transparent);
m_painter->restore();
#endif
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- } else if (m_type == WidgetType) {
- m_surface_pixmap = QPixmap(qRound(w), qRound(h));
- m_surface_pixmap.fill(Qt::transparent);
- m_painter = new QPainter(&m_surface_pixmap);
-#endif
} else {
QImage::Format surface_format;
if (QImage::toPixelFormat(m_format).alphaUsage() != QPixelFormat::UsesAlpha)
@@ -2535,11 +2529,6 @@ void PaintCommands::command_surface_end(QRegularExpressionMatch)
m_painter->beginNativePainting();
m_painter->endNativePainting();
#endif
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- } else if (m_type == WidgetType) {
- m_painter->drawPixmap(m_surface_rect.topLeft(), m_surface_pixmap);
- m_surface_pixmap = QPixmap();
-#endif
} else {
m_painter->drawImage(m_surface_rect, m_surface_image);
m_surface_image = QImage();
diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
index 39aa65a478..a437b05479 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
@@ -2768,9 +2768,6 @@ void tst_QGraphicsProxyWidget::windowOpacity()
// disabled on platforms without alpha channel support in QPixmap (e.g.,
// X11 without XRender).
int paints = 0;
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- paints = !X11->use_xrender;
-#endif
QTRY_COMPARE(eventSpy.counts[QEvent::UpdateRequest], 0);
QTRY_COMPARE(eventSpy.counts[QEvent::Paint], paints);
diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
index 6f7dca86eb..bcfc477733 100644
--- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
+++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp
@@ -1024,9 +1024,6 @@ void tst_QAbstractItemView::setItemDelegate()
centerOnScreen(&v);
moveCursorAway(&v);
v.show();
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- QCursor::setPos(v.geometry().center());
-#endif
QApplication::setActiveWindow(&v);
QVERIFY(QTest::qWaitForWindowActive(&v));
diff --git a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
index b8abd78657..6d38dc262f 100644
--- a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
+++ b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
@@ -479,9 +479,6 @@ void tst_QMdiArea::subWindowActivated2()
// Check that we only emit _one_ signal and the active window
// is unchanged after hide/show.
mdiArea.hide();
-#if 0 // Used to be included in Qt4 for Q_WS_X11
- qt_x11_wait_for_window_manager(&mdiArea);
-#endif
QTest::qWait(100);
QTRY_COMPARE(spy.count(), 1);
QVERIFY(!mdiArea.activeSubWindow());
diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
index b8891fab95..3ee9c72209 100644
--- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
+++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
@@ -52,9 +52,7 @@
#include <QVector>
QT_BEGIN_NAMESPACE
-#if 1 // Used to be excluded in Qt4 for Q_WS_WIN
extern bool qt_tab_all_widgets();
-#endif
QT_END_NAMESPACE
static inline bool tabAllWidgets()