diff options
author | Liang Qi <[email protected]> | 2016-12-14 19:01:23 +0100 |
---|---|---|
committer | Liang Qi <[email protected]> | 2016-12-14 19:01:23 +0100 |
commit | 0e80d28aa5892d6bbb4d0017b1bc9a33489f4176 (patch) | |
tree | 0db2e10c8776d172bccaeaa7ee1fab3934b93073 /src/quick/items | |
parent | ed32558d6280cae40578f735fd326327d571d993 (diff) | |
parent | 16c81bb0d493af00bc376784bcb7e03a4a037b04 (diff) |
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
src/plugins/qmltooling/qmldbg_debugger/qv4debugjob.cpp
src/plugins/qmltooling/qmldbg_inspector/globalinspector.cpp
src/plugins/qmltooling/qmldbg_nativedebugger/qqmlnativedebugservice.cpp
src/qml/qml/qqmlimport.cpp
src/quick/items/context2d/qquickcontext2dtexture_p.h
tools/qmleasing/splineeditor.h
Change-Id: I8f6630fcac243824350986c8e9f4bd6483bf20b5
Diffstat (limited to 'src/quick/items')
48 files changed, 419 insertions, 410 deletions
diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index dcad719ef0..78db92ba8a 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 678e33826d..97135816a2 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) override; -#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 02238a882b..d5255edcfc 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 7054d9d9c9..215a1e5db6 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 06239c7193..357f72b3e7 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 70d76c99a1..b314390915 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 ecd4da4367..0c4c072db7 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/qquickevents.cpp b/src/quick/items/qquickevents.cpp index 2fad9f5a8d..42588fd058 100644 --- a/src/quick/items/qquickevents.cpp +++ b/src/quick/items/qquickevents.cpp @@ -552,7 +552,7 @@ void QQuickEventTouchPoint::reset(const QTouchEvent::TouchPoint &tp, ulong times QQuickEventPoint::reset(tp.state(), tp.scenePos(), tp.id(), timestamp); m_rotation = tp.rotation(); m_pressure = tp.pressure(); - m_uniqueId = tp.uniqueId(); +// m_uniqueId = tp.uniqueId(); } /*! diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h index 61bbb4ecda..6179791413 100644 --- a/src/quick/items/qquickevents_p_p.h +++ b/src/quick/items/qquickevents_p_p.h @@ -302,7 +302,8 @@ class Q_QUICK_PRIVATE_EXPORT QQuickEventTouchPoint : public QQuickEventPoint Q_OBJECT Q_PROPERTY(qreal rotation READ rotation) Q_PROPERTY(qreal pressure READ pressure) - Q_PROPERTY(QPointerUniqueId uniqueId READ uniqueId) +// TODO rename to QPointingDeviceUniqueId +// Q_PROPERTY(QPointerUniqueId uniqueId READ uniqueId) public: QQuickEventTouchPoint(QQuickPointerTouchEvent *parent); @@ -311,12 +312,12 @@ public: qreal rotation() const { return m_rotation; } qreal pressure() const { return m_pressure; } - QPointerUniqueId uniqueId() const { return m_uniqueId; } +// QPointerUniqueId uniqueId() const { return m_uniqueId; } private: qreal m_rotation; qreal m_pressure; - QPointerUniqueId m_uniqueId; +// QPointerUniqueId m_uniqueId; Q_DISABLE_COPY(QQuickEventTouchPoint) }; @@ -554,7 +555,7 @@ QML_DECLARE_TYPE(QQuickMouseEvent) QML_DECLARE_TYPE(QQuickWheelEvent) QML_DECLARE_TYPE(QQuickCloseEvent) QML_DECLARE_TYPE(QQuickPointerDevice) -QML_DECLARE_TYPE(QPointerUniqueId) +//QML_DECLARE_TYPE(QPointerUniqueId) QML_DECLARE_TYPE(QQuickPointerEvent) #endif // QQUICKEVENTS_P_P_H diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index 26959ef584..00a1306627 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 2da4781f37..7384c7271a 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 274bfbf6d4..ca8ef7ba2e 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 7781c94f95..3002b73a8c 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 e565fceab8..3911bb0f28 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/qquickspriteengine.cpp b/src/quick/items/qquickspriteengine.cpp index 74b04a75ad..f54a8911b2 100644 --- a/src/quick/items/qquickspriteengine.cpp +++ b/src/quick/items/qquickspriteengine.cpp @@ -664,13 +664,14 @@ uint QQuickStochasticEngine::updateSprites(uint time)//### would returning a lis //Sprite State Update; m_timeOffset = time; m_addAdvance = false; - while (!m_stateUpdates.isEmpty() && time >= m_stateUpdates.constFirst().first){ - const auto copy = m_stateUpdates.constFirst().second; + int i = 0; + for (; i < m_stateUpdates.count() && time >= m_stateUpdates.at(i).first; ++i) { + const auto copy = m_stateUpdates.at(i).second; for (int idx : copy) advance(idx); - m_stateUpdates.pop_front(); } + m_stateUpdates.remove(0, i); m_advanceTime.start(); m_addAdvance = true; if (m_stateUpdates.isEmpty()) @@ -760,13 +761,13 @@ void QQuickStochasticEngine::addToUpdateList(uint t, int idx) m_stateUpdates[i].second << idx; return; } else if (m_stateUpdates.at(i).first > t) { - QList<int> tmpList; + QVector<int> tmpList; tmpList << idx; m_stateUpdates.insert(i, qMakePair(t, tmpList)); return; } } - QList<int> tmpList; + QVector<int> tmpList; tmpList << idx; m_stateUpdates << qMakePair(t, tmpList); } diff --git a/src/quick/items/qquickspriteengine_p.h b/src/quick/items/qquickspriteengine_p.h index 89de9ce4f2..90ee68b2f6 100644 --- a/src/quick/items/qquickspriteengine_p.h +++ b/src/quick/items/qquickspriteengine_p.h @@ -254,7 +254,7 @@ protected: QVector<int> m_goals; QVector<int> m_duration; QVector<int> m_startTimes; - QList<QPair<uint, QList<int> > > m_stateUpdates;//### This could be done faster - priority queue? + QVector<QPair<uint, QVector<int> > > m_stateUpdates;//### This could be done faster - priority queue? QTime m_advanceTime; uint m_timeOffset; 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 fe29249934..555fd233b3 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); @@ -611,7 +608,7 @@ void QQuickTextControl::clear() } QQuickTextControl::QQuickTextControl(QTextDocument *doc, QObject *parent) - : QObject(*new QQuickTextControlPrivate, parent) + : QInputControl(TextEdit, *new QQuickTextControlPrivate, parent) { Q_D(QQuickTextControl); Q_ASSERT(doc); @@ -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; } @@ -983,8 +980,7 @@ void QQuickTextControlPrivate::keyPressEvent(QKeyEvent *e) process: { - QString text = e->text(); - if (!text.isEmpty() && (text.at(0).isPrint() || text.at(0) == QLatin1Char('\t'))) { + if (q->isAcceptableInput(e)) { if (overwriteMode // no need to call deleteChar() if we have a selection, insertText // does it already @@ -993,7 +989,7 @@ process: cursor.deleteChar(); } - cursor.insertText(text); + cursor.insertText(e->text()); selectionChanged(); } else { e->ignore(); @@ -1019,7 +1015,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 +1079,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 +1153,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 +1179,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 +1190,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 +1217,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 +1266,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 +1287,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 +1300,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 +1324,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 +1477,7 @@ QVariant QQuickTextControl::inputMethodQuery(Qt::InputMethodQuery property, QVar return QVariant(); } } -#endif // QT_NO_IM +#endif // im void QQuickTextControlPrivate::focusEvent(QFocusEvent *e) { @@ -1611,7 +1607,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 +1657,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). const QString richtext = QLatin1String("<meta name=\"qrichtext\" content=\"1\" />") @@ -1680,7 +1676,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 +1747,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 +1785,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 +1809,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 +1836,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 +1853,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 +1871,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 e06e3b8b29..70104a97e0 100644 --- a/src/quick/items/qquicktextcontrol_p.h +++ b/src/quick/items/qquicktextcontrol_p.h @@ -59,6 +59,7 @@ #include <QtGui/qabstracttextdocumentlayout.h> #include <QtGui/qtextdocumentfragment.h> #include <QtGui/qclipboard.h> +#include <QtGui/private/qinputcontrol_p.h> #include <QtCore/qmimedata.h> QT_BEGIN_NAMESPACE @@ -71,7 +72,7 @@ class QAbstractScrollArea; class QEvent; class QTimerEvent; -class Q_AUTOTEST_EXPORT QQuickTextControl : public QObject +class Q_AUTOTEST_EXPORT QQuickTextControl : public QInputControl { Q_OBJECT Q_DECLARE_PRIVATE(QQuickTextControl) @@ -89,7 +90,7 @@ public: QString toPlainText() const; -#ifndef QT_NO_TEXTHTMLPARSER +#if QT_CONFIG(texthtmlparser) QString toHtml() const; #endif @@ -129,7 +130,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 +165,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 287e07e980..61d75fe99b 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 b53bf064b6..106acf57cf 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 fbfaa0e199..27f3dcecfa 100644 --- a/src/quick/items/qquicktextinput.cpp +++ b/src/quick/items/qquicktextinput.cpp @@ -57,12 +57,13 @@ #include <QtGui/qinputmethod.h> #include <QtCore/qmath.h> -#ifndef QT_NO_ACCESSIBILITY +#if QT_CONFIG(accessibility) #include "qaccessible.h" #include "qquickaccessibleattached_p.h" #endif #include <QtGui/private/qtextengine_p.h> +#include <QtGui/private/qinputcontrol_p.h> QT_BEGIN_NAMESPACE @@ -142,7 +143,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 +401,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 +576,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 +603,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 +616,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 +708,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 +831,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 +995,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 +1030,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 +1057,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 +1152,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 +1193,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 +1250,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 +1271,7 @@ void QQuickTextInput::setInputMethodHints(Qt::InputMethodHints hints) d->inputMethodHints = hints; updateInputMethod(Qt::ImHints); emit inputMethodHintsChanged(); -#endif // QT_NO_IM +#endif // im } /*! @@ -1319,7 +1320,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 +1390,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 +1471,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 +1494,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 +1550,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 +1577,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 +1597,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 +1624,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 +1724,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 +1741,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 +1755,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 +1767,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 +1787,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 +1828,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 +1878,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 +1901,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 +1958,7 @@ QVariant QQuickTextInput::inputMethodQuery(Qt::InputMethodQuery property, QVaria return QQuickItem::inputMethodQuery(property); } } -#endif // QT_NO_IM +#endif // im /*! \qmlmethod QtQuick::TextInput::deselect() @@ -1997,7 +1998,7 @@ bool QQuickTextInput::isRightToLeft(int start, int end) } } -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) /*! \qmlmethod QtQuick::TextInput::cut() @@ -2042,7 +2043,7 @@ void QQuickTextInput::paste() if (!d->m_readOnly) d->paste(); } -#endif // QT_NO_CLIPBOARD +#endif // clipboard /*! \qmlmethod QtQuick::TextInput::undo() @@ -2416,7 +2417,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 +2598,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 +2618,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 +2646,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 +2671,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; @@ -2695,6 +2696,8 @@ void QQuickTextInputPrivate::init() option.setUseDesignMetrics(renderType != QQuickTextInput::NativeRendering); m_textLayout.setTextOption(option); } + + m_inputControl = new QInputControl(QInputControl::LineEdit, q); } void QQuickTextInputPrivate::resetInputMethod() @@ -2723,7 +2726,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 +2786,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 +2880,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 +3057,7 @@ void QQuickTextInputPrivate::updateBaselineOffset() q->setBaselineOffset(fm.ascent() + yoff + q->topPadding()); } -#ifndef QT_NO_CLIPBOARD +#if QT_CONFIG(clipboard) /*! \internal @@ -3091,9 +3094,9 @@ void QQuickTextInputPrivate::paste(QClipboard::Mode clipboardMode) } } -#endif // !QT_NO_CLIPBOARD +#endif // clipboard -#ifndef QT_NO_IM +#if QT_CONFIG(im) /*! \internal */ @@ -3125,7 +3128,7 @@ void QQuickTextInputPrivate::cancelPreedit() QInputMethodEvent ev; QCoreApplication::sendEvent(q, &ev); } -#endif // QT_NO_IM +#endif // im /*! \internal @@ -3225,7 +3228,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 +3260,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 +3290,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 +3314,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 +3342,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 +3464,7 @@ void QQuickTextInputPrivate::processInputMethodEvent(QInputMethodEvent *event) | Qt::ImCurrentSelection); } } -#endif // QT_NO_IM +#endif // im /*! \internal @@ -3501,7 +3504,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 +3516,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 +3566,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 +3578,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 +3593,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 +3627,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); @@ -3970,7 +3973,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) { @@ -4280,7 +4283,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); @@ -4391,7 +4394,7 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event) if (false) { } -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) else if (event == QKeySequence::Undo) { q->undo(); } @@ -4401,7 +4404,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(); } @@ -4418,7 +4421,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); } @@ -4490,13 +4493,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) { @@ -4529,8 +4532,7 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event) } if (unknown && !m_readOnly) { - QString t = event->text(); - if (!t.isEmpty() && t.at(0).isPrint()) { + if (m_inputControl->isAcceptableInput(event)) { if (overwriteMode // no need to call del() if we have a selection, insert // does it already @@ -4539,7 +4541,7 @@ void QQuickTextInputPrivate::processKeyEvent(QKeyEvent* event) del(); } - insert(t); + insert(event->text()); event->accept(); return; } 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..0bf5779a53 100644 --- a/src/quick/items/qquicktextinput_p_p.h +++ b/src/quick/items/qquicktextinput_p_p.h @@ -70,6 +70,7 @@ QT_BEGIN_NAMESPACE class QQuickTextNode; +class QInputControl; class Q_QUICK_PRIVATE_EXPORT QQuickTextInputPrivate : public QQuickImplicitSizeItemPrivate { @@ -104,7 +105,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 +115,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 +149,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 +177,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 +212,7 @@ public: QPointF tripleClickStartPoint; QPointer<QQmlComponent> cursorComponent; -#ifndef QT_NO_VALIDATOR +#if QT_CONFIG(validator) QPointer<QValidator> m_validator; #endif @@ -228,6 +229,7 @@ public: QQuickItem *cursorItem; QQuickTextNode *textNode; MaskInputData *m_maskData; + QInputControl *m_inputControl; QList<int> m_transactions; QVector<Command> m_history; @@ -240,7 +242,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 +259,7 @@ public: UpdatePaintNode }; -#ifndef QT_NO_IM +#if QT_CONFIG(im) Qt::InputMethodHints inputMethodHints; #endif QQuickTextInput::HAlignment hAlign; @@ -290,7 +292,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 +364,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 +421,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 +443,7 @@ public: } } -#ifndef QT_NO_IM +#if QT_CONFIG(im) void processInputMethodEvent(QInputMethodEvent *event); #endif void processKeyEvent(QKeyEvent* ev); @@ -496,7 +498,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 6cfc1d0313..cf4e71adf5 100644 --- a/src/quick/items/qquicktextnode.cpp +++ b/src/quick/items/qquicktextnode.cpp @@ -99,10 +99,12 @@ QSGGlyphNode *QQuickTextNode::addGlyphs(const QPointF &position, const QGlyphRun bool preferNativeGlyphNode = m_useNativeRenderer; if (!preferNativeGlyphNode) { QRawFontPrivate *fontPriv = QRawFontPrivate::get(font); - if (fontPriv->fontEngine->hasUnreliableGlyphOutline()) + if (fontPriv->fontEngine->hasUnreliableGlyphOutline()) { preferNativeGlyphNode = true; - else - preferNativeGlyphNode = !QFontDatabase().isSmoothlyScalable(font.familyName(), font.styleName()); + } else { + QFontEngine *fe = QRawFontPrivate::get(font)->fontEngine; + preferNativeGlyphNode = !fe->isSmoothlyScalable; + } } QSGGlyphNode *node = sg->sceneGraphContext()->createGlyphNode(sg, preferNativeGlyphNode); @@ -235,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 @@ -254,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 b0871fc173..07d87989b5 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -62,7 +62,6 @@ #include <QtGui/qpainter.h> #include <QtGui/qevent.h> #include <QtGui/qmatrix4x4.h> -#include <QtGui/qstylehints.h> #include <QtCore/qvarlengtharray.h> #include <QtCore/qabstractanimation.h> #include <QtCore/QLibraryInfo> @@ -74,7 +73,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 +94,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 +171,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 +255,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 +296,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 @@ -473,10 +472,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) @@ -502,7 +501,7 @@ QQuickWindowPrivate::QQuickWindowPrivate() , vaoHelper(0) , incubationController(0) { -#ifndef QT_NO_DRAGANDDROP +#if QT_CONFIG(draganddrop) dragGrabber = new QQuickDragGrabber; #endif } @@ -896,7 +895,7 @@ void QQuickWindowPrivate::setFocusInScope(QQuickItem *scope, QQuickItem *item, Q } if (oldActiveFocusItem) { -#ifndef QT_NO_IM +#if QT_CONFIG(im) QGuiApplication::inputMethod()->commit(); #endif @@ -1002,7 +1001,7 @@ void QQuickWindowPrivate::clearFocusInScope(QQuickItem *scope, QQuickItem *item, oldActiveFocusItem = activeFocusItem; newActiveFocusItem = scope; -#ifndef QT_NO_IM +#if QT_CONFIG(im) QGuiApplication::inputMethod()->commit(); #endif @@ -1278,7 +1277,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; @@ -1547,7 +1546,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: @@ -1567,7 +1566,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 @@ -1579,7 +1578,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; @@ -1776,7 +1775,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); @@ -1830,9 +1829,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); @@ -1864,7 +1863,7 @@ bool QQuickWindowPrivate::deliverNativeGestureEvent(QQuickItem *item, QNativeGes return false; } -#endif // QT_NO_GESTURES +#endif // gestures bool QQuickWindowPrivate::deliverTouchCancelEvent(QTouchEvent *event) { @@ -2045,7 +2044,7 @@ void QQuickWindowPrivate::handleMouseEvent(QMouseEvent *event) qCDebug(DBG_HOVER_TRACE) << this; - #ifndef QT_NO_CURSOR + #if QT_CONFIG(cursor) updateCursor(event->windowPos()); #endif @@ -2360,7 +2359,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(); @@ -2481,9 +2480,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); @@ -2640,15 +2639,6 @@ bool QQuickWindowPrivate::dragOverThreshold(qreal d, Qt::Axis axis, QMouseEvent return overThreshold; } -bool QQuickWindowPrivate::dragOverThreshold(qreal d, Qt::Axis axis, const QTouchEvent::TouchPoint *tp, int startDragThreshold) -{ - QStyleHints *styleHints = qApp->styleHints(); - bool overThreshold = qAbs(d) > (startDragThreshold >= 0 ? startDragThreshold : styleHints->startDragDistance()); - qreal velocity = axis == Qt::XAxis ? tp->velocity().x() : tp->velocity().y(); - overThreshold |= qAbs(velocity) > styleHints->startDragVelocity(); - return overThreshold; -} - /*! \qmlproperty list<Object> Window::data \default @@ -3186,7 +3176,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 @@ -3225,7 +3215,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); @@ -3353,7 +3343,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. @@ -3441,7 +3431,7 @@ QSize QQuickWindow::renderTargetSize() const -#ifndef QT_NO_OPENGL +#if QT_CONFIG(opengl) /*! Returns the render target for this window. @@ -3480,7 +3470,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()) { @@ -3838,7 +3828,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); @@ -3921,7 +3911,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 7e1e45f345..27a73988ae 100644 --- a/src/quick/items/qquickwindow.h +++ b/src/quick/items/qquickwindow.h @@ -115,19 +115,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 @@ -209,7 +209,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 3e146d5440..be915903c6 100644 --- a/src/quick/items/qquickwindow_p.h +++ b/src/quick/items/qquickwindow_p.h @@ -66,6 +66,8 @@ #include <qopenglcontext.h> #include <QtGui/qopenglframebufferobject.h> #include <QtGui/qevent.h> +#include <QtGui/qstylehints.h> +#include <QtGui/qguiapplication.h> QT_BEGIN_NAMESPACE @@ -125,10 +127,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 +148,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 +181,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 @@ -270,7 +272,19 @@ public: static bool defaultAlphaBuffer; static bool dragOverThreshold(qreal d, Qt::Axis axis, QMouseEvent *event, int startDragThreshold = -1); - static bool dragOverThreshold(qreal d, Qt::Axis axis, const QTouchEvent::TouchPoint *tp, int startDragThreshold = -1); + + template <typename TEventPoint> + static bool dragOverThreshold(qreal d, Qt::Axis axis, const TEventPoint *p, int startDragThreshold = -1) + { + QStyleHints *styleHints = qApp->styleHints(); + bool overThreshold = qAbs(d) > (startDragThreshold >= 0 ? startDragThreshold : styleHints->startDragDistance()); + const bool dragVelocityLimitAvailable = (styleHints->startDragVelocity() > 0); + if (!overThreshold && dragVelocityLimitAvailable) { + qreal velocity = axis == Qt::XAxis ? p->velocity().x() : p->velocity().y(); + overThreshold |= qAbs(velocity) > styleHints->startDragVelocity(); + } + return overThreshold; + } // data property static void data_append(QQmlListProperty<QObject> *, QObject *); |