diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-10-13 15:54:23 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-10-14 08:19:29 +0000 |
commit | 6a35e77ef3f4eae80ca49937c680836eb4acdbe6 (patch) | |
tree | 12462105731748d75d1fa1b7b45daf586b402413 /tests/auto | |
parent | dcf7da7c93c0d974bfb72ffa677a1d26fb9be5e0 (diff) | |
download | qtbase-6a35e77ef3f4eae80ca49937c680836eb4acdbe6.tar.gz |
Change confusing Q_DEAD_CODE_FROM_QT4_FOO define
Commit c5db8fc74 changed all instances of Q_WS_FOO to have the prefix
Q_DEAD_CODE_FROM_QT4 instead, to make it clearer when reading the code
that the code in question was a left-over from Qt4, when we used
Q_WS_ defines instead of Q_OS_ defines.
This worked well for cases of #ifdef Q_DEAD_CODE_FROM_QT4, but less so
for cases of #ifndef Q_DEAD_CODE_FROM_QT4, where the code was actually
unconditionally included.
To make this even clearer, the defines have been replaced by checks for
1 or 0, with a comment describing how the code used to look in Qt4. The
use of constants in the check also makes it easier for editors to parse
the condition and show visually that the code is defined out.
Change-Id: I152070d87334df7259b417cd5e17d7b7950379b7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tests/auto')
10 files changed, 16 insertions, 16 deletions
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp index c349d0df09..895f68bbd7 100644 --- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp @@ -262,7 +262,7 @@ void tst_QPixmap::fromImage() image.fill(0x7f7f7f7f); const QPixmap pixmap = QPixmap::fromImage(image); -#ifdef Q_DEAD_CODE_FROM_QT4_X11 +#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 @@ -486,7 +486,7 @@ void tst_QPixmap::fill() else pm = QPixmap(400, 400); -#if defined(Q_DEAD_CODE_FROM_QT4_X11) +#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 @@ -516,7 +516,7 @@ void tst_QPixmap::fill() void tst_QPixmap::fill_transparent() { QPixmap pixmap(10, 10); -#ifdef Q_DEAD_CODE_FROM_QT4_X11 +#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 diff --git a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp index ab893385e3..9dd9ab05e8 100644 --- a/tests/auto/gui/painting/qcolor/tst_qcolor.cpp +++ b/tests/auto/gui/painting/qcolor/tst_qcolor.cpp @@ -107,7 +107,7 @@ private slots: void qrgba64Premultiply(); void qrgba64Equivalence(); -#ifdef Q_DEAD_CODE_FROM_QT4_X11 +#if 0 // Used to be included in Qt4 for Q_WS_X11 void setallowX11ColorNames(); #endif }; @@ -1403,7 +1403,7 @@ void tst_QColor::achromaticHslHue() QCOMPARE(hsl.hslHue(), -1); } -#ifdef Q_DEAD_CODE_FROM_QT4_X11 +#if 0 // Used to be included in Qt4 for Q_WS_X11 void tst_QColor::setallowX11ColorNames() { #if defined(Q_OS_IRIX) diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp index 1bd7f67810..8a9c4ca84e 100644 --- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp @@ -497,7 +497,7 @@ void tst_QPainter::drawPixmap_comp() destPm.fill(c1); srcPm.fill(c2); -#if defined(Q_DEAD_CODE_FROM_QT4_X11) +#if 0 // Used to be included in Qt4 for Q_WS_X11 if (!destPm.x11PictureHandle()) QSKIP("Requires XRender support"); #endif diff --git a/tests/auto/gui/painting/qregion/tst_qregion.cpp b/tests/auto/gui/painting/qregion/tst_qregion.cpp index 6a297dbfc2..b20ad0f33c 100644 --- a/tests/auto/gui/painting/qregion/tst_qregion.cpp +++ b/tests/auto/gui/painting/qregion/tst_qregion.cpp @@ -33,7 +33,7 @@ #include <qbitmap.h> #include <qpainter.h> #include <qpolygon.h> -#ifdef Q_DEAD_CODE_FROM_QT4_X11 +#if 0 // Used to be included in Qt4 for Q_WS_X11 #include <private/qt_x11_p.h> #endif @@ -79,7 +79,7 @@ private slots: void isEmpty_data(); void isEmpty(); -#if defined(Q_DEAD_CODE_FROM_QT4_X11) && defined(QT_BUILD_INTERNAL) +#if 0 /* Used to be included in Qt4 for Q_WS_X11 */ && defined(QT_BUILD_INTERNAL) void clipRectangles(); #endif @@ -893,7 +893,7 @@ void tst_QRegion::isEmpty() QVERIFY(region.rects().isEmpty()); } -#if defined(Q_DEAD_CODE_FROM_QT4_X11) && defined(QT_BUILD_INTERNAL) +#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); diff --git a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp index b60be15754..ce895f734a 100644 --- a/tests/auto/opengl/qglthreads/tst_qglthreads.cpp +++ b/tests/auto/opengl/qglthreads/tst_qglthreads.cpp @@ -726,7 +726,7 @@ void tst_QGLThreads::painterOnPixmapInThread() if (!QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL) || !QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedPixmaps)) QSKIP("No platformsupport for ThreadedOpenGL or ThreadedPixmaps"); -#ifdef Q_DEAD_CODE_FROM_QT4_X11 +#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); diff --git a/tests/auto/other/lancelot/paintcommands.cpp b/tests/auto/other/lancelot/paintcommands.cpp index 8d6886a6c6..2e6cb09aa5 100644 --- a/tests/auto/other/lancelot/paintcommands.cpp +++ b/tests/auto/other/lancelot/paintcommands.cpp @@ -2393,7 +2393,7 @@ void PaintCommands::command_surface_begin(QRegExp re) m_painter->fillRect(QRect(0, 0, qRound(w), qRound(h)), Qt::transparent); m_painter->restore(); #endif -#ifdef Q_DEAD_CODE_FROM_QT4_X11 +#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); @@ -2444,7 +2444,7 @@ void PaintCommands::command_surface_end(QRegExp) m_painter->beginNativePainting(); m_painter->endNativePainting(); #endif -#ifdef Q_DEAD_CODE_FROM_QT4_X11 +#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(); diff --git a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp index 01708d526c..d99c056abe 100644 --- a/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp +++ b/tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp @@ -2775,7 +2775,7 @@ void tst_QGraphicsProxyWidget::windowOpacity() // disabled on platforms without alpha channel support in QPixmap (e.g., // X11 without XRender). int paints = 0; -#ifdef Q_DEAD_CODE_FROM_QT4_X11 +#if 0 // Used to be included in Qt4 for Q_WS_X11 paints = !X11->use_xrender; #endif QTRY_COMPARE(eventSpy.counts[QEvent::UpdateRequest], 0); diff --git a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp index 30c1b9c44b..5567641dde 100644 --- a/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/widgets/itemviews/qabstractitemview/tst_qabstractitemview.cpp @@ -1000,7 +1000,7 @@ void tst_QAbstractItemView::setItemDelegate() centerOnScreen(&v); moveCursorAway(&v); v.show(); -#ifdef Q_DEAD_CODE_FROM_QT4_X11 +#if 0 // Used to be included in Qt4 for Q_WS_X11 QCursor::setPos(v.geometry().center()); #endif QApplication::setActiveWindow(&v); diff --git a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp index 2b8f3032bf..52d7a39406 100644 --- a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp +++ b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp @@ -474,7 +474,7 @@ void tst_QMdiArea::subWindowActivated2() // Check that we only emit _one_ signal and the active window // is unchanged after hide/show. mdiArea.hide(); -#ifdef Q_DEAD_CODE_FROM_QT4_X11 +#if 0 // Used to be included in Qt4 for Q_WS_X11 qt_x11_wait_for_window_manager(&mdiArea); #endif QTest::qWait(100); diff --git a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp index 76c3ac4143..a9d8c48d63 100644 --- a/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp +++ b/tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp @@ -49,7 +49,7 @@ #include <QSizeGrip> QT_BEGIN_NAMESPACE -#if !defined(Q_DEAD_CODE_FROM_QT4_WIN) +#if 1 // Used to be excluded in Qt4 for Q_WS_WIN extern bool qt_tab_all_widgets(); #endif QT_END_NAMESPACE |