aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickwidgets
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 /src/quickwidgets
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 'src/quickwidgets')
-rw-r--r--src/quickwidgets/qquickwidget.cpp42
-rw-r--r--src/quickwidgets/qquickwidget.h4
-rw-r--r--src/quickwidgets/qquickwidget_p.h4
3 files changed, 25 insertions, 25 deletions
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index 1d617f5098..ed7f7a0ca6 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -59,7 +59,7 @@
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/qpa/qplatformintegration.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLFunctions>
#include <QtGui/private/qopenglextensions_p.h>
@@ -76,7 +76,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
extern Q_GUI_EXPORT QImage qt_gl_read_framebuffer(const QSize &size, bool alpha_format, bool include_alpha);
#endif
@@ -108,7 +108,7 @@ void QQuickWidgetPrivate::init(QQmlEngine* e)
useSoftwareRenderer = true;
if (!useSoftwareRenderer) {
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::RasterGLSurface))
setRenderToTexture();
else
@@ -121,7 +121,7 @@ void QQuickWidgetPrivate::init(QQmlEngine* e)
if (!engine.isNull() && !engine.data()->incubationController())
engine.data()->setIncubationController(offscreenWindow->incubationController());
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
q->setAcceptDrops(true);
#endif
@@ -143,7 +143,7 @@ void QQuickWidgetPrivate::ensureEngine() const
void QQuickWidgetPrivate::invalidateRenderControl()
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (!useSoftwareRenderer) {
if (!context) // this is not an error, could be called before creating the context, or multiple times
return;
@@ -183,7 +183,7 @@ QQuickWidgetPrivate::QQuickWidgetPrivate()
, offscreenWindow(0)
, offscreenSurface(0)
, renderControl(0)
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
, fbo(0)
, resolvedFbo(0)
, context(0)
@@ -206,7 +206,7 @@ QQuickWidgetPrivate::~QQuickWidgetPrivate()
delete renderControl;
delete offscreenWindow;
} else {
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
// context and offscreenSurface are current at this stage, if the context was created.
Q_ASSERT(!context || (QOpenGLContext::currentContext() == context && context->surface() == offscreenSurface));
delete renderControl; // always delete the rendercontrol first
@@ -258,7 +258,7 @@ void QQuickWidgetPrivate::itemGeometryChanged(QQuickItem *resizeItem, QQuickGeom
void QQuickWidgetPrivate::render(bool needsSync)
{
if (!useSoftwareRenderer) {
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
// createFramebufferObject() bails out when the size is empty. In this case
// we cannot render either.
if (!fbo)
@@ -327,7 +327,7 @@ void QQuickWidgetPrivate::renderSceneGraph()
render(true);
-#ifndef QT_NO_GRAPHICSVIEW
+#if QT_CONFIG(graphicsview)
if (q->window()->graphicsProxyWidget())
QWidgetPrivate::nearestGraphicsProxyWidget(q)->update();
else
@@ -343,7 +343,7 @@ void QQuickWidgetPrivate::renderSceneGraph()
QImage QQuickWidgetPrivate::grabFramebuffer()
{
if (!useSoftwareRenderer) {
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (!context)
return QImage();
@@ -835,7 +835,7 @@ void QQuickWidgetPrivate::handleContextCreationFailure(const QSurfaceFormat &for
// Never called by Software Rendering backend
void QQuickWidgetPrivate::createContext()
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
Q_Q(QQuickWidget);
// On hide-show we may invalidate() (when !isPersistentSceneGraph) but our
@@ -886,7 +886,7 @@ void QQuickWidgetPrivate::destroyContext()
{
delete offscreenSurface;
offscreenSurface = 0;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
delete context;
context = 0;
#endif
@@ -914,7 +914,7 @@ void QQuickWidget::createFramebufferObject()
return;
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QOpenGLContext *context = d->offscreenWindow->openglContext();
if (!context) {
@@ -995,7 +995,7 @@ void QQuickWidget::destroyFramebufferObject()
return;
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
delete d->fbo;
d->fbo = 0;
delete d->resolvedFbo;
@@ -1078,7 +1078,7 @@ void QQuickWidgetPrivate::setRootObject(QObject *obj)
}
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
GLuint QQuickWidgetPrivate::textureId() const
{
Q_Q(const QQuickWidget);
@@ -1180,7 +1180,7 @@ void QQuickWidget::resizeEvent(QResizeEvent *e)
createFramebufferObject();
}
} else {
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (d->context) {
// Bail out when receiving a resize after scenegraph invalidation. This can happen
// during hide - resize - show sequences and also during application exit.
@@ -1335,7 +1335,7 @@ void QQuickWidget::mouseReleaseEvent(QMouseEvent *e)
e->setAccepted(mappedEvent.isAccepted());
}
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
/*! \reimp */
void QQuickWidget::wheelEvent(QWheelEvent *e)
{
@@ -1408,14 +1408,14 @@ bool QQuickWidget::event(QEvent *e)
d->offscreenWindow->setScreen(newScreen);
if (d->offscreenSurface)
d->offscreenSurface->setScreen(newScreen);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (d->context)
d->context->setScreen(newScreen);
#endif
}
if (d->useSoftwareRenderer
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
|| d->fbo
#endif
) {
@@ -1442,7 +1442,7 @@ bool QQuickWidget::event(QEvent *e)
return QWidget::event(e);
}
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
/*! \reimp */
void QQuickWidget::dragEnterEvent(QDragEnterEvent *e)
@@ -1477,7 +1477,7 @@ void QQuickWidget::dropEvent(QDropEvent *e)
d->offscreenWindow->event(e);
}
-#endif // QT_NO_DRAGANDDROP
+#endif // draganddrop
// TODO: try to separate the two cases of
// 1. render() unconditionally without sync
diff --git a/src/quickwidgets/qquickwidget.h b/src/quickwidgets/qquickwidget.h
index 56e6b01ac5..2d159778ed 100644
--- a/src/quickwidgets/qquickwidget.h
+++ b/src/quickwidgets/qquickwidget.h
@@ -131,11 +131,11 @@ protected:
void focusInEvent(QFocusEvent * event) override;
void focusOutEvent(QFocusEvent * event) override;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *) override;
#endif
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
void dragEnterEvent(QDragEnterEvent *) override;
void dragMoveEvent(QDragMoveEvent *) override;
void dragLeaveEvent(QDragLeaveEvent *) override;
diff --git a/src/quickwidgets/qquickwidget_p.h b/src/quickwidgets/qquickwidget_p.h
index 0ba86172e6..559321cd51 100644
--- a/src/quickwidgets/qquickwidget_p.h
+++ b/src/quickwidgets/qquickwidget_p.h
@@ -101,7 +101,7 @@ public:
QObject *focusObject() Q_DECL_OVERRIDE;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
GLuint textureId() const Q_DECL_OVERRIDE;
QImage grabFramebuffer() Q_DECL_OVERRIDE;
#else
@@ -126,7 +126,7 @@ public:
QOffscreenSurface *offscreenSurface;
QQuickRenderControl *renderControl;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QOpenGLFramebufferObject *fbo;
QOpenGLFramebufferObject *resolvedFbo;
QOpenGLContext *context;