aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items')
-rw-r--r--src/quick/items/context2d/qquickcanvasitem.cpp2
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp14
-rw-r--r--src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp2
-rw-r--r--src/quick/items/context2d/qquickcontext2dtexture.cpp10
-rw-r--r--src/quick/items/context2d/qquickcontext2dtexture_p.h8
-rw-r--r--src/quick/items/context2d/qquickcontext2dtile.cpp4
-rw-r--r--src/quick/items/context2d/qquickcontext2dtile_p.h4
-rw-r--r--src/quick/items/qquickaccessibleattached.cpp2
-rw-r--r--src/quick/items/qquickaccessibleattached_p.h4
-rw-r--r--src/quick/items/qquickdrag.cpp4
-rw-r--r--src/quick/items/qquickdrag_p.h4
-rw-r--r--src/quick/items/qquickdroparea.cpp4
-rw-r--r--src/quick/items/qquickdroparea_p.h4
-rw-r--r--src/quick/items/qquickflickable.cpp2
-rw-r--r--src/quick/items/qquickflickable_p.h2
-rw-r--r--src/quick/items/qquickgraphicsinfo.cpp2
-rw-r--r--src/quick/items/qquickitem.cpp68
-rw-r--r--src/quick/items/qquickitem.h14
-rw-r--r--src/quick/items/qquickitem_p.h10
-rw-r--r--src/quick/items/qquickitemsmodule.cpp8
-rw-r--r--src/quick/items/qquickmousearea.cpp30
-rw-r--r--src/quick/items/qquickmousearea_p.h12
-rw-r--r--src/quick/items/qquickmousearea_p_p.h4
-rw-r--r--src/quick/items/qquickpainteditem.cpp2
-rw-r--r--src/quick/items/qquickpincharea.cpp4
-rw-r--r--src/quick/items/qquickrendercontrol.cpp8
-rw-r--r--src/quick/items/qquickshadereffect.cpp48
-rw-r--r--src/quick/items/qquickshadereffect_p.h2
-rw-r--r--src/quick/items/qquicktext.cpp6
-rw-r--r--src/quick/items/qquicktextcontrol.cpp89
-rw-r--r--src/quick/items/qquicktextcontrol_p.h6
-rw-r--r--src/quick/items/qquicktextcontrol_p_p.h8
-rw-r--r--src/quick/items/qquicktextdocument.cpp2
-rw-r--r--src/quick/items/qquicktextedit.cpp72
-rw-r--r--src/quick/items/qquicktextedit_p.h6
-rw-r--r--src/quick/items/qquicktextedit_p_p.h6
-rw-r--r--src/quick/items/qquicktextinput.cpp152
-rw-r--r--src/quick/items/qquicktextinput_p.h8
-rw-r--r--src/quick/items/qquicktextinput_p_p.h26
-rw-r--r--src/quick/items/qquicktextnode.cpp4
-rw-r--r--src/quick/items/qquicktextnodeengine.cpp6
-rw-r--r--src/quick/items/qquickwindow.cpp58
-rw-r--r--src/quick/items/qquickwindow.h8
-rw-r--r--src/quick/items/qquickwindow_p.h12
44 files changed, 374 insertions, 377 deletions
diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp
index 3b2b125c63..212148b754 100644
--- a/src/quick/items/context2d/qquickcanvasitem.cpp
+++ b/src/quick/items/context2d/qquickcanvasitem.cpp
@@ -802,7 +802,7 @@ QSGTextureProvider *QQuickCanvasItem::textureProvider() const
return QQuickItem::textureProvider();
Q_D(const QQuickCanvasItem);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QQuickWindow *w = window();
if (!w || !w->isSceneGraphInitialized()
|| QThread::currentThread() != QQuickWindowPrivate::get(w)->context->thread()) {
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index 2483a8eadb..bcaedd67b4 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -75,7 +75,7 @@
#include <private/qguiapplication_p.h>
#include <qpa/qplatformintegration.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <private/qsgdefaultrendercontext_p.h>
#endif
@@ -3997,7 +3997,7 @@ public:
~QQuickContext2DThreadCleanup()
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
context->makeCurrent(surface);
delete texture;
context->doneCurrent();
@@ -4038,7 +4038,7 @@ QQuickContext2D::~QQuickContext2D()
delete m_buffer;
if (m_renderTarget == QQuickCanvasItem::FramebufferObject) {
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_renderStrategy == QQuickCanvasItem::Immediate && m_glContext) {
Q_ASSERT(QThread::currentThread() == m_glContext->thread());
m_glContext->makeCurrent(m_surface.data());
@@ -4115,7 +4115,7 @@ void QQuickContext2D::init(QQuickCanvasItem *canvasItem, const QVariantMap &args
m_texture = new QQuickContext2DImageTexture;
break;
case QQuickCanvasItem::FramebufferObject:
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
m_texture = new QQuickContext2DFBOTexture;
#else
// It shouldn't be possible to use a FramebufferObject without OpenGL
@@ -4134,7 +4134,7 @@ void QQuickContext2D::init(QQuickCanvasItem *canvasItem, const QVariantMap &args
m_thread = QThread::currentThread();
QThread *renderThread = m_thread;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QQuickWindow *window = canvasItem->window();
QQuickWindowPrivate *wd = QQuickWindowPrivate::get(window);
QThread *sceneGraphThread = wd->context->thread();
@@ -4151,7 +4151,7 @@ void QQuickContext2D::init(QQuickCanvasItem *canvasItem, const QVariantMap &args
if (renderThread && renderThread != QThread::currentThread())
m_texture->moveToThread(renderThread);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_renderTarget == QQuickCanvasItem::FramebufferObject && renderThread != sceneGraphThread) {
auto openglRenderContext = static_cast<const QSGDefaultRenderContext *>(QQuickWindowPrivate::get(window)->context);
QOpenGLContext *cc = openglRenderContext->openglContext();
@@ -4212,7 +4212,7 @@ QImage QQuickContext2D::toImage(const QRectF& bounds)
flush();
m_texture->grabImage(bounds);
} else {
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QQuickWindow *window = m_canvas->window();
QOpenGLContext *ctx = window ? window->openglContext() : 0;
if (ctx && ctx->isValid()) {
diff --git a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp
index 8d659040b3..b985cb0ccc 100644
--- a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp
+++ b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp
@@ -43,7 +43,7 @@
#include <QtCore/QMutex>
#include <QtQuick/qsgtexture.h>
#include <QtGui/QPaintEngine>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QtGui/QOpenGLContext>
# include <QtGui/private/qopenglpaintengine_p.h>
#endif
diff --git a/src/quick/items/context2d/qquickcontext2dtexture.cpp b/src/quick/items/context2d/qquickcontext2dtexture.cpp
index 4435c0c37b..38b5f054bf 100644
--- a/src/quick/items/context2d/qquickcontext2dtexture.cpp
+++ b/src/quick/items/context2d/qquickcontext2dtexture.cpp
@@ -44,7 +44,7 @@
#include <QtQuick/private/qsgtexture_p.h>
#include "qquickcontext2dcommandbuffer_p.h"
#include <QOpenGLPaintDevice>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <QOpenGLFramebufferObject>
#include <QOpenGLFramebufferObjectFormat>
#include <QOpenGLFunctions>
@@ -53,7 +53,7 @@
#include <QtGui/QGuiApplication>
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#define QT_MINIMUM_FBO_SIZE 64
static inline int qt_next_power_of_two(int v)
@@ -90,7 +90,7 @@ struct GLAcquireContext {
#endif
QQuickContext2DTexture::QQuickContext2DTexture()
: m_context(0)
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
, m_gl(0)
#endif
, m_surface(0)
@@ -254,7 +254,7 @@ void QQuickContext2DTexture::paint(QQuickContext2DCommandBuffer *ccb)
return;
}
QQuickContext2D::mutex.unlock();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
GLAcquireContext currentContext(m_gl, m_surface);
#endif
if (!m_tiledCanvas) {
@@ -383,7 +383,7 @@ bool QQuickContext2DTexture::event(QEvent *e)
}
return QObject::event(e);
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
static inline QSize npotAdjustedSize(const QSize &size)
{
static bool checked = false;
diff --git a/src/quick/items/context2d/qquickcontext2dtexture_p.h b/src/quick/items/context2d/qquickcontext2dtexture_p.h
index 6a5d4e8b09..04d7b40ab7 100644
--- a/src/quick/items/context2d/qquickcontext2dtexture_p.h
+++ b/src/quick/items/context2d/qquickcontext2dtexture_p.h
@@ -58,7 +58,7 @@ QT_REQUIRE_CONFIG(quick_canvas);
#include <QtQuick/qsgtexture.h>
#include "qquickcanvasitem_p.h"
#include "qquickcontext2d_p.h"
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QOpenGLContext>
# include <QOpenGLFramebufferObject>
#endif
@@ -125,7 +125,7 @@ public:
// Called during sync() on the scene graph thread while GUI is blocked.
virtual QSGTexture *textureForNextFrame(QSGTexture *lastFrame, QQuickWindow *window) = 0;
bool event(QEvent *e);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void initializeOpenGL(QOpenGLContext *gl, QOffscreenSurface *s) {
m_gl = gl;
m_surface = s;
@@ -157,7 +157,7 @@ protected:
QList<QQuickContext2DTile*> m_tiles;
QQuickContext2D *m_context;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QOpenGLContext *m_gl;
#endif
QSurface *m_surface;
@@ -180,7 +180,7 @@ protected:
uint m_painting : 1;
uint m_onCustomThread : 1; // Not GUI and not SGRender
};
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
class QQuickContext2DFBOTexture : public QQuickContext2DTexture
{
Q_OBJECT
diff --git a/src/quick/items/context2d/qquickcontext2dtile.cpp b/src/quick/items/context2d/qquickcontext2dtile.cpp
index 95b6c9d961..d31fee7f91 100644
--- a/src/quick/items/context2d/qquickcontext2dtile.cpp
+++ b/src/quick/items/context2d/qquickcontext2dtile.cpp
@@ -38,7 +38,7 @@
****************************************************************************/
#include "qquickcontext2dtile_p.h"
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QOpenGLFramebufferObject>
# include <QOpenGLFramebufferObjectFormat>
# include <QOpenGLPaintDevice>
@@ -97,7 +97,7 @@ QPainter* QQuickContext2DTile::createPainter(bool smooth, bool antialiasing)
return 0;
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QQuickContext2DFBOTile::QQuickContext2DFBOTile()
: QQuickContext2DTile()
, m_fbo(0)
diff --git a/src/quick/items/context2d/qquickcontext2dtile_p.h b/src/quick/items/context2d/qquickcontext2dtile_p.h
index 2f3fdeb54f..e7eed7b086 100644
--- a/src/quick/items/context2d/qquickcontext2dtile_p.h
+++ b/src/quick/items/context2d/qquickcontext2dtile_p.h
@@ -56,7 +56,7 @@
QT_REQUIRE_CONFIG(quick_canvas);
#include "qquickcontext2d_p.h"
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QOpenGLFramebufferObject>
#endif
QT_BEGIN_NAMESPACE
@@ -87,7 +87,7 @@ protected:
QPainter m_painter;
};
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
class QQuickContext2DFBOTile : public QQuickContext2DTile
{
public:
diff --git a/src/quick/items/qquickaccessibleattached.cpp b/src/quick/items/qquickaccessibleattached.cpp
index 41c036c7a8..4e918802d1 100644
--- a/src/quick/items/qquickaccessibleattached.cpp
+++ b/src/quick/items/qquickaccessibleattached.cpp
@@ -39,7 +39,7 @@
#include "qquickaccessibleattached_p.h"
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
#include "private/qquickitem_p.h"
diff --git a/src/quick/items/qquickaccessibleattached_p.h b/src/quick/items/qquickaccessibleattached_p.h
index 2c209ae664..c8538745cc 100644
--- a/src/quick/items/qquickaccessibleattached_p.h
+++ b/src/quick/items/qquickaccessibleattached_p.h
@@ -56,7 +56,7 @@
#include <QtCore/qobject.h>
#include <QtCore/qstring.h>
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
#include <QtGui/qaccessible.h>
#include <private/qtquickglobal_p.h>
@@ -265,6 +265,6 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickAccessibleAttached)
QML_DECLARE_TYPEINFO(QQuickAccessibleAttached, QML_HAS_ATTACHED_PROPERTIES)
-#endif // QT_NO_ACCESSIBILITY
+#endif // accessibility
#endif
diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp
index cbb052856e..7a112e840a 100644
--- a/src/quick/items/qquickdrag.cpp
+++ b/src/quick/items/qquickdrag.cpp
@@ -55,7 +55,7 @@
#include <QtGui/qstylehints.h>
#include <QtGui/qguiapplication.h>
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QT_BEGIN_NAMESPACE
@@ -995,4 +995,4 @@ QQuickDragAttached *QQuickDrag::qmlAttachedProperties(QObject *obj)
QT_END_NAMESPACE
-#endif // QT_NO_DRAGANDDROP
+#endif // draganddrop
diff --git a/src/quick/items/qquickdrag_p.h b/src/quick/items/qquickdrag_p.h
index 17721251d9..cc6318a4a3 100644
--- a/src/quick/items/qquickdrag_p.h
+++ b/src/quick/items/qquickdrag_p.h
@@ -60,7 +60,7 @@
#include <QtCore/qstringlist.h>
#include <QtCore/qurl.h>
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QT_BEGIN_NAMESPACE
@@ -318,6 +318,6 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickDrag)
QML_DECLARE_TYPEINFO(QQuickDrag, QML_HAS_ATTACHED_PROPERTIES)
-#endif // QT_NO_DRAGANDDROP
+#endif // draganddrop
#endif
diff --git a/src/quick/items/qquickdroparea.cpp b/src/quick/items/qquickdroparea.cpp
index 8dcc13971e..84c44c6541 100644
--- a/src/quick/items/qquickdroparea.cpp
+++ b/src/quick/items/qquickdroparea.cpp
@@ -43,7 +43,7 @@
#include <private/qv4arraybuffer_p.h>
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QT_BEGIN_NAMESPACE
@@ -618,4 +618,4 @@ void QQuickDropEvent::accept(QQmlV4Function *args)
QT_END_NAMESPACE
-#endif // QT_NO_DRAGANDDROP
+#endif // draganddrop
diff --git a/src/quick/items/qquickdroparea_p.h b/src/quick/items/qquickdroparea_p.h
index d3b37979da..ccde2bcd19 100644
--- a/src/quick/items/qquickdroparea_p.h
+++ b/src/quick/items/qquickdroparea_p.h
@@ -55,7 +55,7 @@
#include <QtGui/qevent.h>
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QT_BEGIN_NAMESPACE
@@ -190,6 +190,6 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickDropEvent)
QML_DECLARE_TYPE(QQuickDropArea)
-#endif // QT_NO_DRAGANDDROP
+#endif // draganddrop
#endif // QQUICKDROPAREA_P_H
diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp
index 12b01b8aaf..1e778306e0 100644
--- a/src/quick/items/qquickflickable.cpp
+++ b/src/quick/items/qquickflickable.cpp
@@ -1404,7 +1404,7 @@ void QQuickFlickable::mouseReleaseEvent(QMouseEvent *event)
}
}
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void QQuickFlickable::wheelEvent(QWheelEvent *event)
{
Q_D(QQuickFlickable);
diff --git a/src/quick/items/qquickflickable_p.h b/src/quick/items/qquickflickable_p.h
index 610bfd1427..62733bda1c 100644
--- a/src/quick/items/qquickflickable_p.h
+++ b/src/quick/items/qquickflickable_p.h
@@ -249,7 +249,7 @@ protected:
void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
#endif
void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE;
diff --git a/src/quick/items/qquickgraphicsinfo.cpp b/src/quick/items/qquickgraphicsinfo.cpp
index 761d0c3cad..f735f17a4d 100644
--- a/src/quick/items/qquickgraphicsinfo.cpp
+++ b/src/quick/items/qquickgraphicsinfo.cpp
@@ -257,7 +257,7 @@ void QQuickGraphicsInfo::updateInfo()
}
QSurfaceFormat format = QSurfaceFormat::defaultFormat();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_window && m_window->isSceneGraphInitialized()) {
QOpenGLContext *context = m_window->openglContext();
if (context)
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 13b75c0482..cbfd776941 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -73,7 +73,7 @@
#include <private/qv4qobjectwrapper_p.h>
#include <private/qdebug_p.h>
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
# include <QtGui/qcursor.h>
#endif
@@ -317,7 +317,7 @@ void QQuickItemKeyFilter::keyReleased(QKeyEvent *event, bool post)
if (m_next) m_next->keyReleased(event, post);
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void QQuickItemKeyFilter::inputMethodEvent(QInputMethodEvent *event, bool post)
{
if (m_next)
@@ -331,7 +331,7 @@ QVariant QQuickItemKeyFilter::inputMethodQuery(Qt::InputMethodQuery query) const
if (m_next) return m_next->inputMethodQuery(query);
return QVariant();
}
-#endif // QT_NO_IM
+#endif // im
void QQuickItemKeyFilter::componentComplete()
{
@@ -1298,7 +1298,7 @@ void QQuickKeysAttached::setPriority(Priority order)
void QQuickKeysAttached::componentComplete()
{
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Q_D(QQuickKeysAttached);
if (d->item) {
for (QQuickItem *targetItem : qAsConst(d->targets)) {
@@ -1387,7 +1387,7 @@ void QQuickKeysAttached::keyReleased(QKeyEvent *event, bool post)
if (!event->isAccepted()) QQuickItemKeyFilter::keyReleased(event, post);
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void QQuickKeysAttached::inputMethodEvent(QInputMethodEvent *event, bool post)
{
Q_D(QQuickKeysAttached);
@@ -1424,7 +1424,7 @@ QVariant QQuickKeysAttached::inputMethodQuery(Qt::InputMethodQuery query) const
}
return QQuickItemKeyFilter::inputMethodQuery(query);
}
-#endif // QT_NO_IM
+#endif // im
QQuickKeysAttached *QQuickKeysAttached::qmlAttachedProperties(QObject *obj)
{
@@ -1675,7 +1675,7 @@ void QQuickEnterKeyAttached::setType(Qt::EnterKeyType type)
{
if (keyType != type) {
keyType = type;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (itemPrivate && itemPrivate->activeFocus)
QGuiApplication::inputMethod()->update(Qt::ImEnterKeyType);
#endif
@@ -2366,7 +2366,7 @@ bool QQuickItemPrivate::canAcceptTabFocus(QQuickItem *item)
if (item == item->window()->contentItem())
return true;
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
if (QObject *acc = qmlAttachedPropertiesObject<QQuickAccessibleAttached>(item, false)) {
int role = acc->property("role").toInt();
if (role == QAccessible::EditableText
@@ -2855,7 +2855,7 @@ void QQuickItemPrivate::addChild(QQuickItem *child)
childItems.append(child);
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
QQuickItemPrivate *childPrivate = QQuickItemPrivate::get(child);
// if the added child has a cursor and we do not currently have any children
@@ -2883,7 +2883,7 @@ void QQuickItemPrivate::removeChild(QQuickItem *child)
childItems.removeOne(child);
Q_ASSERT(!childItems.contains(child));
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
QQuickItemPrivate *childPrivate = QQuickItemPrivate::get(child);
// turn it off, if nothing else is using it
@@ -2958,7 +2958,7 @@ void QQuickItemPrivate::derefWindow()
if (polishScheduled)
c->itemsToPolish.removeOne(q);
c->removeGrabber(q);
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
if (c->cursorItem == q) {
c->cursorItem = 0;
window->unsetCursor();
@@ -3842,7 +3842,7 @@ void QQuickItem::keyReleaseEvent(QKeyEvent *event)
event->ignore();
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
/*!
This event handler can be reimplemented in a subclass to receive input
method events for an item. The event information is provided by the
@@ -3852,7 +3852,7 @@ void QQuickItem::inputMethodEvent(QInputMethodEvent *event)
{
event->ignore();
}
-#endif // QT_NO_IM
+#endif // im
/*!
This event handler can be reimplemented in a subclass to receive focus-in
@@ -3861,7 +3861,7 @@ void QQuickItem::inputMethodEvent(QInputMethodEvent *event)
*/
void QQuickItem::focusInEvent(QFocusEvent * /*event*/)
{
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
if (QAccessible::isActive()) {
if (QObject *acc = QQuickAccessibleAttached::findAccessible(this)) {
QAccessibleEvent ev(acc, QAccessible::Focus);
@@ -3939,7 +3939,7 @@ void QQuickItem::touchUngrabEvent()
// XXX todo
}
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
/*!
This event handler can be reimplemented in a subclass to receive
wheel events for an item. The event information is provided by the
@@ -3997,7 +3997,7 @@ void QQuickItem::hoverLeaveEvent(QHoverEvent *event)
Q_UNUSED(event);
}
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
/*!
This event handler can be reimplemented in a subclass to receive drag-enter
events for an item. The event information is provided by the
@@ -4057,7 +4057,7 @@ void QQuickItem::dropEvent(QDropEvent *event)
{
Q_UNUSED(event);
}
-#endif // QT_NO_DRAGANDDROP
+#endif // draganddrop
/*!
Reimplement this method to filter the mouse events that are received by
@@ -4088,7 +4088,7 @@ void QQuickItem::windowDeactivateEvent()
}
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
/*!
This method is only relevant for input items.
@@ -4146,7 +4146,7 @@ QVariant QQuickItem::inputMethodQuery(Qt::InputMethodQuery query) const
return v;
}
-#endif // QT_NO_IM
+#endif // im
QQuickAnchorLine QQuickItemPrivate::left() const
{
@@ -4991,7 +4991,7 @@ void QQuickItemPrivate::deliverKeyEvent(QKeyEvent *e)
}
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void QQuickItemPrivate::deliverInputMethodEvent(QInputMethodEvent *e)
{
Q_Q(QQuickItem);
@@ -5017,7 +5017,7 @@ void QQuickItemPrivate::deliverInputMethodEvent(QInputMethodEvent *e)
extra->keyHandler->inputMethodEvent(e, true);
}
}
-#endif // QT_NO_IM
+#endif // im
/*!
Called when \a change occurs for this item.
@@ -5038,7 +5038,7 @@ void QQuickItem::itemChange(ItemChange change, const ItemChangeData &value)
emit windowChanged(value.window);
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
/*!
Notify input method on updated query values if needed. \a queries indicates
the changed attributes.
@@ -5048,7 +5048,7 @@ void QQuickItem::updateInputMethod(Qt::InputMethodQueries queries)
if (hasActiveFocus())
QGuiApplication::inputMethod()->update(queries);
}
-#endif // QT_NO_IM
+#endif // im
/*! \internal */
// XXX todo - do we want/need this anymore?
@@ -5790,7 +5790,7 @@ bool QQuickItemPrivate::setEffectiveVisibleRecur(bool newEffectiveVisible)
}
itemChange(QQuickItem::ItemVisibleHasChanged, effectiveVisible);
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
if (isAccessible) {
QAccessibleEvent ev(q, effectiveVisible ? QAccessible::ObjectShow : QAccessible::ObjectHide);
QAccessible::updateAccessibility(&ev);
@@ -7074,7 +7074,7 @@ void QQuickItem::setAcceptHoverEvents(bool enabled)
void QQuickItemPrivate::setHasCursorInChild(bool hasCursor)
{
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
Q_Q(QQuickItem);
// if we're asked to turn it off (because of an unsetcursor call, or a node
@@ -7123,7 +7123,7 @@ void QQuickItemPrivate::setHasHoverInChild(bool hasHover)
}
}
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
/*!
Returns the cursor shape for this item.
@@ -7609,7 +7609,7 @@ bool QQuickItem::event(QEvent *ev)
updatePolish();
break;
#endif
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
case QEvent::InputMethodQuery: {
QInputMethodQueryEvent *query = static_cast<QInputMethodQueryEvent *>(ev);
Qt::InputMethodQueries queries = query->queries();
@@ -7626,7 +7626,7 @@ bool QQuickItem::event(QEvent *ev)
case QEvent::InputMethod:
inputMethodEvent(static_cast<QInputMethodEvent *>(ev));
break;
-#endif // QT_NO_IM
+#endif // im
case QEvent::TouchBegin:
case QEvent::TouchUpdate:
case QEvent::TouchEnd:
@@ -7670,12 +7670,12 @@ bool QQuickItem::event(QEvent *ev)
case QEvent::MouseButtonDblClick:
mouseDoubleClickEvent(static_cast<QMouseEvent*>(ev));
break;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
case QEvent::Wheel:
wheelEvent(static_cast<QWheelEvent*>(ev));
break;
#endif
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
case QEvent::DragEnter:
dragEnterEvent(static_cast<QDragEnterEvent*>(ev));
break;
@@ -7688,12 +7688,12 @@ bool QQuickItem::event(QEvent *ev)
case QEvent::Drop:
dropEvent(static_cast<QDropEvent*>(ev));
break;
-#endif // QT_NO_DRAGANDDROP
-#ifndef QT_NO_GESTURES
+#endif // draganddrop
+#if QT_CONFIG(gestures)
case QEvent::NativeGesture:
ev->ignore();
break;
-#endif // QT_NO_GESTURES
+#endif // gestures
default:
return QObject::event(ev);
}
@@ -8291,7 +8291,7 @@ QQuickItemPrivate::ExtraData::ExtraData()
}
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
QAccessible::Role QQuickItemPrivate::accessibleRole() const
{
Q_Q(const QQuickItem);
diff --git a/src/quick/items/qquickitem.h b/src/quick/items/qquickitem.h
index b1b1d627b1..c9494d91bd 100644
--- a/src/quick/items/qquickitem.h
+++ b/src/quick/items/qquickitem.h
@@ -153,7 +153,7 @@ class Q_QUICK_EXPORT QQuickItem : public QObject, public QQmlParserStatus
public:
enum Flag {
ItemClipsChildrenToShape = 0x01,
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
ItemAcceptsInputMethod = 0x02,
#endif
ItemIsFocusScope = 0x04,
@@ -292,7 +292,7 @@ public:
bool acceptHoverEvents() const;
void setAcceptHoverEvents(bool enabled);
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
QCursor cursor() const;
void setCursor(const QCursor &cursor);
void unsetCursor();
@@ -340,7 +340,7 @@ public:
Q_REVISION(1) Q_INVOKABLE QQuickItem *nextItemInFocusChain(bool forward = true);
Q_INVOKABLE QQuickItem *childAt(qreal x, qreal y) const;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
#endif
@@ -393,7 +393,7 @@ protected:
bool isComponentComplete() const;
virtual void itemChange(ItemChange, const ItemChangeData &);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void updateInputMethod(Qt::InputMethodQueries queries = Qt::ImQueryInput);
#endif
@@ -406,7 +406,7 @@ protected:
virtual void keyPressEvent(QKeyEvent *event);
virtual void keyReleaseEvent(QKeyEvent *event);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
virtual void inputMethodEvent(QInputMethodEvent *);
#endif
virtual void focusInEvent(QFocusEvent *);
@@ -417,14 +417,14 @@ protected:
virtual void mouseDoubleClickEvent(QMouseEvent *event);
virtual void mouseUngrabEvent(); // XXX todo - params?
virtual void touchUngrabEvent();
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
virtual void wheelEvent(QWheelEvent *event);
#endif
virtual void touchEvent(QTouchEvent *event);
virtual void hoverEnterEvent(QHoverEvent *event);
virtual void hoverMoveEvent(QHoverEvent *event);
virtual void hoverLeaveEvent(QHoverEvent *event);
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
virtual void dragEnterEvent(QDragEnterEvent *);
virtual void dragMoveEvent(QDragMoveEvent *);
virtual void dragLeaveEvent(QDragLeaveEvent *);
diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h
index 4bff293657..45674a106d 100644
--- a/src/quick/items/qquickitem_p.h
+++ b/src/quick/items/qquickitem_p.h
@@ -347,7 +347,7 @@ public:
#if QT_CONFIG(quick_shadereffect)
mutable QQuickItemLayer *layer;
#endif
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
QCursor cursor;
#endif
QPointF userTransformOriginPoint;
@@ -534,7 +534,7 @@ public:
virtual void implicitWidthChanged();
virtual void implicitHeightChanged();
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
virtual QAccessible::Role accessibleRole() const;
#endif
@@ -556,7 +556,7 @@ public:
virtual void transformChanged();
void deliverKeyEvent(QKeyEvent *);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void deliverInputMethodEvent(QInputMethodEvent *);
#endif
@@ -618,7 +618,7 @@ public:
virtual void keyPressed(QKeyEvent *event, bool post);
virtual void keyReleased(QKeyEvent *event, bool post);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
virtual void inputMethodEvent(QInputMethodEvent *event, bool post);
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
#endif
@@ -857,7 +857,7 @@ Q_SIGNALS:
private:
void keyPressed(QKeyEvent *event, bool post) Q_DECL_OVERRIDE;
void keyReleased(QKeyEvent *event, bool post) Q_DECL_OVERRIDE;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void inputMethodEvent(QInputMethodEvent *, bool post) Q_DECL_OVERRIDE;
QVariant inputMethodQuery(Qt::InputMethodQuery query) const Q_DECL_OVERRIDE;
#endif
diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp
index 0705d9b504..8dd4a96b62 100644
--- a/src/quick/items/qquickitemsmodule.cpp
+++ b/src/quick/items/qquickitemsmodule.cpp
@@ -96,7 +96,7 @@
#include "qquickspritesequence_p.h"
#include "qquickanimatedsprite_p.h"
#endif
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include "qquickopenglinfo_p.h"
#endif
#include "qquickgraphicsinfo_p.h"
@@ -278,7 +278,7 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor)
qmlRegisterType<QQuickPathInterpolator>("QtQuick",2,0,"PathInterpolator");
#endif
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
qmlRegisterType<QQuickDropArea>("QtQuick", 2, 0, "DropArea");
qmlRegisterType<QQuickDropEvent>();
qmlRegisterType<QQuickDropAreaDrag>();
@@ -289,7 +289,7 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor)
qmlRegisterType<QQuickTouchPoint>("QtQuick", 2, 0, "TouchPoint");
qmlRegisterType<QQuickGrabGestureEvent>();
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
qmlRegisterUncreatableType<QQuickAccessibleAttached>("QtQuick", 2, 0, "Accessible",QQuickAccessibleAttached::tr("Accessible is only available via attached properties"));
#endif
@@ -325,7 +325,7 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor)
qmlRegisterType<QQuickShaderEffect, 1>(uri, 2, 4, "ShaderEffect");
#endif
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
qmlRegisterUncreatableType<QQuickOpenGLInfo>(uri, 2, 4,"OpenGLInfo", QQuickOpenGLInfo::tr("OpenGLInfo is only available via attached properties"));
#endif
qmlRegisterType<QQuickPinchArea, 1>(uri, 2, 5,"PinchArea");
diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp
index 6bd83dd808..5e30bf9e0a 100644
--- a/src/quick/items/qquickmousearea.cpp
+++ b/src/quick/items/qquickmousearea.cpp
@@ -61,10 +61,10 @@ QQuickMouseAreaPrivate::QQuickMouseAreaPrivate()
: enabled(true), scrollGestureEnabled(true), hovered(false), longPress(false),
moved(false), stealMouse(false), doubleClick(false), preventStealing(false),
propagateComposedEvents(false), overThreshold(false), pressed(0)
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
, drag(0)
#endif
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
, cursor(0)
#endif
{
@@ -72,10 +72,10 @@ QQuickMouseAreaPrivate::QQuickMouseAreaPrivate()
QQuickMouseAreaPrivate::~QQuickMouseAreaPrivate()
{
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
delete drag;
#endif
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
delete cursor;
#endif
}
@@ -435,7 +435,7 @@ QQuickMouseArea::QQuickMouseArea(QQuickItem *parent)
{
Q_D(QQuickMouseArea);
d->init();
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
// Explcitly call setCursor on QQuickItem since
// it internally keeps a boolean hasCursor that doesn't
// get set to true unless you call setCursor
@@ -679,7 +679,7 @@ void QQuickMouseArea::mousePressEvent(QMouseEvent *event)
} else {
d->longPress = false;
d->saveEvent(event);
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
if (d->drag)
d->drag->setActive(false);
#endif
@@ -705,7 +705,7 @@ void QQuickMouseArea::mouseMoveEvent(QMouseEvent *event)
// ### can GV handle this for us?
setHovered(contains(d->lastPos));
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
if (d->drag && d->drag->target()) {
if (!d->moved) {
d->targetStartPos = d->drag->target()->parentItem()
@@ -788,7 +788,7 @@ void QQuickMouseArea::mouseReleaseEvent(QMouseEvent *event)
setPressed(event->button(), false, event->source());
if (!d->pressed) {
// no other buttons are pressed
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
if (d->drag)
d->drag->setActive(false);
#endif
@@ -866,7 +866,7 @@ void QQuickMouseArea::hoverLeaveEvent(QHoverEvent *event)
setHovered(false);
}
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void QQuickMouseArea::wheelEvent(QWheelEvent *event)
{
Q_D(QQuickMouseArea);
@@ -897,7 +897,7 @@ void QQuickMouseArea::ungrabMouse()
d->overThreshold = false;
setKeepMouseGrab(false);
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
if (d->drag)
d->drag->setActive(false);
#endif
@@ -980,7 +980,7 @@ bool QQuickMouseArea::childMouseEventFilter(QQuickItem *i, QEvent *e)
Q_D(QQuickMouseArea);
if (!d->pressed &&
(!d->enabled || !isVisible()
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
|| !d->drag || !d->drag->filterChildren()
#endif
)
@@ -1003,7 +1003,7 @@ void QQuickMouseArea::timerEvent(QTimerEvent *event)
Q_D(QQuickMouseArea);
if (event->timerId() == d->pressAndHoldTimer.timerId()) {
d->pressAndHoldTimer.stop();
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
bool dragged = d->drag && d->drag->active();
#else
bool dragged = false;
@@ -1179,7 +1179,7 @@ bool QQuickMouseArea::setPressed(Qt::MouseButton button, bool p, Qt::MouseEventS
{
Q_D(QQuickMouseArea);
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
bool dragged = d->drag && d->drag->active();
#else
bool dragged = false;
@@ -1276,7 +1276,7 @@ bool QQuickMouseArea::setPressed(Qt::MouseButton button, bool p, Qt::MouseEventS
\sa Qt::CursorShape
*/
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
Qt::CursorShape QQuickMouseArea::cursorShape() const
{
return cursor().shape();
@@ -1343,7 +1343,7 @@ void QQuickMouseArea::setCursorShape(Qt::CursorShape shape)
*/
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QQuickDrag *QQuickMouseArea::drag()
{
Q_D(QQuickMouseArea);
diff --git a/src/quick/items/qquickmousearea_p.h b/src/quick/items/qquickmousearea_p.h
index 5cd86541d4..d90c8e1baa 100644
--- a/src/quick/items/qquickmousearea_p.h
+++ b/src/quick/items/qquickmousearea_p.h
@@ -75,12 +75,12 @@ class Q_QUICK_PRIVATE_EXPORT QQuickMouseArea : public QQuickItem
Q_PROPERTY(Qt::MouseButtons pressedButtons READ pressedButtons NOTIFY pressedButtonsChanged)
Q_PROPERTY(Qt::MouseButtons acceptedButtons READ acceptedButtons WRITE setAcceptedButtons NOTIFY acceptedButtonsChanged)
Q_PROPERTY(bool hoverEnabled READ hoverEnabled WRITE setHoverEnabled NOTIFY hoverEnabledChanged)
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
Q_PROPERTY(QQuickDrag *drag READ drag CONSTANT) //### add flicking to QQuickDrag or add a QQuickFlick ???
#endif
Q_PROPERTY(bool preventStealing READ preventStealing WRITE setPreventStealing NOTIFY preventStealingChanged)
Q_PROPERTY(bool propagateComposedEvents READ propagateComposedEvents WRITE setPropagateComposedEvents NOTIFY propagateComposedEventsChanged)
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
Q_PROPERTY(Qt::CursorShape cursorShape READ cursorShape WRITE setCursorShape RESET unsetCursor NOTIFY cursorShapeChanged)
#endif
Q_PROPERTY(bool containsPress READ containsPress NOTIFY containsPressChanged REVISION 1)
@@ -110,7 +110,7 @@ public:
bool hoverEnabled() const;
void setHoverEnabled(bool h);
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QQuickDrag *drag();
#endif
@@ -120,7 +120,7 @@ public:
bool propagateComposedEvents() const;
void setPropagateComposedEvents(bool propagate);
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
Qt::CursorShape cursorShape() const;
void setCursorShape(Qt::CursorShape shape);
#endif
@@ -133,7 +133,7 @@ Q_SIGNALS:
void pressedButtonsChanged();
void acceptedButtonsChanged();
void hoverEnabledChanged();
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
void cursorShapeChanged();
#endif
void positionChanged(QQuickMouseEvent *mouse);
@@ -166,7 +166,7 @@ protected:
void hoverEnterEvent(QHoverEvent *event) Q_DECL_OVERRIDE;
void hoverMoveEvent(QHoverEvent *event) Q_DECL_OVERRIDE;
void hoverLeaveEvent(QHoverEvent *event) Q_DECL_OVERRIDE;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
#endif
bool childMouseEventFilter(QQuickItem *i, QEvent *e) Q_DECL_OVERRIDE;
diff --git a/src/quick/items/qquickmousearea_p_p.h b/src/quick/items/qquickmousearea_p_p.h
index b59e02910f..456b1866a3 100644
--- a/src/quick/items/qquickmousearea_p_p.h
+++ b/src/quick/items/qquickmousearea_p_p.h
@@ -95,7 +95,7 @@ public:
bool propagateComposedEvents : 1;
bool overThreshold : 1;
Qt::MouseButtons pressed;
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QQuickDrag *drag;
#endif
QPointF startScene;
@@ -106,7 +106,7 @@ public:
Qt::MouseButtons lastButtons;
Qt::KeyboardModifiers lastModifiers;
QBasicTimer pressAndHoldTimer;
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
QCursor *cursor;
#endif
QQuickMouseEvent quickMouseEvent;
diff --git a/src/quick/items/qquickpainteditem.cpp b/src/quick/items/qquickpainteditem.cpp
index 1ef8de753d..c5155c9c35 100644
--- a/src/quick/items/qquickpainteditem.cpp
+++ b/src/quick/items/qquickpainteditem.cpp
@@ -662,7 +662,7 @@ QSGTextureProvider *QQuickPaintedItem::textureProvider() const
return QQuickItem::textureProvider();
Q_D(const QQuickPaintedItem);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QQuickWindow *w = window();
if (!w || !w->openglContext() || QThread::currentThread() != w->openglContext()->thread()) {
qWarning("QQuickPaintedItem::textureProvider: can only be queried on the rendering thread of an exposed window");
diff --git a/src/quick/items/qquickpincharea.cpp b/src/quick/items/qquickpincharea.cpp
index fd8971c845..6295aa1932 100644
--- a/src/quick/items/qquickpincharea.cpp
+++ b/src/quick/items/qquickpincharea.cpp
@@ -682,7 +682,7 @@ bool QQuickPinchArea::event(QEvent *event)
return QQuickItem::event(event);
switch (event->type()) {
-#ifndef QT_NO_GESTURES
+#if QT_CONFIG(gestures)
case QEvent::NativeGesture: {
QNativeGestureEvent *gesture = static_cast<QNativeGestureEvent *>(event);
switch (gesture->gestureType()) {
@@ -775,7 +775,7 @@ bool QQuickPinchArea::event(QEvent *event)
return QQuickItem::event(event);
}
} break;
-#endif // QT_NO_GESTURES
+#endif // gestures
case QEvent::Wheel:
event->ignore();
return false;
diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp
index 74aa2da9e0..13e13890b7 100644
--- a/src/quick/items/qquickrendercontrol.cpp
+++ b/src/quick/items/qquickrendercontrol.cpp
@@ -44,7 +44,7 @@
#include <QtCore/QTime>
#include <QtQuick/private/qquickanimatorcontroller_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <QtGui/QOpenGLContext>
# include <QtQuick/private/qsgdefaultrendercontext_p.h>
#if QT_CONFIG(quick_shadereffect)
@@ -62,7 +62,7 @@
#include <QtCore/private/qobject_p.h>
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
/*!
@@ -227,7 +227,7 @@ void QQuickRenderControl::initialize(QOpenGLContext *gl)
{
Q_D(QQuickRenderControl);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (!d->window) {
qWarning("QQuickRenderControl::initialize called with no associated window");
return;
@@ -379,7 +379,7 @@ QImage QQuickRenderControl::grab()
QImage grabContent;
if (d->window->rendererInterface()->graphicsApi() == QSGRendererInterface::OpenGL) {
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
render();
grabContent = qt_gl_read_framebuffer(d->window->size() * d->window->effectiveDevicePixelRatio(), false, false);
#endif
diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp
index 5670696ce2..7926607e33 100644
--- a/src/quick/items/qquickshadereffect.cpp
+++ b/src/quick/items/qquickshadereffect.cpp
@@ -40,7 +40,7 @@
#include <private/qquickshadereffect_p.h>
#include <private/qsgcontextplugin_p.h>
#include <private/qquickitem_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
#include <private/qquickopenglshadereffect_p.h>
#endif
#include <private/qquickgenericshadereffect_p.h>
@@ -499,14 +499,14 @@ QSGContextFactoryInterface::Flags qsg_backend_flags();
QQuickShaderEffect::QQuickShaderEffect(QQuickItem *parent)
: QQuickItem(*new QQuickShaderEffectPrivate, parent),
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
m_glImpl(nullptr),
#endif
m_impl(nullptr)
{
setFlag(QQuickItem::ItemHasContents);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (!qsg_backend_flags().testFlag(QSGContextFactoryInterface::SupportsShaderEffectNode))
m_glImpl = new QQuickOpenGLShaderEffect(this, this);
@@ -539,7 +539,7 @@ QQuickShaderEffect::QQuickShaderEffect(QQuickItem *parent)
QByteArray QQuickShaderEffect::fragmentShader() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->fragmentShader();
#endif
@@ -548,7 +548,7 @@ QByteArray QQuickShaderEffect::fragmentShader() const
void QQuickShaderEffect::setFragmentShader(const QByteArray &code)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->setFragmentShader(code);
return;
@@ -578,7 +578,7 @@ void QQuickShaderEffect::setFragmentShader(const QByteArray &code)
QByteArray QQuickShaderEffect::vertexShader() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->vertexShader();
#endif
@@ -587,7 +587,7 @@ QByteArray QQuickShaderEffect::vertexShader() const
void QQuickShaderEffect::setVertexShader(const QByteArray &code)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->setVertexShader(code);
return;
@@ -607,7 +607,7 @@ void QQuickShaderEffect::setVertexShader(const QByteArray &code)
bool QQuickShaderEffect::blending() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->blending();
#endif
@@ -616,7 +616,7 @@ bool QQuickShaderEffect::blending() const
void QQuickShaderEffect::setBlending(bool enable)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->setBlending(enable);
return;
@@ -640,7 +640,7 @@ void QQuickShaderEffect::setBlending(bool enable)
QVariant QQuickShaderEffect::mesh() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->mesh();
#endif
@@ -649,7 +649,7 @@ QVariant QQuickShaderEffect::mesh() const
void QQuickShaderEffect::setMesh(const QVariant &mesh)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->setMesh(mesh);
return;
@@ -674,7 +674,7 @@ void QQuickShaderEffect::setMesh(const QVariant &mesh)
QQuickShaderEffect::CullMode QQuickShaderEffect::cullMode() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->cullMode();
#endif
@@ -683,7 +683,7 @@ QQuickShaderEffect::CullMode QQuickShaderEffect::cullMode() const
void QQuickShaderEffect::setCullMode(CullMode face)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->setCullMode(face);
return;
@@ -715,7 +715,7 @@ void QQuickShaderEffect::setCullMode(CullMode face)
bool QQuickShaderEffect::supportsAtlasTextures() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->supportsAtlasTextures();
#endif
@@ -724,7 +724,7 @@ bool QQuickShaderEffect::supportsAtlasTextures() const
void QQuickShaderEffect::setSupportsAtlasTextures(bool supports)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->setSupportsAtlasTextures(supports);
return;
@@ -771,7 +771,7 @@ void QQuickShaderEffect::setSupportsAtlasTextures(bool supports)
QString QQuickShaderEffect::log() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->log();
#endif
@@ -780,7 +780,7 @@ QString QQuickShaderEffect::log() const
QQuickShaderEffect::Status QQuickShaderEffect::status() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->status();
#endif
@@ -789,7 +789,7 @@ QQuickShaderEffect::Status QQuickShaderEffect::status() const
bool QQuickShaderEffect::event(QEvent *e)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->handleEvent(e);
return QQuickItem::event(e);
@@ -801,7 +801,7 @@ bool QQuickShaderEffect::event(QEvent *e)
void QQuickShaderEffect::geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->handleGeometryChanged(newGeometry, oldGeometry);
QQuickItem::geometryChanged(newGeometry, oldGeometry);
@@ -814,7 +814,7 @@ void QQuickShaderEffect::geometryChanged(const QRectF &newGeometry, const QRectF
QSGNode *QQuickShaderEffect::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->handleUpdatePaintNode(oldNode, updatePaintNodeData);
#endif
@@ -823,7 +823,7 @@ QSGNode *QQuickShaderEffect::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDa
void QQuickShaderEffect::componentComplete()
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->maybeUpdateShaders();
QQuickItem::componentComplete();
@@ -836,7 +836,7 @@ void QQuickShaderEffect::componentComplete()
void QQuickShaderEffect::itemChange(ItemChange change, const ItemChangeData &value)
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl) {
m_glImpl->handleItemChange(change, value);
QQuickItem::itemChange(change, value);
@@ -854,7 +854,7 @@ bool QQuickShaderEffect::isComponentComplete() const
QString QQuickShaderEffect::parseLog() // for OpenGL-based autotests
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (m_glImpl)
return m_glImpl->parseLog();
#endif
@@ -864,7 +864,7 @@ QString QQuickShaderEffect::parseLog() // for OpenGL-based autotests
void QQuickShaderEffectPrivate::updatePolish()
{
Q_Q(QQuickShaderEffect);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (q->m_glImpl) {
q->m_glImpl->maybeUpdateShaders();
return;
diff --git a/src/quick/items/qquickshadereffect_p.h b/src/quick/items/qquickshadereffect_p.h
index 2b7ff4cf6e..7885daffbb 100644
--- a/src/quick/items/qquickshadereffect_p.h
+++ b/src/quick/items/qquickshadereffect_p.h
@@ -135,7 +135,7 @@ protected:
void itemChange(ItemChange change, const ItemChangeData &value) override;
private:
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
QQuickOpenGLShaderEffect *m_glImpl;
#endif
QQuickGenericShaderEffect *m_impl;
diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp
index 2bfb4501fc..e37a7e6d5e 100644
--- a/src/quick/items/qquicktext.cpp
+++ b/src/quick/items/qquicktext.cpp
@@ -1819,7 +1819,7 @@ bool QQuickTextPrivate::setHAlign(QQuickText::HAlignment alignment, bool forceAl
bool QQuickTextPrivate::determineHorizontalAlignment()
{
if (hAlignImplicit) {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
bool alignToRight = text.isEmpty() ? QGuiApplication::inputMethod()->inputDirection() == Qt::RightToLeft : rightToLeftText;
#else
bool alignToRight = rightToLeftText;
@@ -2713,12 +2713,12 @@ QString QQuickText::hoveredLink() const
if (d->extra.isAllocated())
return d->extra->hoveredLink;
} else {
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
if (QQuickWindow *wnd = window()) {
QPointF pos = QCursor::pos(wnd->screen()) - wnd->position() - mapToScene(QPointF(0, 0));
return d->anchorAt(pos);
}
-#endif // QT_NO_CURSOR
+#endif // cursor
}
return QString();
}
diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp
index ef7485a8e9..887cc6fea7 100644
--- a/src/quick/items/qquicktextcontrol.cpp
+++ b/src/quick/items/qquicktextcontrol.cpp
@@ -79,9 +79,6 @@ const int textCursorWidth = 1;
QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(DBG_HOVER_TRACE)
-#ifndef QT_NO_CONTEXTMENU
-#endif
-
// could go into QTextCursor...
static QTextLine currentTextLine(const QTextCursor &cursor)
{
@@ -99,7 +96,7 @@ static QTextLine currentTextLine(const QTextCursor &cursor)
QQuickTextControlPrivate::QQuickTextControlPrivate()
: doc(0),
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
preeditCursor(0),
#endif
interactionFlags(Qt::TextEditorInteraction),
@@ -123,7 +120,7 @@ QQuickTextControlPrivate::QQuickTextControlPrivate()
bool QQuickTextControlPrivate::cursorMoveKeyEvent(QKeyEvent *e)
{
-#ifdef QT_NO_SHORTCUT
+#if !QT_CONFIG(shortcut)
Q_UNUSED(e);
#endif
@@ -139,7 +136,7 @@ bool QQuickTextControlPrivate::cursorMoveKeyEvent(QKeyEvent *e)
if (false) {
}
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
if (e == QKeySequence::MoveToNextChar) {
op = QTextCursor::Right;
}
@@ -232,7 +229,7 @@ bool QQuickTextControlPrivate::cursorMoveKeyEvent(QKeyEvent *e)
else if (e == QKeySequence::MoveToEndOfDocument) {
op = QTextCursor::End;
}
-#endif // QT_NO_SHORTCUT
+#endif // shortcut
else {
return false;
}
@@ -290,7 +287,7 @@ void QQuickTextControlPrivate::setContent(Qt::TextFormat format, const QString &
{
Q_Q(QQuickTextControl);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
cancelPreedit();
#endif
@@ -326,7 +323,7 @@ void QQuickTextControlPrivate::setContent(Qt::TextFormat format, const QString &
formatCursor.setCharFormat(charFormatForInsertion);
formatCursor.endEditBlock();
} else {
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
doc->setHtml(text);
#else
doc->setPlainText(text);
@@ -407,7 +404,7 @@ void QQuickTextControlPrivate::selectionChanged(bool forceEmitSelectionChanged /
{
Q_Q(QQuickTextControl);
if (forceEmitSelectionChanged) {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (hasFocus)
qGuiApp->inputMethod()->update(Qt::ImCurrentSelection);
#endif
@@ -429,7 +426,7 @@ void QQuickTextControlPrivate::selectionChanged(bool forceEmitSelectionChanged /
lastSelectionEnd = selectionEnd;
if (!forceEmitSelectionChanged) {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (hasFocus)
qGuiApp->inputMethod()->update(Qt::ImCurrentSelection);
#endif
@@ -443,7 +440,7 @@ void QQuickTextControlPrivate::_q_updateCurrentCharFormatAndSelection()
selectionChanged();
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void QQuickTextControlPrivate::setClipboardSelection()
{
QClipboard *clipboard = QGuiApplication::clipboard();
@@ -544,7 +541,7 @@ void QQuickTextControlPrivate::extendWordwiseSelection(int suggestedNewPosition,
}
if (interactionFlags & Qt::TextSelectableByMouse) {
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
setClipboardSelection();
#endif
selectionChanged(true);
@@ -574,7 +571,7 @@ void QQuickTextControlPrivate::extendBlockwiseSelection(int suggestedNewPosition
}
if (interactionFlags & Qt::TextSelectableByMouse) {
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
setClipboardSelection();
#endif
selectionChanged(true);
@@ -656,7 +653,7 @@ void QQuickTextControl::updateCursorRectangle(bool force)
void QQuickTextControl::setTextCursor(const QTextCursor &cursor)
{
Q_D(QQuickTextControl);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
d->commitPreedit();
#endif
d->cursorIsFocusIndicator = false;
@@ -677,7 +674,7 @@ QTextCursor QQuickTextControl::textCursor() const
return d->cursor;
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void QQuickTextControl::cut()
{
@@ -759,7 +756,7 @@ void QQuickTextControl::processEvent(QEvent *e, const QMatrix &matrix)
QHoverEvent *ev = static_cast<QHoverEvent *>(e);
d->hoverEvent(ev, matrix.map(ev->posF()));
break; }
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
case QEvent::InputMethod:
d->inputMethodEvent(static_cast<QInputMethodEvent *>(e));
break;
@@ -795,7 +792,7 @@ void QQuickTextControl::processEvent(QEvent *e, const QMatrix &matrix)
break;
}
}
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
} else if (ke == QKeySequence::Copy
|| ke == QKeySequence::Paste
|| ke == QKeySequence::Cut
@@ -873,20 +870,20 @@ void QQuickTextControlPrivate::keyPressEvent(QKeyEvent *e)
return;
}
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
if (e == QKeySequence::SelectAll) {
e->accept();
q->selectAll();
return;
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
else if (e == QKeySequence::Copy) {
e->accept();
q->copy();
return;
}
#endif
-#endif // QT_NO_SHORTCUT
+#endif // shortcut
if (interactionFlags & Qt::TextSelectableByKeyboard
&& cursorMoveKeyEvent(e))
@@ -924,7 +921,7 @@ void QQuickTextControlPrivate::keyPressEvent(QKeyEvent *e)
}
goto accept;
}
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
else if (e == QKeySequence::InsertParagraphSeparator) {
cursor.insertBlock();
e->accept();
@@ -937,14 +934,14 @@ void QQuickTextControlPrivate::keyPressEvent(QKeyEvent *e)
#endif
if (false) {
}
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
else if (e == QKeySequence::Undo) {
q->undo();
}
else if (e == QKeySequence::Redo) {
q->redo();
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
else if (e == QKeySequence::Cut) {
q->cut();
}
@@ -975,7 +972,7 @@ void QQuickTextControlPrivate::keyPressEvent(QKeyEvent *e)
cursor.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);
cursor.removeSelectedText();
}
-#endif // QT_NO_SHORTCUT
+#endif // shortcut
else {
goto process;
}
@@ -1019,7 +1016,7 @@ QRectF QQuickTextControlPrivate::rectForPosition(int position) const
const QTextLayout *layout = block.layout();
const QPointF layoutPos = q->blockBoundingRect(block).topLeft();
int relativePos = position - block.position();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (preeditCursor != 0) {
int preeditPos = layout->preeditAreaPosition();
if (relativePos == preeditPos)
@@ -1083,7 +1080,7 @@ void QQuickTextControlPrivate::mousePressEvent(QMouseEvent *e, const QPointF &po
const QTextCursor oldSelection = cursor;
const int oldCursorPos = cursor.position();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
commitPreedit();
#endif
@@ -1157,7 +1154,7 @@ void QQuickTextControlPrivate::mouseMoveEvent(QMouseEvent *e, const QPointF &mou
int newCursorPos = q->hitTest(mousePos, Qt::FuzzyHit);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (isPreediting()) {
// note: oldCursorPos not including preedit
int selectionStartPos = q->hitTest(mousePressPos, Qt::FuzzyHit);
@@ -1183,7 +1180,7 @@ void QQuickTextControlPrivate::mouseMoveEvent(QMouseEvent *e, const QPointF &mou
extendBlockwiseSelection(newCursorPos);
else if (selectedWordOnDoubleClick.hasSelection())
extendWordwiseSelection(newCursorPos, mouseX);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
else if (!isPreediting())
setCursorPosition(newCursorPos, QTextCursor::KeepAnchor);
#endif
@@ -1194,7 +1191,7 @@ void QQuickTextControlPrivate::mouseMoveEvent(QMouseEvent *e, const QPointF &mou
q->updateCursorRectangle(true);
}
_q_updateCurrentCharFormatAndSelection();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (qGuiApp)
qGuiApp->inputMethod()->update(Qt::ImQueryInput);
#endif
@@ -1221,7 +1218,7 @@ void QQuickTextControlPrivate::mouseReleaseEvent(QMouseEvent *e, const QPointF &
if (mousePressed) {
mousePressed = false;
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
setClipboardSelection();
selectionChanged(true);
} else if (e->button() == Qt::MidButton
@@ -1270,7 +1267,7 @@ void QQuickTextControlPrivate::mouseDoubleClickEvent(QMouseEvent *e, const QPoin
Q_Q(QQuickTextControl);
if (e->button() == Qt::LeftButton && (interactionFlags & Qt::TextSelectableByMouse)) {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
commitPreedit();
#endif
@@ -1291,7 +1288,7 @@ void QQuickTextControlPrivate::mouseDoubleClickEvent(QMouseEvent *e, const QPoin
tripleClickTimer.start(QGuiApplication::styleHints()->mouseDoubleClickInterval(), q);
if (doEmit) {
selectionChanged();
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
setClipboardSelection();
#endif
emit q->cursorPositionChanged();
@@ -1304,7 +1301,7 @@ void QQuickTextControlPrivate::mouseDoubleClickEvent(QMouseEvent *e, const QPoin
bool QQuickTextControlPrivate::sendMouseEventToInputContext(QMouseEvent *e, const QPointF &pos)
{
-#if !defined(QT_NO_IM)
+#if QT_CONFIG(im)
Q_Q(QQuickTextControl);
Q_UNUSED(e);
@@ -1328,7 +1325,7 @@ bool QQuickTextControlPrivate::sendMouseEventToInputContext(QMouseEvent *e, cons
return false;
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void QQuickTextControlPrivate::inputMethodEvent(QInputMethodEvent *e)
{
Q_Q(QQuickTextControl);
@@ -1481,7 +1478,7 @@ QVariant QQuickTextControl::inputMethodQuery(Qt::InputMethodQuery property, QVar
return QVariant();
}
}
-#endif // QT_NO_IM
+#endif // im
void QQuickTextControlPrivate::focusEvent(QFocusEvent *e)
{
@@ -1611,7 +1608,7 @@ void QQuickTextControl::moveCursor(QTextCursor::MoveOperation op, QTextCursor::M
bool QQuickTextControl::canPaste() const
{
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
Q_D(const QQuickTextControl);
if (d->interactionFlags & Qt::TextEditable) {
const QMimeData *md = QGuiApplication::clipboard()->mimeData();
@@ -1661,7 +1658,7 @@ void QQuickTextControl::insertFromMimeData(const QMimeData *source)
bool hasData = false;
QTextDocumentFragment fragment;
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
if (source->hasFormat(QLatin1String("application/x-qrichtext")) && d->acceptRichText) {
// x-qrichtext is always UTF-8 (taken from Qt3 since we don't use it anymore).
QString richtext = QString::fromUtf8(source->data(QLatin1String("application/x-qrichtext")));
@@ -1680,7 +1677,7 @@ void QQuickTextControl::insertFromMimeData(const QMimeData *source)
}
#else
fragment = QTextDocumentFragment::fromPlainText(source->text());
-#endif // QT_NO_TEXTHTMLPARSER
+#endif // texthtmlparser
if (hasData)
d->cursor.insertFragment(fragment);
@@ -1751,7 +1748,7 @@ void QQuickTextControlPrivate::activateLinkUnderCursor(QString href)
emit q_func()->linkActivated(href);
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
bool QQuickTextControlPrivate::isPreediting() const
{
QTextLayout *layout = cursor.block().layout();
@@ -1789,7 +1786,7 @@ void QQuickTextControlPrivate::cancelPreedit()
QInputMethodEvent event;
QCoreApplication::sendEvent(q->parent(), &event);
}
-#endif // QT_NO_IM
+#endif // im
void QQuickTextControl::setTextInteractionFlags(Qt::TextInteractionFlags flags)
{
@@ -1813,7 +1810,7 @@ QString QQuickTextControl::toPlainText() const
return document()->toPlainText();
}
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
QString QQuickTextControl::toHtml() const
{
return document()->toHtml();
@@ -1840,7 +1837,7 @@ QRectF QQuickTextControl::blockBoundingRect(const QTextBlock &block) const
QString QQuickTextControl::preeditText() const
{
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Q_D(const QQuickTextControl);
QTextLayout *layout = d->cursor.block().layout();
if (!layout)
@@ -1857,7 +1854,7 @@ QStringList QQuickTextEditMimeData::formats() const
{
if (!fragment.isEmpty())
return QStringList() << QString::fromLatin1("text/plain") << QString::fromLatin1("text/html")
-#ifndef QT_NO_TEXTODFWRITER
+#if QT_CONFIG(textodfwriter)
<< QString::fromLatin1("application/vnd.oasis.opendocument.text")
#endif
;
@@ -1875,10 +1872,10 @@ QVariant QQuickTextEditMimeData::retrieveData(const QString &mimeType, QVariant:
void QQuickTextEditMimeData::setup() const
{
QQuickTextEditMimeData *that = const_cast<QQuickTextEditMimeData *>(this);
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
that->setData(QLatin1String("text/html"), fragment.toHtml("utf-8").toUtf8());
#endif
-#ifndef QT_NO_TEXTODFWRITER
+#if QT_CONFIG(textodfwriter)
{
QBuffer buffer;
QTextDocumentWriter writer(&buffer, "ODF");
diff --git a/src/quick/items/qquicktextcontrol_p.h b/src/quick/items/qquicktextcontrol_p.h
index 602e457cb8..7992d2943b 100644
--- a/src/quick/items/qquicktextcontrol_p.h
+++ b/src/quick/items/qquicktextcontrol_p.h
@@ -89,7 +89,7 @@ public:
QString toPlainText() const;
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
QString toHtml() const;
#endif
@@ -129,7 +129,7 @@ public Q_SLOTS:
void setPlainText(const QString &text);
void setHtml(const QString &text);
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void cut();
void copy();
void paste(QClipboard::Mode mode = QClipboard::Clipboard);
@@ -164,7 +164,7 @@ public:
virtual void processEvent(QEvent *e, const QMatrix &matrix);
void processEvent(QEvent *e, const QPointF &coordinateOffset = QPointF());
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
virtual QVariant inputMethodQuery(Qt::InputMethodQuery property) const;
Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
#endif
diff --git a/src/quick/items/qquicktextcontrol_p_p.h b/src/quick/items/qquicktextcontrol_p_p.h
index 0f78feb5de..0582e6d113 100644
--- a/src/quick/items/qquicktextcontrol_p_p.h
+++ b/src/quick/items/qquicktextcontrol_p_p.h
@@ -90,7 +90,7 @@ public:
void _q_updateCurrentCharFormatAndSelection();
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void setClipboardSelection();
#endif
@@ -114,14 +114,14 @@ public:
void mouseDoubleClickEvent(QMouseEvent *event, const QPointF &pos);
bool sendMouseEventToInputContext(QMouseEvent *event, const QPointF &pos);
void focusEvent(QFocusEvent *e);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void inputMethodEvent(QInputMethodEvent *);
#endif
void hoverEvent(QHoverEvent *e, const QPointF &pos);
void activateLinkUnderCursor(QString href = QString());
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
bool isPreediting() const;
void commitPreedit();
void cancelPreedit();
@@ -143,7 +143,7 @@ public:
QBasicTimer cursorBlinkTimer;
QBasicTimer tripleClickTimer;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
int preeditCursor;
#endif
diff --git a/src/quick/items/qquicktextdocument.cpp b/src/quick/items/qquicktextdocument.cpp
index 1dc54eb107..e7492b97ae 100644
--- a/src/quick/items/qquicktextdocument.cpp
+++ b/src/quick/items/qquicktextdocument.cpp
@@ -230,7 +230,7 @@ void QQuickTextDocumentWithImageResources::setText(const QString &text)
{
clearResources();
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
setHtml(text);
#else
setPlainText(text);
diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp
index 3389a608bf..b99e53b6c8 100644
--- a/src/quick/items/qquicktextedit.cpp
+++ b/src/quick/items/qquicktextedit.cpp
@@ -190,7 +190,7 @@ QString QQuickTextEdit::text() const
Q_D(const QQuickTextEdit);
if (!d->textCached && isComponentComplete()) {
QQuickTextEditPrivate *d = const_cast<QQuickTextEditPrivate *>(d_func());
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
if (d->richText)
d->text = d->control->toHtml();
else
@@ -381,7 +381,7 @@ void QQuickTextEdit::setText(const QString &text)
if (!isComponentComplete()) {
d->text = text;
} else if (d->richText) {
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
d->control->setHtml(text);
#else
d->control->setPlainText(text);
@@ -458,7 +458,7 @@ void QQuickTextEdit::setTextFormat(TextFormat format)
bool wasRich = d->richText;
d->richText = format == RichText || (format == AutoText && (wasRich || Qt::mightBeRichText(text())));
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
if (isComponentComplete()) {
if (wasRich && !d->richText) {
d->control->setPlainText(!d->textCached ? d->control->toHtml() : d->text);
@@ -540,7 +540,7 @@ void QQuickTextEdit::setFont(const QFont &font)
}
updateSize();
updateWholeDocument();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
updateInputMethod(Qt::ImCursorRectangle | Qt::ImAnchorRectangle | Qt::ImFont);
#endif
}
@@ -738,7 +738,7 @@ bool QQuickTextEditPrivate::determineHorizontalAlignment()
Q_Q(QQuickTextEdit);
if (hAlignImplicit && q->isComponentComplete()) {
Qt::LayoutDirection direction = contentDirection;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (direction == Qt::LayoutDirectionAuto) {
const QString preeditText = control->textCursor().block().layout()->preeditAreaText();
direction = textDirection(preeditText);
@@ -764,7 +764,7 @@ void QQuickTextEditPrivate::mirrorChange()
}
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Qt::InputMethodHints QQuickTextEditPrivate::effectiveInputMethodHints() const
{
return inputMethodHints | Qt::ImhMultiLine;
@@ -1012,7 +1012,7 @@ int QQuickTextEdit::positionAt(qreal x, qreal y) const
y -= d->yoff;
int r = d->document->documentLayout()->hitTest(QPointF(x, y), Qt::FuzzyHit);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
QTextCursor cursor = d->control->textCursor();
if (r > cursor.position()) {
// The cursor position includes positions within the preedit text, but only positions in the
@@ -1261,7 +1261,7 @@ int QQuickTextEdit::selectionEnd() const
QString QQuickTextEdit::selectedText() const
{
Q_D(const QQuickTextEdit);
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
return d->richText
? d->control->textCursor().selectedText()
: d->control->textCursor().selection().toPlainText();
@@ -1379,17 +1379,17 @@ void QQuickTextEdit::setTextMargin(qreal margin)
Qt::InputMethodHints QQuickTextEdit::inputMethodHints() const
{
-#ifdef QT_NO_IM
+#if !QT_CONFIG(im)
return Qt::ImhNone;
#else
Q_D(const QQuickTextEdit);
return d->inputMethodHints;
-#endif // QT_NO_IM
+#endif // im
}
void QQuickTextEdit::setInputMethodHints(Qt::InputMethodHints hints)
{
-#ifdef QT_NO_IM
+#if !QT_CONFIG(im)
Q_UNUSED(hints);
#else
Q_D(QQuickTextEdit);
@@ -1400,7 +1400,7 @@ void QQuickTextEdit::setInputMethodHints(Qt::InputMethodHints hints)
d->inputMethodHints = hints;
updateInputMethod(Qt::ImHints);
emit inputMethodHintsChanged();
-#endif // QT_NO_IM
+#endif // im
}
void QQuickTextEdit::geometryChanged(const QRectF &newGeometry,
@@ -1427,7 +1427,7 @@ void QQuickTextEdit::componentComplete()
QQuickImplicitSizeItem::componentComplete();
d->document->setBaseUrl(baseUrl());
-#ifndef QT_NO_TEXTHTML_PARSER
+#if QT_CONFIG(texthtmlparser)
if (d->richText)
d->control->setHtml(d->text);
else
@@ -1554,7 +1554,7 @@ void QQuickTextEdit::setReadOnly(bool r)
if (r == isReadOnly())
return;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
setFlag(QQuickItem::ItemAcceptsInputMethod, !r);
#endif
Qt::TextInteractionFlags flags = Qt::LinksAccessibleByMouse;
@@ -1569,7 +1569,7 @@ void QQuickTextEdit::setReadOnly(bool r)
d->control->setTextInteractionFlags(flags);
d->control->moveCursor(QTextCursor::End);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
updateInputMethod(Qt::ImEnabled);
#endif
q_canPasteChanged();
@@ -1748,7 +1748,7 @@ bool QQuickTextEdit::isRightToLeft(int start, int end)
}
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
/*!
\qmlmethod QtQuick::TextEdit::cut()
@@ -1781,7 +1781,7 @@ void QQuickTextEdit::paste()
Q_D(QQuickTextEdit);
d->control->paste();
}
-#endif // QT_NO_CLIPBOARD
+#endif // clipboard
/*!
@@ -1822,7 +1822,7 @@ void QQuickTextEdit::mousePressEvent(QMouseEvent *event)
bool hadActiveFocus = hasActiveFocus();
forceActiveFocus(Qt::MouseFocusReason);
// re-open input panel on press if already focused
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (hasActiveFocus() && hadActiveFocus && !isReadOnly())
qGuiApp->inputMethod()->show();
#else
@@ -1870,7 +1870,7 @@ void QQuickTextEdit::mouseMoveEvent(QMouseEvent *event)
QQuickImplicitSizeItem::mouseMoveEvent(event);
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
/*!
\overload
Handles the given input method \a event.
@@ -1923,7 +1923,7 @@ QVariant QQuickTextEdit::inputMethodQuery(Qt::InputMethodQuery property) const
{
return inputMethodQuery(property, QVariant());
}
-#endif // QT_NO_IM
+#endif // im
void QQuickTextEdit::triggerPreprocess()
{
@@ -2197,12 +2197,12 @@ bool QQuickTextEdit::canRedo() const
*/
bool QQuickTextEdit::isInputMethodComposing() const
{
-#ifdef QT_NO_IM
+#if !QT_CONFIG(im)
return false;
#else
Q_D(const QQuickTextEdit);
return d->control->hasImState();
-#endif // QT_NO_IM
+#endif // im
}
QQuickTextEditPrivate::ExtraData::ExtraData()
@@ -2223,14 +2223,14 @@ void QQuickTextEditPrivate::init()
{
Q_Q(QQuickTextEdit);
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
if (QGuiApplication::clipboard()->supportsSelection())
q->setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton);
else
#endif
q->setAcceptedMouseButtons(Qt::LeftButton);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
q->setFlag(QQuickItem::ItemAcceptsInputMethod);
#endif
q->setFlag(QQuickItem::ItemHasContents);
@@ -2255,7 +2255,7 @@ void QQuickTextEditPrivate::init()
qmlobject_connect(control, QQuickTextControl, SIGNAL(overwriteModeChanged(bool)), q, QQuickTextEdit, SIGNAL(overwriteModeChanged(bool)));
qmlobject_connect(control, QQuickTextControl, SIGNAL(textChanged()), q, QQuickTextEdit, SLOT(q_textChanged()));
qmlobject_connect(control, QQuickTextControl, SIGNAL(preeditTextChanged()), q, QQuickTextEdit, SIGNAL(preeditTextChanged()));
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
qmlobject_connect(QGuiApplication::clipboard(), QClipboard, SIGNAL(dataChanged()), q, QQuickTextEdit, SLOT(q_canPasteChanged()));
#endif
qmlobject_connect(document, QQuickTextDocumentWithImageResources, SIGNAL(undoAvailable(bool)), q, QQuickTextEdit, SIGNAL(canUndoChanged()));
@@ -2341,7 +2341,7 @@ void QQuickTextEdit::q_contentsChange(int pos, int charsRemoved, int charsAdded)
void QQuickTextEdit::moveCursorDelegate()
{
Q_D(QQuickTextEdit);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
updateInputMethod();
#endif
emit cursorRectangleChanged();
@@ -2582,7 +2582,7 @@ void QQuickTextEditPrivate::updateDefaultTextOption()
else
opt.setAlignment(Qt::Alignment(vAlign));
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (contentDirection == Qt::LayoutDirectionAuto) {
opt.setTextDirection(qGuiApp->inputMethod()->inputDirection());
} else
@@ -2627,14 +2627,14 @@ void QQuickTextEditPrivate::handleFocusEvent(QFocusEvent *event)
control->processEvent(event, QPointF(-xoff, -yoff));
if (focus) {
q->q_updateAlignment();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (focusOnPress && !q->isReadOnly())
qGuiApp->inputMethod()->show();
q->connect(QGuiApplication::inputMethod(), SIGNAL(inputDirectionChanged(Qt::LayoutDirection)),
q, SLOT(q_updateAlignment()));
#endif
} else {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
q->disconnect(QGuiApplication::inputMethod(), SIGNAL(inputDirectionChanged(Qt::LayoutDirection)),
q, SLOT(q_updateAlignment()));
#endif
@@ -2685,7 +2685,7 @@ QString QQuickTextEdit::getText(int start, int end) const
QTextCursor cursor(d->document);
cursor.setPosition(start, QTextCursor::MoveAnchor);
cursor.setPosition(end, QTextCursor::KeepAnchor);
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
return d->richText
? cursor.selectedText()
: cursor.selection().toPlainText();
@@ -2714,7 +2714,7 @@ QString QQuickTextEdit::getFormattedText(int start, int end) const
cursor.setPosition(end, QTextCursor::KeepAnchor);
if (d->richText) {
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
return cursor.selection().toHtml();
#else
return cursor.selection().toPlainText();
@@ -2738,7 +2738,7 @@ void QQuickTextEdit::insert(int position, const QString &text)
cursor.setPosition(position);
d->richText = d->richText || (d->format == AutoText && Qt::mightBeRichText(text));
if (d->richText) {
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
cursor.insertHtml(text);
#else
cursor.insertText(text);
@@ -2831,12 +2831,12 @@ QString QQuickTextEdit::hoveredLink() const
if (const_cast<QQuickTextEditPrivate *>(d)->isLinkHoveredConnected()) {
return d->control->hoveredLink();
} else {
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
if (QQuickWindow *wnd = window()) {
QPointF pos = QCursor::pos(wnd->screen()) - wnd->position() - mapToScene(QPointF(0, 0));
return d->control->anchorAt(pos);
}
-#endif // QT_NO_CURSOR
+#endif // cursor
}
return QString();
}
@@ -2881,7 +2881,7 @@ void QQuickTextEdit::append(const QString &text)
if (!d->document->isEmpty())
cursor.insertBlock();
-#ifndef QT_NO_TEXTHTMLPARSER
+#if QT_CONFIG(texthtmlparser)
if (d->format == RichText || (d->format == AutoText && Qt::mightBeRichText(text))) {
cursor.insertHtml(text);
} else {
@@ -2889,7 +2889,7 @@ void QQuickTextEdit::append(const QString &text)
}
#else
cursor.insertText(text);
-#endif // QT_NO_TEXTHTMLPARSER
+#endif // texthtmlparser
cursor.endEditBlock();
d->control->updateCursorRectangle(false);
diff --git a/src/quick/items/qquicktextedit_p.h b/src/quick/items/qquicktextedit_p.h
index 42c9064860..c8d3515be1 100644
--- a/src/quick/items/qquicktextedit_p.h
+++ b/src/quick/items/qquicktextedit_p.h
@@ -242,7 +242,7 @@ public:
QRectF cursorRectangle() const;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
QVariant inputMethodQuery(Qt::InputMethodQuery property) const Q_DECL_OVERRIDE;
Q_REVISION(4) Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
#endif
@@ -347,7 +347,7 @@ public Q_SLOTS:
void select(int start, int end);
void deselect();
bool isRightToLeft(int start, int end);
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void cut();
void copy();
void paste();
@@ -399,7 +399,7 @@ protected:
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void inputMethodEvent(QInputMethodEvent *e) Q_DECL_OVERRIDE;
#endif
QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) Q_DECL_OVERRIDE;
diff --git a/src/quick/items/qquicktextedit_p_p.h b/src/quick/items/qquicktextedit_p_p.h
index 1613dd7676..03bce00cb0 100644
--- a/src/quick/items/qquicktextedit_p_p.h
+++ b/src/quick/items/qquicktextedit_p_p.h
@@ -119,7 +119,7 @@ public:
#endif
, contentDirection(Qt::LayoutDirectionAuto)
, mouseSelectionMode(QQuickTextEdit::SelectCharacters)
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
, inputMethodHints(Qt::ImhNone)
#endif
, updateType(UpdatePaintNode)
@@ -156,7 +156,7 @@ public:
void addCurrentTextNodeToRoot(QQuickTextNodeEngine *, QSGTransformNode *, QQuickTextNode*, TextNodeIterator&, int startPos);
QQuickTextNode* createTextNode();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Qt::InputMethodHints effectiveInputMethodHints() const;
#endif
@@ -208,7 +208,7 @@ public:
QQuickTextEdit::RenderType renderType;
Qt::LayoutDirection contentDirection;
QQuickTextEdit::SelectionMode mouseSelectionMode;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Qt::InputMethodHints inputMethodHints;
#endif
UpdateType updateType;
diff --git a/src/quick/items/qquicktextinput.cpp b/src/quick/items/qquicktextinput.cpp
index dc4aecbbeb..96a46df2f4 100644
--- a/src/quick/items/qquicktextinput.cpp
+++ b/src/quick/items/qquicktextinput.cpp
@@ -57,7 +57,7 @@
#include <QtGui/qinputmethod.h>
#include <QtCore/qmath.h>
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
#include "qaccessible.h"
#include "qquickaccessibleattached_p.h"
#endif
@@ -142,7 +142,7 @@ void QQuickTextInput::setText(const QString &s)
if (s == text())
return;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
d->cancelPreedit();
#endif
d->internalSetText(s, -1, false);
@@ -400,7 +400,7 @@ void QQuickTextInput::setFont(const QFont &font)
if (oldFont != d->font) {
d->updateLayout();
updateCursorRectangle();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
updateInputMethod(Qt::ImCursorRectangle | Qt::ImFont | Qt::ImAnchorRectangle);
#endif
}
@@ -575,7 +575,7 @@ bool QQuickTextInputPrivate::setHAlign(QQuickTextInput::HAlignment alignment, bo
Qt::LayoutDirection QQuickTextInputPrivate::textDirection() const
{
QString text = m_text;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (text.isEmpty())
text = m_textLayout.preeditAreaText();
#endif
@@ -602,7 +602,7 @@ Qt::LayoutDirection QQuickTextInputPrivate::layoutDirection() const
Qt::LayoutDirection direction = m_layoutDirection;
if (direction == Qt::LayoutDirectionAuto) {
direction = textDirection();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (direction == Qt::LayoutDirectionAuto)
direction = QGuiApplication::inputMethod()->inputDirection();
#endif
@@ -615,7 +615,7 @@ bool QQuickTextInputPrivate::determineHorizontalAlignment()
if (hAlignImplicit) {
// if no explicit alignment has been set, follow the natural layout direction of the text
Qt::LayoutDirection direction = textDirection();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (direction == Qt::LayoutDirectionAuto)
direction = QGuiApplication::inputMethod()->inputDirection();
#endif
@@ -707,12 +707,12 @@ void QQuickTextInput::setReadOnly(bool ro)
if (d->m_readOnly == ro)
return;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
setFlag(QQuickItem::ItemAcceptsInputMethod, !ro);
#endif
d->m_readOnly = ro;
d->setCursorPosition(d->end());
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
updateInputMethod(Qt::ImEnabled);
#endif
q_canPasteChanged();
@@ -830,7 +830,7 @@ QRectF QQuickTextInput::cursorRectangle() const
Q_D(const QQuickTextInput);
int c = d->m_cursor;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
c += d->m_preeditCursor;
#endif
if (d->m_echoMode == NoEcho)
@@ -994,17 +994,17 @@ void QQuickTextInput::setAutoScroll(bool b)
QValidator* QQuickTextInput::validator() const
{
-#ifdef QT_NO_VALIDATOR
+#if !QT_CONFIG(validator)
return 0;
#else
Q_D(const QQuickTextInput);
return d->m_validator;
-#endif // QT_NO_VALIDATOR
+#endif // validator
}
void QQuickTextInput::setValidator(QValidator* v)
{
-#ifdef QT_NO_VALIDATOR
+#if !QT_CONFIG(validator)
Q_UNUSED(v);
#else
Q_D(QQuickTextInput);
@@ -1029,16 +1029,16 @@ void QQuickTextInput::setValidator(QValidator* v)
d->checkIsValid();
emit validatorChanged();
-#endif // QT_NO_VALIDATOR
+#endif // validator
}
-#ifndef QT_NO_VALIDATOR
+#if QT_CONFIG(validator)
void QQuickTextInput::q_validatorChanged()
{
Q_D(QQuickTextInput);
d->checkIsValid();
}
-#endif // QT_NO_VALIDATOR
+#endif // validator
QRectF QQuickTextInputPrivate::anchorRectangle() const
{
@@ -1056,7 +1056,7 @@ QRectF QQuickTextInputPrivate::anchorRectangle() const
else
a = m_selstart == m_cursor ? m_selend : m_selstart;
if (a >= 0) {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
a += m_preeditCursor;
#endif
if (m_echoMode == QQuickTextInput::NoEcho)
@@ -1151,7 +1151,7 @@ bool QQuickTextInput::hasAcceptableInput() const
The corresponding handler is \c onEditingFinished.
*/
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Qt::InputMethodHints QQuickTextInputPrivate::effectiveInputMethodHints() const
{
Qt::InputMethodHints hints = inputMethodHints;
@@ -1192,7 +1192,7 @@ void QQuickTextInput::setEchoMode(QQuickTextInput::EchoMode echo)
d->cancelPasswordEchoTimer();
d->m_echoMode = echo;
d->m_passwordEchoEditing = false;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
updateInputMethod(Qt::ImHints);
#endif
d->updateDisplayText();
@@ -1249,17 +1249,17 @@ void QQuickTextInput::setEchoMode(QQuickTextInput::EchoMode echo)
Qt::InputMethodHints QQuickTextInput::inputMethodHints() const
{
-#ifdef QT_NO_IM
+#if !QT_CONFIG(im)
return Qt::ImhNone;
#else
Q_D(const QQuickTextInput);
return d->inputMethodHints;
-#endif // QT_NO_IM
+#endif // im
}
void QQuickTextInput::setInputMethodHints(Qt::InputMethodHints hints)
{
-#ifdef QT_NO_IM
+#if !QT_CONFIG(im)
Q_UNUSED(hints);
#else
Q_D(QQuickTextInput);
@@ -1270,7 +1270,7 @@ void QQuickTextInput::setInputMethodHints(Qt::InputMethodHints hints)
d->inputMethodHints = hints;
updateInputMethod(Qt::ImHints);
emit inputMethodHintsChanged();
-#endif // QT_NO_IM
+#endif // im
}
/*!
@@ -1319,7 +1319,7 @@ QRectF QQuickTextInput::positionToRectangle(int pos) const
Q_D(const QQuickTextInput);
if (d->m_echoMode == NoEcho)
pos = 0;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
else if (pos > d->m_cursor)
pos += d->preeditAreaText().length();
#endif
@@ -1389,7 +1389,7 @@ void QQuickTextInput::positionAt(QQmlV4Function *args) const
int pos = d->positionAt(x, y, position);
const int cursor = d->m_cursor;
if (pos > cursor) {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
const int preeditLength = d->preeditAreaText().length();
pos = pos > cursor + preeditLength
? pos - preeditLength
@@ -1470,7 +1470,7 @@ void QQuickTextInput::keyPressEvent(QKeyEvent* ev)
QQuickImplicitSizeItem::keyPressEvent(ev);
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void QQuickTextInput::inputMethodEvent(QInputMethodEvent *ev)
{
Q_D(QQuickTextInput);
@@ -1493,7 +1493,7 @@ void QQuickTextInput::mouseDoubleClickEvent(QMouseEvent *event)
Q_D(QQuickTextInput);
if (d->selectByMouse && event->button() == Qt::LeftButton) {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
d->commitPreedit();
#endif
int cursor = d->positionAt(event->localPos());
@@ -1549,7 +1549,7 @@ void QQuickTextInput::mouseMoveEvent(QMouseEvent *event)
if (qAbs(int(event->localPos().x() - d->pressPos.x())) > QGuiApplication::styleHints()->startDragDistance())
setKeepMouseGrab(true);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (d->composeMode()) {
// start selection
int startPos = d->positionAt(d->pressPos);
@@ -1576,7 +1576,7 @@ void QQuickTextInput::mouseReleaseEvent(QMouseEvent *event)
d->selectPressed = false;
setKeepMouseGrab(false);
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
if (QGuiApplication::clipboard()->supportsSelection()) {
if (event->button() == Qt::LeftButton) {
d->copy(QClipboard::Selection);
@@ -1596,7 +1596,7 @@ void QQuickTextInput::mouseReleaseEvent(QMouseEvent *event)
bool QQuickTextInputPrivate::sendMouseEventToInputContext(QMouseEvent *event)
{
-#if !defined QT_NO_IM
+#if QT_CONFIG(im)
if (composeMode()) {
int tmp_cursor = positionAt(event->localPos());
int mousePos = tmp_cursor - m_cursor;
@@ -1623,7 +1623,7 @@ void QQuickTextInput::mouseUngrabEvent()
bool QQuickTextInput::event(QEvent* ev)
{
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
Q_D(QQuickTextInput);
if (ev->type() == QEvent::ShortcutOverride) {
if (d->m_readOnly)
@@ -1723,7 +1723,7 @@ void QQuickTextInputPrivate::ensureVisible(int position, int preeditCursor, int
// left
hscroll = width - widthUsed;
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (preeditLength > 0) {
// check to ensure long pre-edit text doesn't push the cursor
// off to the left
@@ -1740,7 +1740,7 @@ void QQuickTextInputPrivate::ensureVisible(int position, int preeditCursor, int
void QQuickTextInputPrivate::updateHorizontalScroll()
{
if (autoScroll && m_echoMode != QQuickTextInput::NoEcho) {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
const int preeditLength = m_textLayout.preeditAreaText().length();
ensureVisible(m_cursor, m_preeditCursor, preeditLength);
#else
@@ -1754,7 +1754,7 @@ void QQuickTextInputPrivate::updateHorizontalScroll()
void QQuickTextInputPrivate::updateVerticalScroll()
{
Q_Q(QQuickTextInput);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
const int preeditLength = m_textLayout.preeditAreaText().length();
#endif
const qreal height = qMax<qreal>(0, q->height() - q->topPadding() - q->bottomPadding());
@@ -1766,7 +1766,7 @@ void QQuickTextInputPrivate::updateVerticalScroll()
vscroll = -QQuickTextUtil::alignedY(
heightUsed, height, vAlign & ~(Qt::AlignAbsolute|Qt::AlignHorizontal_Mask));
} else {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
QTextLine currentLine = m_textLayout.lineForTextPosition(m_cursor + preeditLength);
#else
QTextLine currentLine = m_textLayout.lineForTextPosition(m_cursor);
@@ -1786,7 +1786,7 @@ void QQuickTextInputPrivate::updateVerticalScroll()
// right
vscroll = heightUsed - height;
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (preeditLength > 0) {
// check to ensure long pre-edit text doesn't push the cursor
// off the top
@@ -1827,7 +1827,7 @@ void QQuickTextInput::ensureActiveFocus()
{
bool hadActiveFocus = hasActiveFocus();
forceActiveFocus();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Q_D(QQuickTextInput);
// re-open input panel on press if already focused
if (hasActiveFocus() && hadActiveFocus && !d->m_readOnly)
@@ -1877,7 +1877,7 @@ QSGNode *QQuickTextInput::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData
}
if (!d->m_textLayout.text().isEmpty()
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
|| !d->m_textLayout.preeditAreaText().isEmpty()
#endif
) {
@@ -1900,7 +1900,7 @@ QSGNode *QQuickTextInput::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData
return node;
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
QVariant QQuickTextInput::inputMethodQuery(Qt::InputMethodQuery property) const
{
return inputMethodQuery(property, QVariant());
@@ -1957,7 +1957,7 @@ QVariant QQuickTextInput::inputMethodQuery(Qt::InputMethodQuery property, QVaria
return QQuickItem::inputMethodQuery(property);
}
}
-#endif // QT_NO_IM
+#endif // im
/*!
\qmlmethod QtQuick::TextInput::deselect()
@@ -1997,7 +1997,7 @@ bool QQuickTextInput::isRightToLeft(int start, int end)
}
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
/*!
\qmlmethod QtQuick::TextInput::cut()
@@ -2042,7 +2042,7 @@ void QQuickTextInput::paste()
if (!d->m_readOnly)
d->paste();
}
-#endif // QT_NO_CLIPBOARD
+#endif // clipboard
/*!
\qmlmethod QtQuick::TextInput::undo()
@@ -2416,7 +2416,7 @@ void QQuickTextInput::setPersistentSelection(bool on)
*/
bool QQuickTextInput::canPaste() const
{
-#if !defined(QT_NO_CLIPBOARD)
+#if QT_CONFIG(clipboard)
Q_D(const QQuickTextInput);
if (!d->canPasteValid) {
if (const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData())
@@ -2597,7 +2597,7 @@ void QQuickTextInputPrivate::handleFocusEvent(QFocusEvent *event)
}
if (focus) {
q->q_updateAlignment();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (focusOnPress && !m_readOnly)
qGuiApp->inputMethod()->show();
q->connect(QGuiApplication::inputMethod(), SIGNAL(inputDirectionChanged(Qt::LayoutDirection)),
@@ -2617,7 +2617,7 @@ void QQuickTextInputPrivate::handleFocusEvent(QFocusEvent *event)
if (hasAcceptableInput(m_text) == AcceptableInput || fixup())
emit q->editingFinished();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
q->disconnect(QGuiApplication::inputMethod(), SIGNAL(inputDirectionChanged(Qt::LayoutDirection)),
q, SLOT(q_updateAlignment()));
#endif
@@ -2645,7 +2645,7 @@ void QQuickTextInput::focusOutEvent(QFocusEvent *event)
*/
bool QQuickTextInput::isInputMethodComposing() const
{
-#ifdef QT_NO_IM
+#if !QT_CONFIG(im)
return false;
#else
Q_D(const QQuickTextInput);
@@ -2670,21 +2670,21 @@ QQuickTextInputPrivate::ExtraData::ExtraData()
void QQuickTextInputPrivate::init()
{
Q_Q(QQuickTextInput);
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
if (QGuiApplication::clipboard()->supportsSelection())
q->setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton);
else
#endif
q->setAcceptedMouseButtons(Qt::LeftButton);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
q->setFlag(QQuickItem::ItemAcceptsInputMethod);
#endif
q->setFlag(QQuickItem::ItemHasContents);
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
qmlobject_connect(QGuiApplication::clipboard(), QClipboard, SIGNAL(dataChanged()),
q, QQuickTextInput, SLOT(q_canPasteChanged()));
-#endif // QT_NO_CLIPBOARD
+#endif // clipboard
lastSelectionStart = 0;
lastSelectionEnd = 0;
@@ -2723,7 +2723,7 @@ void QQuickTextInput::updateCursorRectangle(bool scroll)
d->cursorItem->setPosition(r.topLeft());
d->cursorItem->setHeight(r.height());
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
updateInputMethod(Qt::ImCursorRectangle | Qt::ImAnchorRectangle);
#endif
}
@@ -2783,7 +2783,7 @@ void QQuickTextInput::q_canPasteChanged()
{
Q_D(QQuickTextInput);
bool old = d->canPaste;
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
if (const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData())
d->canPaste = !d->m_readOnly && mimeData->hasText();
else
@@ -2877,7 +2877,7 @@ qreal QQuickTextInputPrivate::getImplicitWidth() const
option.setAlignment(Qt::Alignment(q->effectiveHAlign()));
layout.setTextOption(option);
layout.setFont(font);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
layout.setPreeditArea(m_textLayout.preeditAreaPosition(), m_textLayout.preeditAreaText());
#endif
layout.beginLayout();
@@ -3054,7 +3054,7 @@ void QQuickTextInputPrivate::updateBaselineOffset()
q->setBaselineOffset(fm.ascent() + yoff + q->topPadding());
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
/*!
\internal
@@ -3091,9 +3091,9 @@ void QQuickTextInputPrivate::paste(QClipboard::Mode clipboardMode)
}
}
-#endif // !QT_NO_CLIPBOARD
+#endif // clipboard
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
/*!
\internal
*/
@@ -3125,7 +3125,7 @@ void QQuickTextInputPrivate::cancelPreedit()
QInputMethodEvent ev;
QCoreApplication::sendEvent(q, &ev);
}
-#endif // QT_NO_IM
+#endif // im
/*!
\internal
@@ -3225,7 +3225,7 @@ void QQuickTextInputPrivate::clear()
void QQuickTextInputPrivate::setSelection(int start, int length)
{
Q_Q(QQuickTextInput);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
commitPreedit();
#endif
@@ -3257,7 +3257,7 @@ void QQuickTextInputPrivate::setSelection(int start, int length)
}
emit q->selectionChanged();
emitCursorPositionChanged();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
q->updateInputMethod(Qt::ImCursorRectangle | Qt::ImAnchorRectangle | Qt::ImCursorPosition | Qt::ImAnchorPosition
| Qt::ImCurrentSelection);
#endif
@@ -3287,7 +3287,7 @@ void QQuickTextInputPrivate::updatePasswordEchoEditing(bool editing)
*/
bool QQuickTextInputPrivate::fixup() // this function assumes that validate currently returns != Acceptable
{
-#ifndef QT_NO_VALIDATOR
+#if QT_CONFIG(validator)
if (m_validator) {
QString textCopy = m_text;
int cursorCopy = m_cursor;
@@ -3311,7 +3311,7 @@ bool QQuickTextInputPrivate::fixup() // this function assumes that validate curr
void QQuickTextInputPrivate::moveCursor(int pos, bool mark)
{
Q_Q(QQuickTextInput);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
commitPreedit();
#endif
@@ -3339,12 +3339,12 @@ void QQuickTextInputPrivate::moveCursor(int pos, bool mark)
emit q->selectionChanged();
}
emitCursorPositionChanged();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
q->updateInputMethod();
#endif
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
/*!
\internal
@@ -3461,7 +3461,7 @@ void QQuickTextInputPrivate::processInputMethodEvent(QInputMethodEvent *event)
| Qt::ImCurrentSelection);
}
}
-#endif // QT_NO_IM
+#endif // im
/*!
\internal
@@ -3501,7 +3501,7 @@ bool QQuickTextInputPrivate::finishChange(int validateFromState, bool update, bo
Q_Q(QQuickTextInput);
Q_UNUSED(update)
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
bool inputMethodAttributesChanged = m_textDirty || m_selDirty;
#endif
bool alignmentChanged = false;
@@ -3513,7 +3513,7 @@ bool QQuickTextInputPrivate::finishChange(int validateFromState, bool update, bo
bool wasAcceptable = m_acceptableInput;
m_validInput = true;
m_acceptableInput = true;
-#ifndef QT_NO_VALIDATOR
+#if QT_CONFIG(validator)
if (m_validator) {
QString textCopy = m_text;
int cursorCopy = m_cursor;
@@ -3563,7 +3563,7 @@ bool QQuickTextInputPrivate::finishChange(int validateFromState, bool update, bo
if (m_textDirty) {
textChanged = true;
m_textDirty = false;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
m_preeditDirty = false;
#endif
alignmentChanged = determineHorizontalAlignment();
@@ -3575,7 +3575,7 @@ bool QQuickTextInputPrivate::finishChange(int validateFromState, bool update, bo
if (m_acceptableInput != wasAcceptable)
emit q->acceptableInputChanged();
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (m_preeditDirty) {
m_preeditDirty = false;
if (determineHorizontalAlignment()) {
@@ -3590,7 +3590,7 @@ bool QQuickTextInputPrivate::finishChange(int validateFromState, bool update, bo
emit q->selectionChanged();
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
inputMethodAttributesChanged |= (m_cursor != m_lastCursorPos);
if (inputMethodAttributesChanged)
q->updateInputMethod();
@@ -3624,7 +3624,7 @@ void QQuickTextInputPrivate::internalSetText(const QString &txt, int pos, bool e
m_textDirty = (oldText != m_text);
bool changed = finishChange(-1, true, edited);
-#ifdef QT_NO_ACCESSIBILITY
+#if !QT_CONFIG(accessibility)
Q_UNUSED(changed)
#else
Q_Q(QQuickTextInput);
@@ -3969,7 +3969,7 @@ bool QQuickTextInputPrivate::isValidInput(QChar key, QChar mask) const
*/
QQuickTextInputPrivate::ValidatorState QQuickTextInputPrivate::hasAcceptableInput(const QString &str) const
{
-#ifndef QT_NO_VALIDATOR
+#if QT_CONFIG(validator)
QString textCopy = str;
int cursorCopy = m_cursor;
if (m_validator) {
@@ -4279,7 +4279,7 @@ bool QQuickTextInputPrivate::emitCursorPositionChanged()
}
}
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
if (QAccessible::isActive()) {
if (QObject *acc = QQuickAccessibleAttached::findAccessible(q, QAccessible::EditableText)) {
QAccessibleTextCursorEvent ev(acc, m_cursor);
@@ -4390,7 +4390,7 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event)
if (false) {
}
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut)
else if (event == QKeySequence::Undo) {
q->undo();
}
@@ -4400,7 +4400,7 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event)
else if (event == QKeySequence::SelectAll) {
selectAll();
}
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
else if (event == QKeySequence::Copy) {
copy();
}
@@ -4417,7 +4417,7 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event)
if (!m_readOnly)
deleteEndOfLine();
}
-#endif //QT_NO_CLIPBOARD
+#endif // clipboard
else if (event == QKeySequence::MoveToStartOfLine || event == QKeySequence::MoveToStartOfBlock) {
home(0);
}
@@ -4489,13 +4489,13 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event)
} else if (event == QKeySequence::DeleteCompleteLine) {
if (!m_readOnly) {
selectAll();
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
copy();
#endif
del();
}
}
-#endif // QT_NO_SHORTCUT
+#endif // shortcut
else {
bool handled = false;
if (event->modifiers() & Qt::ControlModifier) {
diff --git a/src/quick/items/qquicktextinput_p.h b/src/quick/items/qquicktextinput_p.h
index d0461f551e..f4545e1574 100644
--- a/src/quick/items/qquicktextinput_p.h
+++ b/src/quick/items/qquicktextinput_p.h
@@ -266,7 +266,7 @@ public:
bool hasAcceptableInput() const;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
QVariant inputMethodQuery(Qt::InputMethodQuery property) const Q_DECL_OVERRIDE;
Q_REVISION(3) Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const;
#endif
@@ -372,7 +372,7 @@ protected:
void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
void keyPressEvent(QKeyEvent* ev) Q_DECL_OVERRIDE;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void inputMethodEvent(QInputMethodEvent *) Q_DECL_OVERRIDE;
#endif
void mouseUngrabEvent() Q_DECL_OVERRIDE;
@@ -389,7 +389,7 @@ public Q_SLOTS:
void select(int start, int end);
void deselect();
bool isRightToLeft(int start, int end);
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void cut();
void copy();
void paste();
@@ -409,7 +409,7 @@ private Q_SLOTS:
void q_updateAlignment();
void triggerPreprocess();
-#ifndef QT_NO_VALIDATOR
+#if QT_CONFIG(validator)
void q_validatorChanged();
#endif
diff --git a/src/quick/items/qquicktextinput_p_p.h b/src/quick/items/qquicktextinput_p_p.h
index 93a8778c40..d1aaefa6a7 100644
--- a/src/quick/items/qquicktextinput_p_p.h
+++ b/src/quick/items/qquicktextinput_p_p.h
@@ -104,7 +104,7 @@ public:
, selectionColor(QRgb(0xFF000080))
, selectedTextColor(QRgb(0xFFFFFFFF))
, m_cursor(0)
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
, m_preeditCursor(0)
#endif
, m_blinkEnabled(false)
@@ -114,7 +114,7 @@ public:
, m_undoState(0)
, m_selstart(0)
, m_selend(0)
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
, inputMethodHints(Qt::ImhNone)
#endif
, hAlign(QQuickTextInput::AlignLeft)
@@ -148,7 +148,7 @@ public:
, m_separator(0)
, m_readOnly(0)
, m_textDirty(0)
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
, m_preeditDirty(0)
#endif
, m_selDirty(0)
@@ -176,7 +176,7 @@ public:
bool setHAlign(QQuickTextInput::HAlignment, bool forceAlign = false);
void mirrorChange() Q_DECL_OVERRIDE;
bool sendMouseEventToInputContext(QMouseEvent *event);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Qt::InputMethodHints effectiveInputMethodHints() const;
#endif
void handleFocusEvent(QFocusEvent *event);
@@ -211,7 +211,7 @@ public:
QPointF tripleClickStartPoint;
QPointer<QQmlComponent> cursorComponent;
-#ifndef QT_NO_VALIDATOR
+#if QT_CONFIG(validator)
QPointer<QValidator> m_validator;
#endif
@@ -240,7 +240,7 @@ public:
int lastSelectionStart;
int lastSelectionEnd;
int m_cursor;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
int m_preeditCursor;
#endif
bool m_blinkEnabled;
@@ -257,7 +257,7 @@ public:
UpdatePaintNode
};
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Qt::InputMethodHints inputMethodHints;
#endif
QQuickTextInput::HAlignment hAlign;
@@ -290,7 +290,7 @@ public:
bool m_separator : 1;
bool m_readOnly : 1;
bool m_textDirty : 1;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
bool m_preeditDirty : 1;
#endif
bool m_selDirty : 1;
@@ -362,12 +362,12 @@ public:
QString realText() const;
-#ifndef QT_NO_CLIPBOARD
+#if QT_CONFIG(clipboard)
void copy(QClipboard::Mode mode = QClipboard::Clipboard) const;
void paste(QClipboard::Mode mode = QClipboard::Clipboard);
#endif
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void commitPreedit();
void cancelPreedit();
#endif
@@ -419,7 +419,7 @@ public:
}
// input methods
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
bool composeMode() const { return !m_textLayout.preeditAreaText().isEmpty(); }
QString preeditAreaText() const { return m_textLayout.preeditAreaText(); }
@@ -441,7 +441,7 @@ public:
}
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
void processInputMethodEvent(QInputMethodEvent *event);
#endif
void processKeyEvent(QKeyEvent* ev);
@@ -496,7 +496,7 @@ private:
void deleteEndOfLine();
enum ValidatorState {
-#ifndef QT_NO_VALIDATOR
+#if QT_CONFIG(validator)
InvalidInput = QValidator::Invalid,
IntermediateInput = QValidator::Intermediate,
AcceptableInput = QValidator::Acceptable
diff --git a/src/quick/items/qquicktextnode.cpp b/src/quick/items/qquicktextnode.cpp
index e6ac9b603e..cf4e71adf5 100644
--- a/src/quick/items/qquicktextnode.cpp
+++ b/src/quick/items/qquicktextnode.cpp
@@ -237,7 +237,7 @@ void QQuickTextNode::addTextLayout(const QPointF &position, QTextLayout *textLay
engine.setAnchorColor(anchorColor);
engine.setPosition(position);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
int preeditLength = textLayout->preeditAreaText().length();
int preeditPosition = textLayout->preeditAreaPosition();
#endif
@@ -256,7 +256,7 @@ void QQuickTextNode::addTextLayout(const QPointF &position, QTextLayout *textLay
int length = line.textLength();
int end = start + length;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (preeditPosition >= 0
&& preeditPosition >= start
&& preeditPosition < end) {
diff --git a/src/quick/items/qquicktextnodeengine.cpp b/src/quick/items/qquicktextnodeengine.cpp
index 538356e679..c179ab7163 100644
--- a/src/quick/items/qquicktextnodeengine.cpp
+++ b/src/quick/items/qquicktextnodeengine.cpp
@@ -950,7 +950,7 @@ void QQuickTextNodeEngine::mergeFormats(QTextLayout *textLayout, QVarLengthArray
void QQuickTextNodeEngine::addTextBlock(QTextDocument *textDocument, const QTextBlock &block, const QPointF &position, const QColor &textColor, const QColor &anchorColor, int selectionStart, int selectionEnd)
{
Q_ASSERT(textDocument);
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
int preeditLength = block.isValid() ? block.layout()->preeditAreaText().length() : 0;
int preeditPosition = block.isValid() ? block.layout()->preeditAreaPosition() : -1;
#endif
@@ -1070,7 +1070,7 @@ void QQuickTextNodeEngine::addTextBlock(QTextDocument *textDocument, const QText
setTextColor(textColor);
int fragmentEnd = textPos + fragment.length();
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (preeditPosition >= 0
&& (preeditPosition + block.position()) >= textPos
&& (preeditPosition + block.position()) <= fragmentEnd) {
@@ -1092,7 +1092,7 @@ void QQuickTextNodeEngine::addTextBlock(QTextDocument *textDocument, const QText
++blockIterator;
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (preeditLength >= 0 && textPos <= block.position() + preeditPosition) {
setPosition(blockPosition);
textPos = block.position() + preeditPosition;
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 1297dded8c..ef079fdf92 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -74,7 +74,7 @@
#include <private/qqmlmemoryprofiler_p.h>
#include <private/qqmldebugserviceinterfaces_p.h>
#include <private/qqmldebugconnector_p.h>
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
# include <private/qopenglvertexarrayobject_p.h>
# include <private/qsgdefaultrendercontext_p.h>
#endif
@@ -95,7 +95,7 @@ bool QQuickWindowPrivate::defaultAlphaBuffer = false;
void QQuickWindowPrivate::updateFocusItemTransform()
{
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
Q_Q(QQuickWindow);
QQuickItem *focus = q->activeFocusItem();
if (focus && QGuiApplication::focusObject() == focus) {
@@ -172,7 +172,7 @@ private:
#include "qquickwindow.moc"
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
/*!
Returns an accessibility interface for this window, or 0 if such an
interface cannot be created.
@@ -256,7 +256,7 @@ void QQuickWindow::focusInEvent(QFocusEvent *ev)
d->updateFocusItemTransform();
}
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
static bool transformDirtyOnItemOrAncestor(const QQuickItem *item)
{
while (item) {
@@ -297,7 +297,7 @@ void QQuickWindowPrivate::polishItems()
if (recursionSafeguard == 0)
qWarning("QQuickWindow: possible QQuickItem::polish() loop");
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (QQuickItem *focusItem = q_func()->activeFocusItem()) {
// If the current focus item, or any of its anchestors, has changed location
// inside the window, we need inform IM about it. This to ensure that overlays
@@ -471,10 +471,10 @@ void QQuickWindowPrivate::renderSceneGraph(const QSize &size)
QQuickWindowPrivate::QQuickWindowPrivate()
: contentItem(0)
, activeFocusItem(0)
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
, cursorItem(0)
#endif
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
, dragGrabber(0)
#endif
, touchMouseId(-1)
@@ -500,7 +500,7 @@ QQuickWindowPrivate::QQuickWindowPrivate()
, vaoHelper(0)
, incubationController(0)
{
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
dragGrabber = new QQuickDragGrabber;
#endif
}
@@ -894,7 +894,7 @@ void QQuickWindowPrivate::setFocusInScope(QQuickItem *scope, QQuickItem *item, Q
}
if (oldActiveFocusItem) {
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
QGuiApplication::inputMethod()->commit();
#endif
@@ -1000,7 +1000,7 @@ void QQuickWindowPrivate::clearFocusInScope(QQuickItem *scope, QQuickItem *item,
oldActiveFocusItem = activeFocusItem;
newActiveFocusItem = scope;
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
QGuiApplication::inputMethod()->commit();
#endif
@@ -1276,7 +1276,7 @@ QQuickWindow::~QQuickWindow()
}
delete d->incubationController; d->incubationController = 0;
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
delete d->dragGrabber; d->dragGrabber = 0;
#endif
delete d->contentItem; d->contentItem = 0;
@@ -1545,7 +1545,7 @@ bool QQuickWindow::event(QEvent *e)
d->clearHover();
d->lastMousePosition = QPointF();
break;
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
case QEvent::DragEnter:
case QEvent::DragLeave:
case QEvent::DragMove:
@@ -1565,7 +1565,7 @@ bool QQuickWindow::event(QEvent *e)
e->setAccepted(qev.isAccepted());
} break;
case QEvent::FocusAboutToChange:
-#ifndef QT_NO_IM
+#if QT_CONFIG(im)
if (d->activeFocusItem)
qGuiApp->inputMethod()->commit();
#endif
@@ -1577,7 +1577,7 @@ bool QQuickWindow::event(QEvent *e)
d->windowManager->handleUpdateRequest(this);
break;
}
-#ifndef QT_NO_GESTURES
+#if QT_CONFIG(gestures)
case QEvent::NativeGesture:
d->deliverNativeGestureEvent(d->contentItem, static_cast<QNativeGestureEvent*>(e));
break;
@@ -1774,7 +1774,7 @@ bool QQuickWindowPrivate::deliverHoverEvent(QQuickItem *item, const QPointF &sce
return false;
}
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
bool QQuickWindowPrivate::deliverWheelEvent(QQuickItem *item, QWheelEvent *event)
{
QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);
@@ -1828,9 +1828,9 @@ void QQuickWindow::wheelEvent(QWheelEvent *event)
d->deliverWheelEvent(d->contentItem, event);
d->lastWheelEventAccepted = event->isAccepted();
}
-#endif // QT_NO_WHEELEVENT
+#endif // wheelevent
-#ifndef QT_NO_GESTURES
+#if QT_CONFIG(gestures)
bool QQuickWindowPrivate::deliverNativeGestureEvent(QQuickItem *item, QNativeGestureEvent *event)
{
QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item);
@@ -1862,7 +1862,7 @@ bool QQuickWindowPrivate::deliverNativeGestureEvent(QQuickItem *item, QNativeGes
return false;
}
-#endif // QT_NO_GESTURES
+#endif // gestures
bool QQuickWindowPrivate::deliverTouchCancelEvent(QTouchEvent *event)
{
@@ -2043,7 +2043,7 @@ void QQuickWindowPrivate::handleMouseEvent(QMouseEvent *event)
qCDebug(DBG_HOVER_TRACE) << this;
- #ifndef QT_NO_CURSOR
+ #if QT_CONFIG(cursor)
updateCursor(event->windowPos());
#endif
@@ -2358,7 +2358,7 @@ bool QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, QQuickPo
return eventAccepted;
}
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
void QQuickWindowPrivate::deliverDragEvent(QQuickDragGrabber *grabber, QEvent *event)
{
grabber->resetTarget();
@@ -2479,9 +2479,9 @@ bool QQuickWindowPrivate::deliverDragEvent(QQuickDragGrabber *grabber, QQuickIte
return accepted;
}
-#endif // QT_NO_DRAGANDDROP
+#endif // draganddrop
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
void QQuickWindowPrivate::updateCursor(const QPointF &scenePos)
{
Q_Q(QQuickWindow);
@@ -3184,7 +3184,7 @@ void QQuickWindow::maybeUpdate()
void QQuickWindow::cleanupSceneGraph()
{
Q_D(QQuickWindow);
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
delete d->vaoHelper;
d->vaoHelper = 0;
#endif
@@ -3223,7 +3223,7 @@ void QQuickWindow::setTransientParent_helper(QQuickWindow *window)
QOpenGLContext *QQuickWindow::openglContext() const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
Q_D(const QQuickWindow);
if (d->context && d->context->isValid()) {
QSGRendererInterface *rif = d->context->sceneGraphContext()->rendererInterface(d->context);
@@ -3351,7 +3351,7 @@ bool QQuickWindow::isSceneGraphInitialized() const
The corresponding handler is \c onClosing.
*/
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
/*!
Sets the render target for this window to be \a fbo.
@@ -3439,7 +3439,7 @@ QSize QQuickWindow::renderTargetSize() const
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
/*!
Returns the render target for this window.
@@ -3478,7 +3478,7 @@ QImage QQuickWindow::grabWindow()
return d->windowManager->grab(this);
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (!isVisible() && !d->renderControl) {
auto openglRenderContext = static_cast<QSGDefaultRenderContext *>(d->context);
if (!openglRenderContext->openglContext()) {
@@ -3836,7 +3836,7 @@ QSGTexture *QQuickWindow::createTextureFromImage(const QImage &image, CreateText
*/
QSGTexture *QQuickWindow::createTextureFromId(uint id, const QSize &size, CreateTextureOptions options) const
{
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
if (openglContext()) {
QSGPlainTexture *texture = new QSGPlainTexture();
texture->setTextureId(id);
@@ -3919,7 +3919,7 @@ void QQuickWindow::setDefaultAlphaBuffer(bool useAlpha)
{
QQuickWindowPrivate::defaultAlphaBuffer = useAlpha;
}
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
/*!
\since 5.2
diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h
index cfadadec2d..c1f690f325 100644
--- a/src/quick/items/qquickwindow.h
+++ b/src/quick/items/qquickwindow.h
@@ -114,19 +114,19 @@ public:
bool sendEvent(QQuickItem *, QEvent *);
QImage grabWindow();
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void setRenderTarget(QOpenGLFramebufferObject *fbo);
QOpenGLFramebufferObject *renderTarget() const;
#endif
void setRenderTarget(uint fboId, const QSize &size);
uint renderTargetId() const;
QSize renderTargetSize() const;
-#ifndef QT_NO_OPENGL
+#if QT_CONFIG(opengl)
void resetOpenGLState();
#endif
QQmlIncubationController *incubationController() const;
-#ifndef QT_NO_ACCESSIBILITY
+#if QT_CONFIG(accessibility)
QAccessibleInterface *accessibleRoot() const Q_DECL_OVERRIDE;
#endif
@@ -208,7 +208,7 @@ protected:
void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE;
void mouseDoubleClickEvent(QMouseEvent *) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE;
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE;
#endif
diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h
index 3328eb65c4..32a6939868 100644
--- a/src/quick/items/qquickwindow_p.h
+++ b/src/quick/items/qquickwindow_p.h
@@ -125,10 +125,10 @@ public:
void deliverKeyEvent(QKeyEvent *e);
// Keeps track of the item currently receiving mouse events
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
QQuickItem *cursorItem;
#endif
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
QQuickDragGrabber *dragGrabber;
#endif
int touchMouseId;
@@ -146,10 +146,10 @@ public:
static QMouseEvent *cloneMouseEvent(QMouseEvent *event, QPointF *transformedLocalPos = 0);
void deliverMouseEvent(QQuickPointerMouseEvent *pointerEvent);
bool sendFilteredMouseEvent(QQuickItem *, QQuickItem *, QEvent *, QSet<QQuickItem *> *);
-#ifndef QT_NO_WHEELEVENT
+#if QT_CONFIG(wheelevent)
bool deliverWheelEvent(QQuickItem *, QWheelEvent *);
#endif
-#ifndef QT_NO_GESTURES
+#if QT_CONFIG(gestures)
bool deliverNativeGestureEvent(QQuickItem *, QNativeGestureEvent *);
#endif
@@ -179,11 +179,11 @@ public:
Qt::KeyboardModifiers modifiers, ulong timestamp, bool accepted);
bool clearHover(ulong timestamp = 0);
-#ifndef QT_NO_DRAGANDDROP
+#if QT_CONFIG(draganddrop)
void deliverDragEvent(QQuickDragGrabber *, QEvent *);
bool deliverDragEvent(QQuickDragGrabber *, QQuickItem *, QDragMoveEvent *);
#endif
-#ifndef QT_NO_CURSOR
+#if QT_CONFIG(cursor)
void updateCursor(const QPointF &scenePos);
QQuickItem *findCursorItem(QQuickItem *item, const QPointF &scenePos);
#endif