aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2016-11-16 14:22:36 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2016-11-29 10:10:27 +0000
commite579076bb36e6594003b2ade7f3d062944ef6f47 (patch)
tree1c00c8a02c638582d342504f3bebd45dbcd46be1 /tests/auto
parent4e1463c20aa6ec52f23e1e5f6426b68edb2255f0 (diff)
Get rid of most QT_NO_FOO usages
Instead use QT_CONFIG(foo). This change actually detected a few mis-spelled macros and invalid usages. Change-Id: I06ac327098dd1a458e6bc379d637b8e2dac52f85 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp2
-rw-r--r--tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp6
-rw-r--r--tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp4
-rw-r--r--tests/auto/quick/examples/tst_examples.cpp2
-rw-r--r--tests/auto/quick/nokeywords/tst_nokeywords.cpp2
-rw-r--r--tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp4
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp2
-rw-r--r--tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp4
-rw-r--r--tests/auto/quick/qquickitem2/tst_qquickitem.cpp4
-rw-r--r--tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp6
-rw-r--r--tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp6
-rw-r--r--tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp4
-rw-r--r--tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp10
-rw-r--r--tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp14
-rw-r--r--tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp14
-rw-r--r--tests/auto/quick/qquickwindow/tst_qquickwindow.cpp22
-rw-r--r--tests/auto/quick/scenegraph/tst_scenegraph.cpp14
-rw-r--r--tests/auto/quick/shared/viewtestutil.cpp2
-rw-r--r--tests/auto/shared/platformquirks.h2
19 files changed, 62 insertions, 62 deletions
diff --git a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
index c4b17aa60a..692e70d7da 100644
--- a/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
+++ b/tests/auto/qml/debugger/qqmlprofilerservice/tst_qqmlprofilerservice.cpp
@@ -618,7 +618,7 @@ void tst_QQmlProfilerService::scenegraphData()
// if the clocks are acting up.
qint64 contextFrameTime = -1;
qint64 renderFrameTime = -1;
-#ifndef QT_NO_OPENGL //Software renderer doesn't have context frames
+#if QT_CONFIG(opengl) //Software renderer doesn't have context frames
foreach (const QQmlProfilerData &msg, m_client->asynchronousMessages) {
if (msg.messageType == QQmlProfilerDefinitions::SceneGraphFrame) {
if (msg.detailType == QQmlProfilerDefinitions::SceneGraphContextFrame) {
diff --git a/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp b/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp
index a401e04020..98b92e5fab 100644
--- a/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp
+++ b/tests/auto/qml/qqmlapplicationengine/tst_qqmlapplicationengine.cpp
@@ -96,7 +96,7 @@ void tst_qqmlapplicationengine::application()
Note that checking the output means that on builds with extra debugging, this might fail with a false positive.
Also the testapp is automatically built and installed in shadow builds, so it does NOT use testData
*/
-#ifndef QT_NO_PROCESS
+#if QT_CONFIG(process)
QDir::setCurrent(buildDir);
QProcess *testProcess = new QProcess(this);
QStringList args;
@@ -114,9 +114,9 @@ void tst_qqmlapplicationengine::application()
QVERIFY(QString(test_stderr).endsWith(QString(test_stderr_target)));
delete testProcess;
QDir::setCurrent(srcDir);
-#else // !QT_NO_PROCESS
+#else // process
QSKIP("No process support");
-#endif // QT_NO_PROCESS
+#endif // process
}
void tst_qqmlapplicationengine::applicationProperties()
diff --git a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
index 9e915ac451..163ce11cb8 100644
--- a/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
+++ b/tests/auto/qml/qqmlvaluetypes/tst_qqmlvaluetypes.cpp
@@ -323,7 +323,7 @@ void tst_qqmlvaluetypes::locale()
QScopedPointer<QObject> object(component.create());
QVERIFY(!object.isNull());
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
QVERIFY(QQml_guiProvider()->inputMethod());
QInputMethod *inputMethod = qobject_cast<QInputMethod*>(QQml_guiProvider()->inputMethod());
QLocale locale = inputMethod->locale();
@@ -350,7 +350,7 @@ void tst_qqmlvaluetypes::locale()
}
QCOMPARE(weekDays, locale.weekdays());
QCOMPARE(object->property("zeroDigit").toString().at(0), locale.zeroDigit());
-#endif // QT_NO_IM
+#endif // im
}
}
diff --git a/tests/auto/quick/examples/tst_examples.cpp b/tests/auto/quick/examples/tst_examples.cpp
index 872a71011d..1ca809c05f 100644
--- a/tests/auto/quick/examples/tst_examples.cpp
+++ b/tests/auto/quick/examples/tst_examples.cpp
@@ -103,7 +103,7 @@ tst_examples::tst_examples()
excludedFiles << "views/visualdatamodel/slideshow.qml";
#endif
-#ifdef QT_NO_OPENGL
+#if !QT_CONFIG(opengl)
//No support for Particles
excludedFiles << "examples/qml/dynamicscene/dynamicscene.qml";
excludedFiles << "examples/quick/animation/basics/color-animation.qml";
diff --git a/tests/auto/quick/nokeywords/tst_nokeywords.cpp b/tests/auto/quick/nokeywords/tst_nokeywords.cpp
index 6c94b484ae..ad77743ddd 100644
--- a/tests/auto/quick/nokeywords/tst_nokeywords.cpp
+++ b/tests/auto/quick/nokeywords/tst_nokeywords.cpp
@@ -48,7 +48,7 @@
#include <QtQuick/private/qsgadaptationlayer_p.h>
#include <QtQuick/private/qsgcontext_p.h>
#include <QtQuick/private/qsgcontextplugin_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <QtQuick/private/qsgdefaultdistancefieldglyphcache_p.h>
#include <QtQuick/private/qsgdefaultglyphnode_p.h>
#include <QtQuick/private/qsgdefaultinternalimagenode_p.h>
diff --git a/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp b/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
index 5d242fab9e..71b0160c8e 100644
--- a/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
+++ b/tests/auto/quick/qquickborderimage/tst_qquickborderimage.cpp
@@ -76,7 +76,7 @@ private slots:
void statusChanges_data();
void sourceSizeChanges();
void progressAndStatusChanges();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void borderImageMesh();
#endif
@@ -583,7 +583,7 @@ void tst_qquickborderimage::progressAndStatusChanges()
delete obj;
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void tst_qquickborderimage::borderImageMesh()
{
QQuickView *window = new QQuickView;
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index b774481592..942e99018f 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -1225,7 +1225,7 @@ void tst_qquickflickable::flickOnRelease()
QTRY_VERIFY(!flickable->isMoving());
#ifdef Q_OS_MAC
-# ifndef QT_NO_OPENGL
+# if QT_CONFIG(opengl)
QEXPECT_FAIL("", "QTBUG-26094 stopping on a full pixel doesn't work on OS X", Continue);
# endif
#endif
diff --git a/tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp b/tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp
index 256fa43d2e..650892d650 100644
--- a/tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp
+++ b/tests/auto/quick/qquickgraphicsinfo/tst_qquickgraphicsinfo.cpp
@@ -35,7 +35,7 @@
#include "../../shared/util.h"
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <QtGui/qopenglcontext.h>
#include <QtGui/qsurfaceformat.h>
#endif
@@ -67,7 +67,7 @@ void tst_QQuickGraphicsInfo::testProperties()
QCOMPARE(obj->property("api").toInt(), expectedAPI);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (expectedAPI == QSGRendererInterface::OpenGL) {
QCOMPARE(obj->property("shaderType").toInt(), int(QSGRendererInterface::GLSL));
QVERIFY(view.openglContext());
diff --git a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
index 78322b44a1..cc74b7e07d 100644
--- a/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem2/tst_qquickitem.cpp
@@ -3133,7 +3133,7 @@ void tst_QQuickItem::parentLoop()
{
QQuickView *window = new QQuickView(0);
-#ifndef QT_NO_REGULAREXPRESSION
+#if QT_CONFIG(regularexpression)
QRegularExpression msgRegexp = QRegularExpression("QQuickItem::setParentItem: Parent QQuickItem\\(.*\\) is already part of the subtree of QQuickItem\\(.*\\)");
QTest::ignoreMessage(QtWarningMsg, msgRegexp);
#endif
@@ -3304,7 +3304,7 @@ void tst_QQuickItem::grab()
QVERIFY(root);
QQuickItem *item = root->findChild<QQuickItem *>("myItem");
QVERIFY(item);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
{ // Default size (item is 100x100)
QSharedPointer<QQuickItemGrabResult> result = item->grabToImage();
QSignalSpy spy(result.data(), SIGNAL(ready()));
diff --git a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp
index 2576a1b0fc..44310008d6 100644
--- a/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp
+++ b/tests/auto/quick/qquickitemlayer/tst_qquickitemlayer.cpp
@@ -61,7 +61,7 @@ private slots:
void initTestCase() Q_DECL_OVERRIDE;
void layerEnabled();
void layerSmooth();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void layerMipmap();
void layerEffect();
#endif
@@ -105,7 +105,7 @@ tst_QQuickItemLayer::tst_QQuickItemLayer()
void tst_QQuickItemLayer::initTestCase()
{
QQmlDataTest::initTestCase();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QWindow window;
QOpenGLContext context;
window.setSurfaceType(QWindow::OpenGLSurface);
@@ -177,7 +177,7 @@ void tst_QQuickItemLayer::layerEnabled()
QVERIFY(fb.pixel(0, 0) != fb.pixel(0, fb.height() - 1));
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
// The test draws a one pixel wide line and scales it down by more than a a factor 2
// If mipmpping works, the pixels should be gray, not white or black
diff --git a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
index f22528a8a0..e1f903123b 100644
--- a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
+++ b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
@@ -59,7 +59,7 @@ static bool initView(QQuickView &v, const QUrl &url, bool moveMouseOut, QByteArr
const QSize size = v.size();
const QPoint offset = QPoint(size.width() / 2, size.height() / 2);
v.setFramePosition(screenGeometry.center() - offset);
-#ifndef QT_NO_CURSOR // Get the cursor out of the way.
+#if QT_CONFIG(cursor) // Get the cursor out of the way.
if (moveMouseOut)
QCursor::setPos(v.geometry().topRight() + QPoint(100, 100));
#else
@@ -116,7 +116,7 @@ private slots:
void pressedMultipleButtons_data();
void pressedMultipleButtons();
void changeAxis();
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
void cursorShape();
#endif
void moveAndReleaseWithoutPress();
@@ -1692,7 +1692,7 @@ void tst_QQuickMouseArea::changeAxis()
QCOMPARE(blackRect->y(), 94.0);
}
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
void tst_QQuickMouseArea::cursorShape()
{
QQmlEngine engine;
diff --git a/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp b/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp
index 44d7b40ed9..1716bdeafb 100644
--- a/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp
+++ b/tests/auto/quick/qquickpainteditem/tst_qquickpainteditem.cpp
@@ -32,7 +32,7 @@
#include <QtQuick/qquickview.h>
#include <private/qquickitem_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <private/qsgdefaultpainternode_p.h>
#else
#include <private/qsgsoftwarepainternode_p.h>
@@ -73,7 +73,7 @@ public:
++paintRequests;
clipRect = painter->clipBoundingRect();
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data)
{
paintNode = static_cast<QSGDefaultPainterNode *>(QQuickPaintedItem::updatePaintNode(oldNode, data));
diff --git a/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp b/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
index 80c6c9e553..e854a109a1 100644
--- a/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
+++ b/tests/auto/quick/qquickpixmapcache/tst_qquickpixmapcache.cpp
@@ -35,7 +35,7 @@
#include "testhttpserver.h"
#include <QtNetwork/QNetworkConfigurationManager>
-#ifndef QT_NO_CONCURRENT
+#if QT_CONFIG(concurrent)
#include <qtconcurrentrun.h>
#include <qfuture.h>
#endif
@@ -57,7 +57,7 @@ private slots:
void massive();
void cancelcrash();
void shrinkcache();
-#ifndef QT_NO_CONCURRENT
+#if QT_CONFIG(concurrent)
void networkCrash();
#endif
void lockingCrash();
@@ -105,7 +105,7 @@ void tst_qquickpixmapcache::initTestCase()
QVERIFY2(server.listen(), qPrintable(server.errorString()));
-#ifndef QT_NO_BEARERMANAGEMENT
+#if QT_CONFIG(bearermanagement)
// This avoids a race condition/deadlock bug in network config
// manager when it is accessed by the HTTP server thread before
// anything else. Bug report can be found at:
@@ -372,7 +372,7 @@ void tst_qquickpixmapcache::shrinkcache()
}
}
-#ifndef QT_NO_CONCURRENT
+#if QT_CONFIG(concurrent)
void createNetworkServer(TestHTTPServer *server)
{
@@ -382,7 +382,7 @@ void createNetworkServer(TestHTTPServer *server)
eventLoop.exec();
}
-#ifndef QT_NO_CONCURRENT
+#if QT_CONFIG(concurrent)
// QT-3957
void tst_qquickpixmapcache::networkCrash()
{
diff --git a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
index 5d30cc8c94..765523316f 100644
--- a/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
+++ b/tests/auto/quick/qquicktextedit/tst_qquicktextedit.cpp
@@ -143,7 +143,7 @@ private slots:
void cursorDelegateHeight();
void navigation();
void readOnly();
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void copyAndPaste();
void canPaste();
void canPasteEmpty();
@@ -153,7 +153,7 @@ private slots:
void inputMethodUpdate();
void openInputPanel();
void geometrySignals();
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void pastingRichText_QTBUG_14003();
#endif
void implicitSize_data();
@@ -2924,7 +2924,7 @@ void tst_qquicktextedit::navigation()
QCOMPARE(input->hasActiveFocus(), false);
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextedit::copyAndPaste()
{
if (!PlatformQuirks::isClipboardAvailable())
@@ -3001,7 +3001,7 @@ void tst_qquicktextedit::copyAndPaste()
}
#endif
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextedit::canPaste()
{
QGuiApplication::clipboard()->setText("Some text");
@@ -3019,7 +3019,7 @@ void tst_qquicktextedit::canPaste()
}
#endif
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextedit::canPasteEmpty()
{
QGuiApplication::clipboard()->clear();
@@ -3037,7 +3037,7 @@ void tst_qquicktextedit::canPasteEmpty()
}
#endif
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextedit::middleClickPaste()
{
if (!PlatformQuirks::isClipboardAvailable())
@@ -3339,7 +3339,7 @@ void tst_qquicktextedit::geometrySignals()
delete o;
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextedit::pastingRichText_QTBUG_14003()
{
QString componentStr = "import QtQuick 2.0\nTextEdit { textFormat: TextEdit.PlainText }";
diff --git a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
index 8dc3053d89..1451f8e2fc 100644
--- a/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
+++ b/tests/auto/quick/qquicktextinput/tst_qquicktextinput.cpp
@@ -145,7 +145,7 @@ private slots:
void cursorRectangle();
void navigation();
void navigation_RTL();
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void copyAndPaste();
void copyAndPasteKeySequence();
void canPasteEmpty();
@@ -2532,7 +2532,7 @@ void tst_qquicktextinput::navigation_RTL()
QVERIFY(input->hasActiveFocus());
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextinput::copyAndPaste()
{
if (!PlatformQuirks::isClipboardAvailable())
@@ -2630,7 +2630,7 @@ void tst_qquicktextinput::copyAndPaste()
}
#endif
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextinput::copyAndPasteKeySequence()
{
if (!PlatformQuirks::isClipboardAvailable())
@@ -2698,7 +2698,7 @@ void tst_qquicktextinput::copyAndPasteKeySequence()
}
#endif
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextinput::canPasteEmpty()
{
QGuiApplication::clipboard()->clear();
@@ -2714,7 +2714,7 @@ void tst_qquicktextinput::canPasteEmpty()
}
#endif
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextinput::canPaste()
{
QGuiApplication::clipboard()->setText("Some text");
@@ -2730,7 +2730,7 @@ void tst_qquicktextinput::canPaste()
}
#endif
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void tst_qquicktextinput::middleClickPaste()
{
if (!PlatformQuirks::isClipboardAvailable())
@@ -3052,7 +3052,7 @@ void tst_qquicktextinput::cursorRectangle_data()
<< false;
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
#define COMPARE_INPUT_METHOD_QUERY(type, input, property, method, result) \
QCOMPARE((type) input->inputMethodQuery(property).method(), result);
#else
diff --git a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
index acccac8eca..8d021d92da 100644
--- a/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
+++ b/tests/auto/quick/qquickwindow/tst_qquickwindow.cpp
@@ -284,7 +284,7 @@ public:
private slots:
void cleanup();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void openglContextCreatedSignal();
#endif
void aboutToStopSignal();
@@ -350,7 +350,7 @@ private slots:
void qobjectEventFilter_key();
void qobjectEventFilter_mouse();
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
void cursor();
#endif
@@ -373,14 +373,14 @@ private:
QTouchDevice *touchDevice;
QTouchDevice *touchDeviceWithVelocity;
};
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
Q_DECLARE_METATYPE(QOpenGLContext *);
#endif
void tst_qquickwindow::cleanup()
{
QVERIFY(QGuiApplication::topLevelWindows().isEmpty());
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void tst_qquickwindow::openglContextCreatedSignal()
{
qRegisterMetaType<QOpenGLContext *>();
@@ -1327,7 +1327,7 @@ void tst_qquickwindow::headless()
if (isGL)
QVERIFY(!window->isSceneGraphInitialized());
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (QGuiApplication::platformName() == QLatin1String("windows")
&& QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES) {
QSKIP("Crashes on Windows/ANGLE, QTBUG-42967");
@@ -1515,7 +1515,7 @@ void tst_qquickwindow::ownershipRootItem()
QVERIFY(!accessor->isRootItemDestroyed());
}
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
void tst_qquickwindow::cursor()
{
QQuickWindow window;
@@ -1688,7 +1688,7 @@ void tst_qquickwindow::hideThenDelete()
QTest::qWaitForWindowExposed(&window);
const bool threaded = QQuickWindowPrivate::get(&window)->context->thread() != QGuiApplication::instance()->thread();
const bool isGL = window.rendererInterface()->graphicsApi() == QSGRendererInterface::OpenGL;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (isGL)
openglDestroyed = new QSignalSpy(window.openglContext(), SIGNAL(aboutToBeDestroyed()));
#endif
@@ -1717,7 +1717,7 @@ void tst_qquickwindow::hideThenDelete()
}
QVERIFY(sgInvalidated->size() > 0);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (openglDestroyed)
QVERIFY(openglDestroyed->size() > 0);
#endif
@@ -2128,7 +2128,7 @@ void tst_qquickwindow::defaultSurfaceFormat()
QCOMPARE(format.profile(), reqFmt.profile());
QCOMPARE(int(format.options()), int(reqFmt.options()));
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
// Depth and stencil should be >= what has been requested. For real. But use
// the context since the window's surface format is only partially updated
// on most platforms.
@@ -2183,7 +2183,7 @@ public:
}
static int deleted;
};
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
class GlRenderJob : public QRunnable
{
public:
@@ -2254,7 +2254,7 @@ void tst_qquickwindow::testRenderJob()
QTRY_COMPARE(RenderJob::deleted, 1);
QCOMPARE(completedJobs.size(), 1);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (window.rendererInterface()->graphicsApi() == QSGRendererInterface::OpenGL) {
// Do a synchronized GL job.
GLubyte readPixel[4] = {0, 0, 0, 0};
diff --git a/tests/auto/quick/scenegraph/tst_scenegraph.cpp b/tests/auto/quick/scenegraph/tst_scenegraph.cpp
index f6d624d871..2cd3a041c8 100644
--- a/tests/auto/quick/scenegraph/tst_scenegraph.cpp
+++ b/tests/auto/quick/scenegraph/tst_scenegraph.cpp
@@ -28,7 +28,7 @@
#include <qtest.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <QOffscreenSurface>
#include <QOpenGLContext>
#include <QOpenGLFunctions>
@@ -37,7 +37,7 @@
#include <QtQuick>
#include <QtQml>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <private/qopenglcontext_p.h>
#endif
@@ -105,7 +105,7 @@ private slots:
void render_data();
void render();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void hideWithOtherContext();
#endif
void createTextureFromImage_data();
@@ -130,7 +130,7 @@ void tst_SceneGraph::initTestCase()
QSGRenderLoop *loop = QSGRenderLoop::instance();
qDebug() << "RenderLoop: " << loop;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QOpenGLContext context;
context.setFormat(loop->sceneGraphContext()->defaultSurfaceFormat());
context.create();
@@ -222,7 +222,7 @@ void tst_SceneGraph::manyWindows_data()
QTest::newRow("rects,subwindow,sharing") << QStringLiteral("manyWindows_rects.qml") << false << true;
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
struct ShareContextResetter {
public:
~ShareContextResetter() { qt_gl_set_global_share_context(0); }
@@ -234,7 +234,7 @@ void tst_SceneGraph::manyWindows()
QFETCH(QString, file);
QFETCH(bool, toplevel);
QFETCH(bool, shared);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QOpenGLContext sharedGLContext;
ShareContextResetter cleanup; // To avoid dangling pointer in case of test-failure.
if (shared) {
@@ -479,7 +479,7 @@ void tst_SceneGraph::render()
}
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
// Testcase for QTBUG-34898. We make another context current on another surface
// in the GUI thread and hide the QQuickWindow while the other context is
// current on the other window.
diff --git a/tests/auto/quick/shared/viewtestutil.cpp b/tests/auto/quick/shared/viewtestutil.cpp
index ab58aee648..cb2b8be97a 100644
--- a/tests/auto/quick/shared/viewtestutil.cpp
+++ b/tests/auto/quick/shared/viewtestutil.cpp
@@ -61,7 +61,7 @@ void QQuickViewTestUtil::centerOnScreen(QQuickView *window)
void QQuickViewTestUtil::moveMouseAway(QQuickView *window)
{
-#ifndef QT_NO_CURSOR // Get the cursor out of the way.
+#if QT_CONFIG(cursor) // Get the cursor out of the way.
QCursor::setPos(window->geometry().topRight() + QPoint(100, 100));
#else
Q_UNUSED(window)
diff --git a/tests/auto/shared/platformquirks.h b/tests/auto/shared/platformquirks.h
index 5e4929230a..5252e8cfe2 100644
--- a/tests/auto/shared/platformquirks.h
+++ b/tests/auto/shared/platformquirks.h
@@ -39,7 +39,7 @@ struct PlatformQuirks
{
static inline bool isClipboardAvailable()
{
-#if defined(QT_NO_CLIPBOARD)
+#if !QT_CONFIG(clipboard)
return false;
#elif defined(Q_OS_OSX)
PasteboardRef pasteboard;