summaryrefslogtreecommitdiffstats
path: root/examples
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 /examples
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 'examples')
-rw-r--r--examples/qml/networkaccessmanagerfactory/main.cpp16
-rw-r--r--examples/quick/quickwidgets/quickwidget/fbitem.cpp4
-rw-r--r--examples/quick/scenegraph/rendernode/customrenderitem.cpp2
-rw-r--r--examples/quick/scenegraph/rendernode/openglrenderer.cpp4
-rw-r--r--examples/quick/scenegraph/rendernode/openglrenderer.h4
5 files changed, 15 insertions, 15 deletions
diff --git a/examples/qml/networkaccessmanagerfactory/main.cpp b/examples/qml/networkaccessmanagerfactory/main.cpp
index 55e00d6917..5b6b7681a9 100644
--- a/examples/qml/networkaccessmanagerfactory/main.cpp
+++ b/examples/qml/networkaccessmanagerfactory/main.cpp
@@ -56,10 +56,10 @@
networkaccessmanagerfactory [-host <proxy> -port <port>] [file]
*/
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
static QString proxyHost;
static int proxyPort = 0;
-#endif // !QT_NO_NETWORKPROXY
+#endif // networkproxy
class MyNetworkAccessManagerFactory : public QQmlNetworkAccessManagerFactory
{
@@ -70,13 +70,13 @@ public:
QNetworkAccessManager *MyNetworkAccessManagerFactory::create(QObject *parent)
{
QNetworkAccessManager *nam = new QNetworkAccessManager(parent);
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
if (!proxyHost.isEmpty()) {
qDebug() << "Created QNetworkAccessManager using proxy" << (proxyHost + ":" + QString::number(proxyPort));
QNetworkProxy proxy(QNetworkProxy::HttpCachingProxy, proxyHost, proxyPort);
nam->setProxy(proxy);
}
-#endif // !QT_NO_NETWORKPROXY
+#endif // networkproxy
return nam;
}
@@ -88,12 +88,12 @@ int main(int argc, char ** argv)
QGuiApplication app(argc, argv);
QCommandLineParser parser;
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
QCommandLineOption proxyHostOption("host", "The proxy host to use.", "host");
parser.addOption(proxyHostOption);
QCommandLineOption proxyPortOption("port", "The proxy port to use.", "port", "0");
parser.addOption(proxyPortOption);
-#endif // !QT_NO_NETWORKPROXY
+#endif // networkproxy
parser.addPositionalArgument("file", "The file to use.");
QCommandLineOption helpOption = parser.addHelpOption();
parser.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions);
@@ -106,7 +106,7 @@ int main(int argc, char ** argv)
qWarning() << parser.helpText();
exit(0);
}
-#ifndef QT_NO_NETWORKPROXY
+#if QT_CONFIG(networkproxy)
if (parser.isSet(proxyHostOption))
proxyHost = parser.value(proxyHostOption);
if (parser.isSet(proxyPortOption)) {
@@ -118,7 +118,7 @@ int main(int argc, char ** argv)
exit(1);
}
}
-#endif // !QT_NO_NETWORKPROXY
+#endif // networkproxy
if (parser.positionalArguments().count() == 1)
source = QUrl::fromLocalFile(parser.positionalArguments().first());
diff --git a/examples/quick/quickwidgets/quickwidget/fbitem.cpp b/examples/quick/quickwidgets/quickwidget/fbitem.cpp
index fc2a4ea7ad..cb3cc976fb 100644
--- a/examples/quick/quickwidgets/quickwidget/fbitem.cpp
+++ b/examples/quick/quickwidgets/quickwidget/fbitem.cpp
@@ -44,7 +44,7 @@
#include <QtGui/QOpenGLFunctions>
#include <QtCore/QDebug>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
class FbRenderer : public QQuickFramebufferObject::Renderer
{
public:
@@ -82,7 +82,7 @@ private:
QQuickFramebufferObject::Renderer *FbItem::createRenderer() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
return new FbRenderer;
#else
return nullptr;
diff --git a/examples/quick/scenegraph/rendernode/customrenderitem.cpp b/examples/quick/scenegraph/rendernode/customrenderitem.cpp
index a92a400922..27c55bf86d 100644
--- a/examples/quick/scenegraph/rendernode/customrenderitem.cpp
+++ b/examples/quick/scenegraph/rendernode/customrenderitem.cpp
@@ -62,7 +62,7 @@ QSGNode *CustomRenderItem::updatePaintNode(QSGNode *node, UpdatePaintNodeData *)
return nullptr;
switch (ri->graphicsApi()) {
case QSGRendererInterface::OpenGL:
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
n = new OpenGLRenderNode(this);
break;
#endif
diff --git a/examples/quick/scenegraph/rendernode/openglrenderer.cpp b/examples/quick/scenegraph/rendernode/openglrenderer.cpp
index 3de864b7b9..65c2a210bc 100644
--- a/examples/quick/scenegraph/rendernode/openglrenderer.cpp
+++ b/examples/quick/scenegraph/rendernode/openglrenderer.cpp
@@ -41,7 +41,7 @@
#include "openglrenderer.h"
#include <QQuickItem>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <QOpenGLShaderProgram>
#include <QOpenGLBuffer>
@@ -161,4 +161,4 @@ QRectF OpenGLRenderNode::rect() const
return QRect(0, 0, m_item->width(), m_item->height());
}
-#endif // QT_NO_OPENGL
+#endif // opengl
diff --git a/examples/quick/scenegraph/rendernode/openglrenderer.h b/examples/quick/scenegraph/rendernode/openglrenderer.h
index 92cc2bc72b..ea2bbcbc38 100644
--- a/examples/quick/scenegraph/rendernode/openglrenderer.h
+++ b/examples/quick/scenegraph/rendernode/openglrenderer.h
@@ -43,7 +43,7 @@
#include <qsgrendernode.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QT_BEGIN_NAMESPACE
@@ -75,6 +75,6 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_OPENGL
+#endif // opengl
#endif