diff options
Diffstat (limited to 'src/quick/items')
71 files changed, 398 insertions, 364 deletions
diff --git a/src/quick/items/context2d/qquickcanvasitem.cpp b/src/quick/items/context2d/qquickcanvasitem.cpp index ff90a74c43..7349f45444 100644 --- a/src/quick/items/context2d/qquickcanvasitem.cpp +++ b/src/quick/items/context2d/qquickcanvasitem.cpp @@ -66,7 +66,7 @@ class QQuickCanvasTextureProvider : public QSGTextureProvider { public: QSGTexture *tex; - QSGTexture *texture() const Q_DECL_OVERRIDE { return tex; } + QSGTexture *texture() const override { return tex; } void fireTextureChanged() { emit textureChanged(); } }; diff --git a/src/quick/items/context2d/qquickcanvasitem_p.h b/src/quick/items/context2d/qquickcanvasitem_p.h index 217ae9bb69..59de847680 100644 --- a/src/quick/items/context2d/qquickcanvasitem_p.h +++ b/src/quick/items/context2d/qquickcanvasitem_p.h @@ -155,8 +155,8 @@ public: Q_INVOKABLE QString toDataURL(const QString& type = QLatin1String("image/png")) const; QQmlRefPointer<QQuickCanvasPixmap> loadedPixmap(const QUrl& url); - bool isTextureProvider() const Q_DECL_OVERRIDE; - QSGTextureProvider *textureProvider() const Q_DECL_OVERRIDE; + bool isTextureProvider() const override; + QSGTextureProvider *textureProvider() const override; Q_SIGNALS: void paint(const QRect ®ion); @@ -185,13 +185,13 @@ private Q_SLOTS: void schedulePolish(); protected: - void componentComplete() Q_DECL_OVERRIDE; - void itemChange(QQuickItem::ItemChange, const QQuickItem::ItemChangeData &) Q_DECL_OVERRIDE; - void updatePolish() Q_DECL_OVERRIDE; - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; - void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE; - void releaseResources() Q_DECL_OVERRIDE; - bool event(QEvent *event) Q_DECL_OVERRIDE; + void componentComplete() override; + void itemChange(QQuickItem::ItemChange, const QQuickItem::ItemChangeData &) override; + void updatePolish() override; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; + void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; + void releaseResources() override; + bool event(QEvent *event) override; private: Q_DECLARE_PRIVATE(QQuickCanvasItem) Q_INVOKABLE void delayedCreate(); diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp index a4e701f59c..3a5d8f7a13 100644 --- a/src/quick/items/context2d/qquickcontext2d.cpp +++ b/src/quick/items/context2d/qquickcontext2d.cpp @@ -4040,7 +4040,7 @@ class QQuickContext2DTextureCleanup : public QRunnable { public: QQuickContext2DTexture *texture; - void run() Q_DECL_OVERRIDE { delete texture; } + void run() override { delete texture; } }; QMutex QQuickContext2D::mutex; diff --git a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp index b985cb0ccc..30895d9b0e 100644 --- a/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp +++ b/src/quick/items/context2d/qquickcontext2dcommandbuffer.cpp @@ -100,8 +100,8 @@ namespace { { } - void paint(QPainter *p) const Q_DECL_OVERRIDE { p->fillRect(m_rect, m_brush); } - QRectF boundingRect() const Q_DECL_OVERRIDE { return m_rect; } + void paint(QPainter *p) const override { p->fillRect(m_rect, m_brush); } + QRectF boundingRect() const override { return m_rect; } private: QRectF m_rect; @@ -117,8 +117,8 @@ namespace { { } - void paint(QPainter *p) const Q_DECL_OVERRIDE { p->fillPath(m_path, m_brush); } - QRectF boundingRect() const Q_DECL_OVERRIDE { return m_path.boundingRect(); } + void paint(QPainter *p) const override { p->fillPath(m_path, m_brush); } + QRectF boundingRect() const override { return m_path.boundingRect(); } private: QPainterPath m_path; @@ -134,9 +134,9 @@ namespace { { } - void paint(QPainter *p) const Q_DECL_OVERRIDE { p->strokePath(m_path, m_pen); } + void paint(QPainter *p) const override { p->strokePath(m_path, m_pen); } - QRectF boundingRect() const Q_DECL_OVERRIDE + QRectF boundingRect() const override { qreal d = qMax(qreal(1), m_pen.widthF()); return m_path.boundingRect().adjusted(-d, -d, d, d); @@ -156,9 +156,9 @@ namespace { { } - void paint(QPainter *p) const Q_DECL_OVERRIDE { p->drawImage(m_offset, m_image); } + void paint(QPainter *p) const override { p->drawImage(m_offset, m_image); } - QRectF boundingRect() const Q_DECL_OVERRIDE { return QRectF(m_image.rect()).translated(m_offset); } + QRectF boundingRect() const override { return QRectF(m_image.rect()).translated(m_offset); } private: QImage m_image; diff --git a/src/quick/items/context2d/qquickcontext2dtexture.cpp b/src/quick/items/context2d/qquickcontext2dtexture.cpp index df6dd9dba2..a8bf14ba9f 100644 --- a/src/quick/items/context2d/qquickcontext2dtexture.cpp +++ b/src/quick/items/context2d/qquickcontext2dtexture.cpp @@ -54,6 +54,9 @@ #include <QtGui/QGuiApplication> QT_BEGIN_NAMESPACE + +Q_LOGGING_CATEGORY(lcCanvas, "qt.quick.canvas") + #if QT_CONFIG(opengl) #define QT_MINIMUM_FBO_SIZE 64 @@ -96,6 +99,7 @@ QQuickContext2DTexture::QQuickContext2DTexture() #endif , m_surface(0) , m_item(0) + , m_canvasDevicePixelRatio(1) , m_canvasWindowChanged(false) , m_dirtyTexture(false) , m_smooth(true) @@ -161,12 +165,22 @@ void QQuickContext2DTexture::setItem(QQuickCanvasItem* item) bool QQuickContext2DTexture::setCanvasWindow(const QRect& r) { + qreal canvasDevicePixelRatio = (m_item && m_item->window()) ? + m_item->window()->effectiveDevicePixelRatio() : qApp->devicePixelRatio(); + if (!qFuzzyCompare(m_canvasDevicePixelRatio, canvasDevicePixelRatio)) { + qCDebug(lcCanvas, "%s device pixel ratio %.1lf -> %.1lf", + (m_item->objectName().isEmpty() ? "Canvas" : qPrintable(m_item->objectName())), + m_canvasDevicePixelRatio, canvasDevicePixelRatio); + m_canvasDevicePixelRatio = canvasDevicePixelRatio; + m_canvasWindowChanged = true; + } + if (m_canvasWindow != r) { m_canvasWindow = r; m_canvasWindowChanged = true; - return true; } - return false; + + return m_canvasWindowChanged; } bool QQuickContext2DTexture::setDirtyRect(const QRect &r) @@ -549,9 +563,6 @@ QPaintDevice* QQuickContext2DFBOTexture::beginPainting() { QQuickContext2DTexture::beginPainting(); - const qreal devicePixelRatio = (m_item && m_item->window()) ? - m_item->window()->effectiveDevicePixelRatio() : qApp->devicePixelRatio(); - if (m_canvasWindow.size().isEmpty()) { delete m_fbo; delete m_multisampledFbo; @@ -566,7 +577,7 @@ QPaintDevice* QQuickContext2DFBOTexture::beginPainting() delete m_paint_device; m_paint_device = 0; - m_fboSize = npotAdjustedSize(m_canvasWindow.size() * devicePixelRatio); + m_fboSize = npotAdjustedSize(m_canvasWindow.size() * m_canvasDevicePixelRatio); m_canvasWindowChanged = false; if (doMultisampling()) { @@ -604,7 +615,10 @@ QPaintDevice* QQuickContext2DFBOTexture::beginPainting() QOpenGLPaintDevice *gl_device = new QOpenGLPaintDevice(m_fbo->size()); gl_device->setPaintFlipped(true); gl_device->setSize(m_fbo->size()); - gl_device->setDevicePixelRatio(devicePixelRatio); + gl_device->setDevicePixelRatio(m_canvasDevicePixelRatio); + qCDebug(lcCanvas, "%s size %.1lf x %.1lf painting with size %d x %d DPR %.1lf", + (m_item->objectName().isEmpty() ? "Canvas" : qPrintable(m_item->objectName())), + m_item->width(), m_item->height(), m_fbo->size().width(), m_fbo->size().height(), m_canvasDevicePixelRatio); m_paint_device = gl_device; } @@ -710,14 +724,15 @@ QPaintDevice* QQuickContext2DImageTexture::beginPainting() if (m_canvasWindow.size().isEmpty()) return 0; - const qreal devicePixelRatio = (m_item && m_item->window()) ? - m_item->window()->effectiveDevicePixelRatio() : qApp->devicePixelRatio(); if (m_canvasWindowChanged) { - m_image = QImage(m_canvasWindow.size() * devicePixelRatio, QImage::Format_ARGB32_Premultiplied); - m_image.setDevicePixelRatio(devicePixelRatio); + m_image = QImage(m_canvasWindow.size() * m_canvasDevicePixelRatio, QImage::Format_ARGB32_Premultiplied); + m_image.setDevicePixelRatio(m_canvasDevicePixelRatio); m_image.fill(0x00000000); m_canvasWindowChanged = false; + qCDebug(lcCanvas, "%s size %.1lf x %.1lf painting with size %d x %d DPR %.1lf", + (m_item->objectName().isEmpty() ? "Canvas" : qPrintable(m_item->objectName())), + m_item->width(), m_item->height(), m_image.size().width(), m_image.size().height(), m_canvasDevicePixelRatio); } return &m_image; diff --git a/src/quick/items/context2d/qquickcontext2dtexture_p.h b/src/quick/items/context2d/qquickcontext2dtexture_p.h index 97135816a2..0e1fbd5d34 100644 --- a/src/quick/items/context2d/qquickcontext2dtexture_p.h +++ b/src/quick/items/context2d/qquickcontext2dtexture_p.h @@ -168,6 +168,7 @@ protected: QSize m_canvasSize; QSize m_tileSize; QRect m_canvasWindow; + qreal m_canvasDevicePixelRatio; QMutex m_mutex; QWaitCondition m_condition; @@ -188,21 +189,21 @@ class QQuickContext2DFBOTexture : public QQuickContext2DTexture public: QQuickContext2DFBOTexture(); ~QQuickContext2DFBOTexture(); - QQuickContext2DTile* createTile() const Q_DECL_OVERRIDE; - QPaintDevice* beginPainting() Q_DECL_OVERRIDE; - void endPainting() Q_DECL_OVERRIDE; + QQuickContext2DTile* createTile() const override; + QPaintDevice* beginPainting() override; + void endPainting() override; QRectF normalizedTextureSubRect() const; - QQuickCanvasItem::RenderTarget renderTarget() const Q_DECL_OVERRIDE; - void compositeTile(QQuickContext2DTile* tile) Q_DECL_OVERRIDE; - QSize adjustedTileSize(const QSize &ts) Q_DECL_OVERRIDE; + QQuickCanvasItem::RenderTarget renderTarget() const override; + void compositeTile(QQuickContext2DTile* tile) override; + QSize adjustedTileSize(const QSize &ts) override; - QSGTexture *textureForNextFrame(QSGTexture *, QQuickWindow *window) Q_DECL_OVERRIDE; + QSGTexture *textureForNextFrame(QSGTexture *, QQuickWindow *window) override; protected: - QVector2D scaleFactor() const Q_DECL_OVERRIDE; + QVector2D scaleFactor() const override; public Q_SLOTS: - void grabImage(const QRectF& region = QRectF()) Q_DECL_OVERRIDE; + void grabImage(const QRectF& region = QRectF()) override; private: bool doMultisampling() const; diff --git a/src/quick/items/context2d/qquickcontext2dtile_p.h b/src/quick/items/context2d/qquickcontext2dtile_p.h index d5255edcfc..c3d4dfef64 100644 --- a/src/quick/items/context2d/qquickcontext2dtile_p.h +++ b/src/quick/items/context2d/qquickcontext2dtile_p.h @@ -93,7 +93,7 @@ class QQuickContext2DFBOTile : public QQuickContext2DTile public: QQuickContext2DFBOTile(); ~QQuickContext2DFBOTile(); - virtual void setRect(const QRect& r) override; + void setRect(const QRect& r) override; QOpenGLFramebufferObject* fbo() const {return m_fbo;} void drawFinished() override; diff --git a/src/quick/items/qquickanchors.cpp b/src/quick/items/qquickanchors.cpp index c0bec7d716..45b405bd82 100644 --- a/src/quick/items/qquickanchors.cpp +++ b/src/quick/items/qquickanchors.cpp @@ -832,7 +832,7 @@ void QQuickAnchors::resetTop() Q_D(QQuickAnchors); d->usedAnchors &= ~TopAnchor; d->remDepend(d->topAnchorItem); - d->topAnchorItem = Q_NULLPTR; + d->topAnchorItem = nullptr; d->topAnchorLine = QQuickAnchors::InvalidAnchor; emit topChanged(); d->updateVerticalAnchors(); @@ -872,7 +872,7 @@ void QQuickAnchors::resetBottom() Q_D(QQuickAnchors); d->usedAnchors &= ~BottomAnchor; d->remDepend(d->bottomAnchorItem); - d->bottomAnchorItem = Q_NULLPTR; + d->bottomAnchorItem = nullptr; d->bottomAnchorLine = QQuickAnchors::InvalidAnchor; emit bottomChanged(); d->updateVerticalAnchors(); @@ -912,7 +912,7 @@ void QQuickAnchors::resetVerticalCenter() Q_D(QQuickAnchors); d->usedAnchors &= ~VCenterAnchor; d->remDepend(d->vCenterAnchorItem); - d->vCenterAnchorItem = Q_NULLPTR; + d->vCenterAnchorItem = nullptr; d->vCenterAnchorLine = QQuickAnchors::InvalidAnchor; emit verticalCenterChanged(); d->updateVerticalAnchors(); @@ -952,7 +952,7 @@ void QQuickAnchors::resetBaseline() Q_D(QQuickAnchors); d->usedAnchors &= ~BaselineAnchor; d->remDepend(d->baselineAnchorItem); - d->baselineAnchorItem = Q_NULLPTR; + d->baselineAnchorItem = nullptr; d->baselineAnchorLine = QQuickAnchors::InvalidAnchor; emit baselineChanged(); d->updateVerticalAnchors(); @@ -992,7 +992,7 @@ void QQuickAnchors::resetLeft() Q_D(QQuickAnchors); d->usedAnchors &= ~LeftAnchor; d->remDepend(d->leftAnchorItem); - d->leftAnchorItem = Q_NULLPTR; + d->leftAnchorItem = nullptr; d->leftAnchorLine = QQuickAnchors::InvalidAnchor; emit leftChanged(); d->updateHorizontalAnchors(); @@ -1032,7 +1032,7 @@ void QQuickAnchors::resetRight() Q_D(QQuickAnchors); d->usedAnchors &= ~RightAnchor; d->remDepend(d->rightAnchorItem); - d->rightAnchorItem = Q_NULLPTR; + d->rightAnchorItem = nullptr; d->rightAnchorLine = QQuickAnchors::InvalidAnchor; emit rightChanged(); d->updateHorizontalAnchors(); @@ -1072,7 +1072,7 @@ void QQuickAnchors::resetHorizontalCenter() Q_D(QQuickAnchors); d->usedAnchors &= ~HCenterAnchor; d->remDepend(d->hCenterAnchorItem); - d->hCenterAnchorItem = Q_NULLPTR; + d->hCenterAnchorItem = nullptr; d->hCenterAnchorLine = QQuickAnchors::InvalidAnchor; emit horizontalCenterChanged(); d->updateHorizontalAnchors(); diff --git a/src/quick/items/qquickanchors_p_p.h b/src/quick/items/qquickanchors_p_p.h index 906f607302..ae6ca02786 100644 --- a/src/quick/items/qquickanchors_p_p.h +++ b/src/quick/items/qquickanchors_p_p.h @@ -90,15 +90,15 @@ public: , hCenterOffset(0) , baselineOffset(0) , item(i) - , fill(Q_NULLPTR) - , centerIn(Q_NULLPTR) - , leftAnchorItem(Q_NULLPTR) - , rightAnchorItem(Q_NULLPTR) - , topAnchorItem(Q_NULLPTR) - , bottomAnchorItem(Q_NULLPTR) - , vCenterAnchorItem(Q_NULLPTR) - , hCenterAnchorItem(Q_NULLPTR) - , baselineAnchorItem(Q_NULLPTR) + , fill(nullptr) + , centerIn(nullptr) + , leftAnchorItem(nullptr) + , rightAnchorItem(nullptr) + , topAnchorItem(nullptr) + , bottomAnchorItem(nullptr) + , vCenterAnchorItem(nullptr) + , hCenterAnchorItem(nullptr) + , baselineAnchorItem(nullptr) , leftAnchorLine(QQuickAnchors::InvalidAnchor) , leftMarginExplicit(false) , rightAnchorLine(QQuickAnchors::InvalidAnchor) @@ -141,8 +141,8 @@ public: void updateMe(); // QQuickItemGeometryListener interface - void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) Q_DECL_OVERRIDE; - QQuickAnchorsPrivate *anchorPrivate() Q_DECL_OVERRIDE { return this; } + void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) override; + QQuickAnchorsPrivate *anchorPrivate() override { return this; } bool checkHValid() const; bool checkVValid() const; diff --git a/src/quick/items/qquickanimatedimage.cpp b/src/quick/items/qquickanimatedimage.cpp index a30d71dd1e..5bc5b0faff 100644 --- a/src/quick/items/qquickanimatedimage.cpp +++ b/src/quick/items/qquickanimatedimage.cpp @@ -279,8 +279,7 @@ void QQuickAnimatedImage::setSource(const QUrl &url) d->oldPlaying = isPlaying(); if (d->_movie) { - delete d->_movie; - d->_movie = 0; + d->setMovie(nullptr); } d->url = url; @@ -320,7 +319,7 @@ void QQuickAnimatedImage::load() QString lf = QQmlFile::urlToLocalFileOrQrc(loadUrl); if (!lf.isEmpty()) { - d->_movie = new QMovie(lf); + d->setMovie(new QMovie(lf)); movieRequestFinished(); } else { #if QT_CONFIG(qml_network) @@ -366,14 +365,13 @@ void QQuickAnimatedImage::movieRequestFinished() } d->redirectCount=0; - d->_movie = new QMovie(d->reply); + d->setMovie(new QMovie(d->reply)); } #endif if (!d->_movie || !d->_movie->isValid()) { qmlWarning(this) << "Error Reading Animated Image File " << d->url.toString(); - delete d->_movie; - d->_movie = 0; + d->setMovie(nullptr); d->setImage(QImage()); if (d->progress != 0) { d->progress = 0; @@ -490,6 +488,18 @@ void QQuickAnimatedImage::componentComplete() load(); } +void QQuickAnimatedImagePrivate::setMovie(QMovie *movie) +{ + Q_Q(QQuickAnimatedImage); + const int oldFrameCount = q->frameCount(); + + delete _movie; + _movie = movie; + + if (oldFrameCount != q->frameCount()) + emit q->frameCountChanged(); +} + QT_END_NAMESPACE #include "moc_qquickanimatedimage_p.cpp" diff --git a/src/quick/items/qquickanimatedimage_p.h b/src/quick/items/qquickanimatedimage_p.h index 54da093259..f7a6bd808b 100644 --- a/src/quick/items/qquickanimatedimage_p.h +++ b/src/quick/items/qquickanimatedimage_p.h @@ -69,7 +69,7 @@ class Q_AUTOTEST_EXPORT QQuickAnimatedImage : public QQuickImage Q_PROPERTY(bool playing READ isPlaying WRITE setPlaying NOTIFY playingChanged) Q_PROPERTY(bool paused READ isPaused WRITE setPaused NOTIFY pausedChanged) Q_PROPERTY(int currentFrame READ currentFrame WRITE setCurrentFrame NOTIFY frameChanged) - Q_PROPERTY(int frameCount READ frameCount) + Q_PROPERTY(int frameCount READ frameCount NOTIFY frameCountChanged) // read-only for AnimatedImage Q_PROPERTY(QSize sourceSize READ sourceSize NOTIFY sourceSizeChanged) @@ -90,13 +90,14 @@ public: int frameCount() const; // Extends QQuickImage's src property - void setSource(const QUrl&) Q_DECL_OVERRIDE; + void setSource(const QUrl&) override; virtual QSize sourceSize(); Q_SIGNALS: void playingChanged(); void pausedChanged(); void frameChanged(); + void frameCountChanged(); private Q_SLOTS: void movieUpdate(); @@ -105,8 +106,8 @@ private Q_SLOTS: void onCacheChanged(); protected: - void load() Q_DECL_OVERRIDE; - void componentComplete() Q_DECL_OVERRIDE; + void load() override; + void componentComplete() override; private: Q_DISABLE_COPY(QQuickAnimatedImage) diff --git a/src/quick/items/qquickanimatedimage_p_p.h b/src/quick/items/qquickanimatedimage_p_p.h index 9eff6a44e3..68c4f2d359 100644 --- a/src/quick/items/qquickanimatedimage_p_p.h +++ b/src/quick/items/qquickanimatedimage_p_p.h @@ -91,6 +91,7 @@ public: #endif QMap<int, QQuickPixmap *> frameMap; QSize currentSourceSize; + void setMovie(QMovie *movie); }; QT_END_NAMESPACE diff --git a/src/quick/items/qquickanimatedsprite_p.h b/src/quick/items/qquickanimatedsprite_p.h index 850461a011..276e6fbb92 100644 --- a/src/quick/items/qquickanimatedsprite_p.h +++ b/src/quick/items/qquickanimatedsprite_p.h @@ -169,8 +169,8 @@ protected Q_SLOTS: void reset(); protected: - void componentComplete() Q_DECL_OVERRIDE; - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + void componentComplete() override; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; private: void maybeUpdate(); bool isCurrentFrameChangedConnected(); diff --git a/src/quick/items/qquickborderimage_p.h b/src/quick/items/qquickborderimage_p.h index 844f71e2c9..f43e6c8e1e 100644 --- a/src/quick/items/qquickborderimage_p.h +++ b/src/quick/items/qquickborderimage_p.h @@ -83,7 +83,7 @@ public: TileMode verticalTileMode() const; void setVerticalTileMode(TileMode); - void setSource(const QUrl &url) Q_DECL_OVERRIDE; + void setSource(const QUrl &url) override; Q_SIGNALS: void horizontalTileModeChanged(); @@ -91,16 +91,16 @@ Q_SIGNALS: void sourceSizeChanged(); protected: - void load() Q_DECL_OVERRIDE; - void pixmapChange() Q_DECL_OVERRIDE; - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + void load() override; + void pixmapChange() override; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; private: void setGridScaledImage(const QQuickGridScaledImage& sci); private Q_SLOTS: void doUpdate(); - void requestFinished() Q_DECL_OVERRIDE; + void requestFinished() override; #if QT_CONFIG(qml_network) void sciRequestFinished(); #endif diff --git a/src/quick/items/qquickdrag.cpp b/src/quick/items/qquickdrag.cpp index 41847e5f01..6dc005a03c 100644 --- a/src/quick/items/qquickdrag.cpp +++ b/src/quick/items/qquickdrag.cpp @@ -82,8 +82,8 @@ public: { } - void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) Q_DECL_OVERRIDE; - void itemParentChanged(QQuickItem *, QQuickItem *parent) Q_DECL_OVERRIDE; + void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) override; + void itemParentChanged(QQuickItem *, QQuickItem *parent) override; void updatePosition(); void restartDrag(); void deliverEnterEvent(); @@ -772,6 +772,7 @@ Qt::DropAction QQuickDragAttachedPrivate::startDrag(Qt::DropActions supportedAct drag->setPixmap(QPixmap::fromImage(pixmapLoader.image())); } + drag->setHotSpot(hotSpot.toPoint()); emit q->dragStarted(); Qt::DropAction dropAction = drag->exec(supportedActions); diff --git a/src/quick/items/qquickdroparea_p.h b/src/quick/items/qquickdroparea_p.h index 0c4c072db7..d25cd4decc 100644 --- a/src/quick/items/qquickdroparea_p.h +++ b/src/quick/items/qquickdroparea_p.h @@ -175,10 +175,10 @@ Q_SIGNALS: void dropped(QQuickDropEvent *drop); protected: - void dragMoveEvent(QDragMoveEvent *event) Q_DECL_OVERRIDE; - void dragEnterEvent(QDragEnterEvent *event) Q_DECL_OVERRIDE; - void dragLeaveEvent(QDragLeaveEvent *event) Q_DECL_OVERRIDE; - void dropEvent(QDropEvent *event) Q_DECL_OVERRIDE; + void dragMoveEvent(QDragMoveEvent *event) override; + void dragEnterEvent(QDragEnterEvent *event) override; + void dragLeaveEvent(QDragLeaveEvent *event) override; + void dropEvent(QDropEvent *event) override; private: Q_DISABLE_COPY(QQuickDropArea) diff --git a/src/quick/items/qquickflickable.cpp b/src/quick/items/qquickflickable.cpp index ce584cd283..cd918cef5f 100644 --- a/src/quick/items/qquickflickable.cpp +++ b/src/quick/items/qquickflickable.cpp @@ -56,6 +56,7 @@ #include <QtCore/qmath.h> #include "qplatformdefs.h" +#include <math.h> #include <cmath> QT_BEGIN_NAMESPACE @@ -212,7 +213,7 @@ public: } protected: - void finished() Q_DECL_OVERRIDE { + void finished() override { if (!flickable) return; axisData->move.setValue(axisData->transitionTo); @@ -1771,6 +1772,7 @@ void QQuickFlickable::flick(qreal xVelocity, qreal yVelocity) d->vData.reset(); d->hData.velocity = xVelocity; d->vData.velocity = yVelocity; + d->hData.vTime = d->vData.vTime = d->timeline.time(); bool flickedX = d->flickX(xVelocity); bool flickedY = d->flickY(yVelocity); diff --git a/src/quick/items/qquickflickable_p.h b/src/quick/items/qquickflickable_p.h index 7558ee7df8..4ad01323a4 100644 --- a/src/quick/items/qquickflickable_p.h +++ b/src/quick/items/qquickflickable_p.h @@ -263,14 +263,14 @@ Q_SIGNALS: Q_REVISION(9) void verticalOvershootChanged(); protected: - bool childMouseEventFilter(QQuickItem *, QEvent *) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + bool childMouseEventFilter(QQuickItem *, QEvent *) override; + void mousePressEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; #if QT_CONFIG(wheelevent) - void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE; + void wheelEvent(QWheelEvent *event) override; #endif - void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *event) override; QQuickFlickableVisibleArea *visibleArea(); @@ -288,11 +288,11 @@ protected: virtual qreal maxYExtent() const; qreal vWidth() const; qreal vHeight() const; - void componentComplete() Q_DECL_OVERRIDE; + void componentComplete() override; virtual void viewportMoved(Qt::Orientations orient); void geometryChanged(const QRectF &newGeometry, - const QRectF &oldGeometry) Q_DECL_OVERRIDE; - void mouseUngrabEvent() Q_DECL_OVERRIDE; + const QRectF &oldGeometry) override; + void mouseUngrabEvent() override; bool filterMouseEvent(QQuickItem *receiver, QMouseEvent *event); bool xflick() const; diff --git a/src/quick/items/qquickflickable_p_p.h b/src/quick/items/qquickflickable_p_p.h index 8609a15fcd..54cc67875a 100644 --- a/src/quick/items/qquickflickable_p_p.h +++ b/src/quick/items/qquickflickable_p_p.h @@ -87,7 +87,7 @@ public: { Velocity(QQuickFlickablePrivate *p) : parent(p) {} - void setValue(qreal v) Q_DECL_OVERRIDE { + void setValue(qreal v) override { if (v != value()) { QQuickTimeLineValue::setValue(v); parent->updateVelocity(); @@ -195,7 +195,7 @@ public: qreal overShootDistance(qreal size) const; - void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) Q_DECL_OVERRIDE; + void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) override; void draggingStarting(); void draggingEnding(); diff --git a/src/quick/items/qquickflipable.cpp b/src/quick/items/qquickflipable.cpp index a960cd8b80..4273ed4881 100644 --- a/src/quick/items/qquickflipable.cpp +++ b/src/quick/items/qquickflipable.cpp @@ -57,7 +57,7 @@ public: transform = t; update(); } - void applyTo(QMatrix4x4 *matrix) const Q_DECL_OVERRIDE { + void applyTo(QMatrix4x4 *matrix) const override { *matrix *= transform; } private: @@ -70,7 +70,7 @@ class QQuickFlipablePrivate : public QQuickItemPrivate public: QQuickFlipablePrivate() : current(QQuickFlipable::Front), front(0), back(0), sideDirty(false) {} - void transformChanged() Q_DECL_OVERRIDE; + void transformChanged() override; void updateSide(); void setBackTransform(); diff --git a/src/quick/items/qquickflipable_p.h b/src/quick/items/qquickflipable_p.h index a76977d4ac..ec922725ef 100644 --- a/src/quick/items/qquickflipable_p.h +++ b/src/quick/items/qquickflipable_p.h @@ -93,7 +93,7 @@ Q_SIGNALS: void sideChanged(); protected: - void updatePolish() Q_DECL_OVERRIDE; + void updatePolish() override; private Q_SLOTS: void retransformBack(); diff --git a/src/quick/items/qquickframebufferobject.cpp b/src/quick/items/qquickframebufferobject.cpp index 042ee21aec..5a40d6b705 100644 --- a/src/quick/items/qquickframebufferobject.cpp +++ b/src/quick/items/qquickframebufferobject.cpp @@ -219,7 +219,7 @@ public: window->update(); } - QSGTexture *texture() const Q_DECL_OVERRIDE + QSGTexture *texture() const override { return QSGSimpleTextureNode::texture(); } diff --git a/src/quick/items/qquickframebufferobject.h b/src/quick/items/qquickframebufferobject.h index 13eeb931ad..d66ca40b3a 100644 --- a/src/quick/items/qquickframebufferobject.h +++ b/src/quick/items/qquickframebufferobject.h @@ -75,7 +75,7 @@ public: void *data; }; - QQuickFramebufferObject(QQuickItem *parent = Q_NULLPTR); + QQuickFramebufferObject(QQuickItem *parent = nullptr); bool textureFollowsItemSize() const; void setTextureFollowsItemSize(bool follows); @@ -85,15 +85,15 @@ public: virtual Renderer *createRenderer() const = 0; - bool isTextureProvider() const Q_DECL_OVERRIDE; - QSGTextureProvider *textureProvider() const Q_DECL_OVERRIDE; - void releaseResources() Q_DECL_OVERRIDE; + bool isTextureProvider() const override; + QSGTextureProvider *textureProvider() const override; + void releaseResources() override; protected: - void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE; + void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; protected: - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; Q_SIGNALS: void textureFollowsItemSizeChanged(bool); diff --git a/src/quick/items/qquickimage_p.h b/src/quick/items/qquickimage_p.h index a5331266c9..09b2c1eeb7 100644 --- a/src/quick/items/qquickimage_p.h +++ b/src/quick/items/qquickimage_p.h @@ -91,7 +91,7 @@ public: qreal paintedWidth() const; qreal paintedHeight() const; - QRectF boundingRect() const Q_DECL_OVERRIDE; + QRectF boundingRect() const override; HAlignment horizontalAlignment() const; void setHorizontalAlignment(HAlignment align); @@ -99,13 +99,13 @@ public: VAlignment verticalAlignment() const; void setVerticalAlignment(VAlignment align); - bool isTextureProvider() const Q_DECL_OVERRIDE { return true; } - QSGTextureProvider *textureProvider() const Q_DECL_OVERRIDE; + bool isTextureProvider() const override { return true; } + QSGTextureProvider *textureProvider() const override; bool mipmap() const; void setMipmap(bool use); - virtual void emitAutoTransformBaseChanged() Q_DECL_OVERRIDE { emit autoTransformChanged(); } + void emitAutoTransformBaseChanged() override { emit autoTransformChanged(); } Q_SIGNALS: void fillModeChanged(); @@ -120,12 +120,12 @@ private Q_SLOTS: protected: QQuickImage(QQuickImagePrivate &dd, QQuickItem *parent); - void pixmapChange() Q_DECL_OVERRIDE; + void pixmapChange() override; void updatePaintedGeometry(); - void releaseResources() Q_DECL_OVERRIDE; + void releaseResources() override; - void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE; - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; private: Q_DISABLE_COPY(QQuickImage) diff --git a/src/quick/items/qquickimagebase_p.h b/src/quick/items/qquickimagebase_p.h index 54b1f789c9..4d4a6fceaf 100644 --- a/src/quick/items/qquickimagebase_p.h +++ b/src/quick/items/qquickimagebase_p.h @@ -115,9 +115,9 @@ Q_SIGNALS: protected: virtual void load(); - void componentComplete() Q_DECL_OVERRIDE; + void componentComplete() override; virtual void pixmapChange(); - void itemChange(ItemChange change, const ItemChangeData &value) Q_DECL_OVERRIDE; + void itemChange(ItemChange change, const ItemChangeData &value) override; QQuickImageBase(QQuickImageBasePrivate &dd, QQuickItem *parent); private Q_SLOTS: diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 0a5d7adf8b..993d622087 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -2488,13 +2488,13 @@ QQuickItem *QQuickItemPrivate::nextTabChildItem(const QQuickItem *item, int star { if (!item) { qWarning() << "QQuickItemPrivate::nextTabChildItem called with null item."; - return Q_NULLPTR; + return nullptr; } const QList<QQuickItem *> &children = item->childItems(); const int count = children.count(); if (start < 0 || start >= count) { qWarning() << "QQuickItemPrivate::nextTabChildItem: Start index value out of range for item" << item; - return Q_NULLPTR; + return nullptr; } while (start < count) { QQuickItem *child = children.at(start); @@ -2502,14 +2502,14 @@ QQuickItem *QQuickItemPrivate::nextTabChildItem(const QQuickItem *item, int star return child; ++start; } - return Q_NULLPTR; + return nullptr; } QQuickItem *QQuickItemPrivate::prevTabChildItem(const QQuickItem *item, int start) { if (!item) { qWarning() << "QQuickItemPrivate::prevTabChildItem called with null item."; - return Q_NULLPTR; + return nullptr; } const QList<QQuickItem *> &children = item->childItems(); const int count = children.count(); @@ -2517,7 +2517,7 @@ QQuickItem *QQuickItemPrivate::prevTabChildItem(const QQuickItem *item, int star start = count - 1; if (start < 0 || start >= count) { qWarning() << "QQuickItemPrivate::prevTabChildItem: Start index value out of range for item" << item; - return Q_NULLPTR; + return nullptr; } while (start >= 0) { QQuickItem *child = children.at(start); @@ -2525,7 +2525,7 @@ QQuickItem *QQuickItemPrivate::prevTabChildItem(const QQuickItem *item, int star return child; --start; } - return Q_NULLPTR; + return nullptr; } QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, bool forward) @@ -2565,8 +2565,8 @@ QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, boo QQuickItem *last = current; bool hasChildren = !current->childItems().isEmpty() && current->isEnabled() && current->isVisible(); - QQuickItem *firstChild = Q_NULLPTR; - QQuickItem *lastChild = Q_NULLPTR; + QQuickItem *firstChild = nullptr; + QQuickItem *lastChild = nullptr; if (hasChildren) { firstChild = nextTabChildItem(current, 0); if (!firstChild) @@ -2598,11 +2598,11 @@ QQuickItem* QQuickItemPrivate::nextPrevItemInTabFocusChain(QQuickItem *item, boo if (!current->childItems().isEmpty()) skip = true; // back to the parent - } else if (QQuickItem *parent = !isTabFence ? current->parentItem() : Q_NULLPTR) { + } else if (QQuickItem *parent = !isTabFence ? current->parentItem() : nullptr) { // we would evaluate the parent twice, thus we skip if (forward) { skip = true; - } else if (QQuickItem *firstSibling = !forward ? nextTabChildItem(parent, 0) : Q_NULLPTR) { + } else if (QQuickItem *firstSibling = !forward ? nextTabChildItem(parent, 0) : nullptr) { if (last != firstSibling || (parent->isFocusScope() && parent->activeFocusOnTab() && parent->hasActiveFocus())) skip = true; diff --git a/src/quick/items/qquickitem.h b/src/quick/items/qquickitem.h index 25641f16f9..f6ee54e94d 100644 --- a/src/quick/items/qquickitem.h +++ b/src/quick/items/qquickitem.h @@ -59,7 +59,7 @@ class Q_QUICK_EXPORT QQuickTransform : public QObject { Q_OBJECT public: - explicit QQuickTransform(QObject *parent = Q_NULLPTR); + explicit QQuickTransform(QObject *parent = nullptr); ~QQuickTransform(); void appendToItem(QQuickItem *); @@ -196,7 +196,7 @@ public: }; Q_ENUM(TransformOrigin) - explicit QQuickItem(QQuickItem *parent = Q_NULLPTR); + explicit QQuickItem(QQuickItem *parent = nullptr); virtual ~QQuickItem(); QQuickWindow *window() const; @@ -392,7 +392,7 @@ Q_SIGNALS: void implicitHeightChanged(); protected: - bool event(QEvent *) Q_DECL_OVERRIDE; + bool event(QEvent *) override; bool isComponentComplete() const; virtual void itemChange(ItemChange, const ItemChangeData &); @@ -405,8 +405,8 @@ protected: bool heightValid() const; // ### better name? void setImplicitSize(qreal, qreal); - void classBegin() Q_DECL_OVERRIDE; - void componentComplete() Q_DECL_OVERRIDE; + void classBegin() override; + void componentComplete() override; virtual void keyPressEvent(QKeyEvent *event); virtual void keyReleaseEvent(QKeyEvent *event); @@ -445,7 +445,7 @@ protected: virtual void updatePolish(); protected: - QQuickItem(QQuickItemPrivate &dd, QQuickItem *parent = Q_NULLPTR); + QQuickItem(QQuickItemPrivate &dd, QQuickItem *parent = nullptr); private: Q_PRIVATE_SLOT(d_func(), void _q_resourceObjectDeleted(QObject *)) diff --git a/src/quick/items/qquickitem_p.h b/src/quick/items/qquickitem_p.h index 446a7d0945..387ce326c2 100644 --- a/src/quick/items/qquickitem_p.h +++ b/src/quick/items/qquickitem_p.h @@ -101,10 +101,10 @@ public: void complete(); protected: - void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) Q_DECL_OVERRIDE; - void itemDestroyed(QQuickItem *item) Q_DECL_OVERRIDE; - void itemChildAdded(QQuickItem *, QQuickItem *) Q_DECL_OVERRIDE; - void itemChildRemoved(QQuickItem *, QQuickItem *) Q_DECL_OVERRIDE; + void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) override; + void itemDestroyed(QQuickItem *item) override; + void itemChildAdded(QQuickItem *, QQuickItem *) override; + void itemChildRemoved(QQuickItem *, QQuickItem *) override; //void itemVisibilityChanged(QQuickItem *item) private: @@ -194,11 +194,11 @@ public: QQuickShaderEffectSource *effectSource() const { return m_effectSource; } - void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) Q_DECL_OVERRIDE; - void itemOpacityChanged(QQuickItem *) Q_DECL_OVERRIDE; - void itemParentChanged(QQuickItem *, QQuickItem *) Q_DECL_OVERRIDE; - void itemSiblingOrderChanged(QQuickItem *) Q_DECL_OVERRIDE; - void itemVisibilityChanged(QQuickItem *) Q_DECL_OVERRIDE; + void itemGeometryChanged(QQuickItem *, QQuickGeometryChange, const QRectF &) override; + void itemOpacityChanged(QQuickItem *) override; + void itemParentChanged(QQuickItem *, QQuickItem *) override; + void itemSiblingOrderChanged(QQuickItem *) override; + void itemVisibilityChanged(QQuickItem *) override; void updateMatrix(); void updateGeometry(); @@ -712,8 +712,8 @@ Q_SIGNALS: void priorityChanged(); private: - void keyPressed(QKeyEvent *event, bool post) Q_DECL_OVERRIDE; - void keyReleased(QKeyEvent *event, bool post) Q_DECL_OVERRIDE; + void keyPressed(QKeyEvent *event, bool post) override; + void keyReleased(QKeyEvent *event, bool post) override; void setFocusNavigation(QQuickItem *currentItem, const char *dir, Qt::FocusReason reason = Qt::OtherFocusReason); }; @@ -749,7 +749,7 @@ class QQuickEnterKeyAttached : public QObject Q_PROPERTY(Qt::EnterKeyType type READ type WRITE setType NOTIFY typeChanged) public: - explicit QQuickEnterKeyAttached(QObject *parent = Q_NULLPTR); + explicit QQuickEnterKeyAttached(QObject *parent = nullptr); Qt::EnterKeyType type() const; void setType(Qt::EnterKeyType type); @@ -817,7 +817,7 @@ public: return QQmlListProperty<QQuickItem>(this, d->targets); } - void componentComplete() Q_DECL_OVERRIDE; + void componentComplete() override; static QQuickKeysAttached *qmlAttachedProperties(QObject *); @@ -869,11 +869,11 @@ Q_SIGNALS: void volumeDownPressed(QQuickKeyEvent *event); private: - void keyPressed(QKeyEvent *event, bool post) Q_DECL_OVERRIDE; - void keyReleased(QKeyEvent *event, bool post) Q_DECL_OVERRIDE; + void keyPressed(QKeyEvent *event, bool post) override; + void keyReleased(QKeyEvent *event, bool post) override; #if QT_CONFIG(im) - void inputMethodEvent(QInputMethodEvent *, bool post) Q_DECL_OVERRIDE; - QVariant inputMethodQuery(Qt::InputMethodQuery query) const Q_DECL_OVERRIDE; + void inputMethodEvent(QInputMethodEvent *, bool post) override; + QVariant inputMethodQuery(Qt::InputMethodQuery query) const override; #endif void shortcutOverride(QKeyEvent *event) override; static QByteArray keyToSignal(int key); diff --git a/src/quick/items/qquickitemanimation.cpp b/src/quick/items/qquickitemanimation.cpp index d4d346def9..4b5c81b4d4 100644 --- a/src/quick/items/qquickitemanimation.cpp +++ b/src/quick/items/qquickitemanimation.cpp @@ -211,7 +211,7 @@ struct QQuickParentAnimationData : public QAbstractAnimationAction //### reverse should probably apply on a per-action basis bool reverse; QList<QQuickParentChange *> pc; - void doAction() Q_DECL_OVERRIDE + void doAction() override { for (int ii = 0; ii < actions.count(); ++ii) { const QQuickStateAction &action = actions.at(ii); diff --git a/src/quick/items/qquickitemanimation_p.h b/src/quick/items/qquickitemanimation_p.h index a503cff223..3b3fad9cc4 100644 --- a/src/quick/items/qquickitemanimation_p.h +++ b/src/quick/items/qquickitemanimation_p.h @@ -89,7 +89,7 @@ protected: QAbstractAnimationJob* transition(QQuickStateActions &actions, QQmlProperties &modified, TransitionDirection direction, - QObject *defaultTarget = 0) Q_DECL_OVERRIDE; + QObject *defaultTarget = 0) override; }; class QQuickAnchorAnimationPrivate; @@ -121,7 +121,7 @@ protected: QAbstractAnimationJob* transition(QQuickStateActions &actions, QQmlProperties &modified, TransitionDirection direction, - QObject *defaultTarget = 0) Q_DECL_OVERRIDE; + QObject *defaultTarget = 0) override; }; #if QT_CONFIG(quick_path) @@ -188,7 +188,7 @@ protected: QAbstractAnimationJob* transition(QQuickStateActions &actions, QQmlProperties &modified, TransitionDirection direction, - QObject *defaultTarget = 0) Q_DECL_OVERRIDE; + QObject *defaultTarget = 0) override; Q_SIGNALS: void durationChanged(int); void easingChanged(const QEasingCurve &); diff --git a/src/quick/items/qquickitemgrabresult.h b/src/quick/items/qquickitemgrabresult.h index 30f8f0c2ef..3dc10e2d75 100644 --- a/src/quick/items/qquickitemgrabresult.h +++ b/src/quick/items/qquickitemgrabresult.h @@ -82,7 +82,7 @@ private Q_SLOTS: private: friend class QQuickItem; - QQuickItemGrabResult(QObject *parent = Q_NULLPTR); + QQuickItemGrabResult(QObject *parent = nullptr); }; QT_END_NAMESPACE diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp index 1406e5b547..3c87496c83 100644 --- a/src/quick/items/qquickitemsmodule.cpp +++ b/src/quick/items/qquickitemsmodule.cpp @@ -156,6 +156,9 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor) QQmlPrivate::RegisterAutoParent autoparent = { 0, &qquickitem_autoParent }; QQmlPrivate::qmlregister(QQmlPrivate::AutoParentRegistration, &autoparent); + // Register the latest version, even if there are no new types or new revisions for existing types yet. + qmlRegisterModule(uri, 2, QT_VERSION_MINOR); + #if !QT_CONFIG(quick_animatedimage) qmlRegisterTypeNotAvailable(uri,major,minor,"AnimatedImage", QCoreApplication::translate("QQuickAnimatedImage","Qt was built without support for QMovie")); #else diff --git a/src/quick/items/qquickitemview_p_p.h b/src/quick/items/qquickitemview_p_p.h index 2c04022cde..374b8388ba 100644 --- a/src/quick/items/qquickitemview_p_p.h +++ b/src/quick/items/qquickitemview_p_p.h @@ -201,7 +201,7 @@ public: void regenerate(bool orientationChanged=false); void layout(); - virtual void animationFinished(QAbstractAnimationJob *) override; + void animationFinished(QAbstractAnimationJob *) override; void refill(); void refill(qreal from, qreal to); void mirrorChange() override; diff --git a/src/quick/items/qquickloader_p.h b/src/quick/items/qquickloader_p.h index db171dcd1e..27e5d1ec8b 100644 --- a/src/quick/items/qquickloader_p.h +++ b/src/quick/items/qquickloader_p.h @@ -105,8 +105,8 @@ Q_SIGNALS: void asynchronousChanged(); protected: - void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE; - void componentComplete() Q_DECL_OVERRIDE; + void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; + void componentComplete() override; private: void setSource(const QUrl &sourceUrl, bool needsClear); diff --git a/src/quick/items/qquickloader_p_p.h b/src/quick/items/qquickloader_p_p.h index 9b6267e011..7492527401 100644 --- a/src/quick/items/qquickloader_p_p.h +++ b/src/quick/items/qquickloader_p_p.h @@ -68,8 +68,8 @@ public: QQuickLoaderIncubator(QQuickLoaderPrivate *l, IncubationMode mode) : QQmlIncubator(mode), loader(l) {} protected: - void statusChanged(Status) Q_DECL_OVERRIDE; - void setInitialState(QObject *) Q_DECL_OVERRIDE; + void statusChanged(Status) override; + void setInitialState(QObject *) override; private: QQuickLoaderPrivate *loader; @@ -84,9 +84,9 @@ public: QQuickLoaderPrivate(); ~QQuickLoaderPrivate(); - void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &oldGeometry) Q_DECL_OVERRIDE; - void itemImplicitWidthChanged(QQuickItem *) Q_DECL_OVERRIDE; - void itemImplicitHeightChanged(QQuickItem *) Q_DECL_OVERRIDE; + void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &oldGeometry) override; + void itemImplicitWidthChanged(QQuickItem *) override; + void itemImplicitHeightChanged(QQuickItem *) override; void clear(); void initResize(); void load(); @@ -97,8 +97,8 @@ public: static QUrl resolveSourceUrl(QQmlV4Function *args); QV4::ReturnedValue extractInitialPropertyValues(QQmlV4Function *args, QObject *loader, bool *error); - qreal getImplicitWidth() const Q_DECL_OVERRIDE; - qreal getImplicitHeight() const Q_DECL_OVERRIDE; + qreal getImplicitWidth() const override; + qreal getImplicitHeight() const override; QUrl source; QQuickItem *item; diff --git a/src/quick/items/qquickmousearea_p.h b/src/quick/items/qquickmousearea_p.h index ee166a2082..ae6c56726e 100644 --- a/src/quick/items/qquickmousearea_p.h +++ b/src/quick/items/qquickmousearea_p.h @@ -164,25 +164,25 @@ protected: bool setPressed(Qt::MouseButton button, bool p, Qt::MouseEventSource source); bool sendMouseEvent(QMouseEvent *event); - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseUngrabEvent() Q_DECL_OVERRIDE; - void hoverEnterEvent(QHoverEvent *event) Q_DECL_OVERRIDE; - void hoverMoveEvent(QHoverEvent *event) Q_DECL_OVERRIDE; - void hoverLeaveEvent(QHoverEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void mouseUngrabEvent() override; + void hoverEnterEvent(QHoverEvent *event) override; + void hoverMoveEvent(QHoverEvent *event) override; + void hoverLeaveEvent(QHoverEvent *event) override; #if QT_CONFIG(wheelevent) - void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE; + void wheelEvent(QWheelEvent *event) override; #endif - bool childMouseEventFilter(QQuickItem *i, QEvent *e) Q_DECL_OVERRIDE; - void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; - void windowDeactivateEvent() Q_DECL_OVERRIDE; + bool childMouseEventFilter(QQuickItem *i, QEvent *e) override; + void timerEvent(QTimerEvent *event) override; + void windowDeactivateEvent() override; void geometryChanged(const QRectF &newGeometry, - const QRectF &oldGeometry) Q_DECL_OVERRIDE; - void itemChange(ItemChange change, const ItemChangeData& value) Q_DECL_OVERRIDE; - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + const QRectF &oldGeometry) override; + void itemChange(ItemChange change, const ItemChangeData& value) override; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; private: void handlePress(); diff --git a/src/quick/items/qquickmultipointtoucharea.cpp b/src/quick/items/qquickmultipointtoucharea.cpp index 54136b1bbf..bdf30469ce 100644 --- a/src/quick/items/qquickmultipointtoucharea.cpp +++ b/src/quick/items/qquickmultipointtoucharea.cpp @@ -491,7 +491,7 @@ void QQuickMultiPointTouchArea::setMouseEnabled(bool arg) if (_mouseEnabled != arg) { _mouseEnabled = arg; if (_mouseTouchPoint && !arg) - _mouseTouchPoint = Q_NULLPTR; + _mouseTouchPoint = nullptr; emit mouseEnabledChanged(); } } @@ -835,7 +835,7 @@ void QQuickMultiPointTouchArea::mouseReleaseEvent(QMouseEvent *event) updateTouchData(event); _mouseTouchPoint->setInUse(false); _releasedTouchPoints.removeAll(_mouseTouchPoint); - _mouseTouchPoint = Q_NULLPTR; + _mouseTouchPoint = nullptr; } QQuickWindow *c = window(); diff --git a/src/quick/items/qquickmultipointtoucharea_p.h b/src/quick/items/qquickmultipointtoucharea_p.h index 25e1056712..64fe81563d 100644 --- a/src/quick/items/qquickmultipointtoucharea_p.h +++ b/src/quick/items/qquickmultipointtoucharea_p.h @@ -265,13 +265,13 @@ Q_SIGNALS: void mouseEnabledChanged(); protected: - void touchEvent(QTouchEvent *) Q_DECL_OVERRIDE; - bool childMouseEventFilter(QQuickItem *receiver, QEvent *event) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseUngrabEvent() Q_DECL_OVERRIDE; - void touchUngrabEvent() Q_DECL_OVERRIDE; + void touchEvent(QTouchEvent *) override; + bool childMouseEventFilter(QQuickItem *receiver, QEvent *event) override; + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void mouseUngrabEvent() override; + void touchUngrabEvent() override; void addTouchPrototype(QQuickTouchPoint* prototype); void addTouchPoint(const QTouchEvent::TouchPoint *p); @@ -285,10 +285,10 @@ protected: bool sendMouseEvent(QMouseEvent *event); bool shouldFilter(QEvent *event); void grabGesture(); - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; #ifdef Q_OS_OSX - void hoverEnterEvent(QHoverEvent *event) Q_DECL_OVERRIDE; - void hoverLeaveEvent(QHoverEvent *event) Q_DECL_OVERRIDE; + void hoverEnterEvent(QHoverEvent *event) override; + void hoverLeaveEvent(QHoverEvent *event) override; void setTouchEventsEnabled(bool enable); #endif diff --git a/src/quick/items/qquickopenglshadereffectnode.cpp b/src/quick/items/qquickopenglshadereffectnode.cpp index 5dbfee73cb..a6431135eb 100644 --- a/src/quick/items/qquickopenglshadereffectnode.cpp +++ b/src/quick/items/qquickopenglshadereffectnode.cpp @@ -67,16 +67,16 @@ class QQuickCustomMaterialShader : public QSGMaterialShader { public: QQuickCustomMaterialShader(const QQuickOpenGLShaderEffectMaterialKey &key, const QVector<QByteArray> &attributes); - void deactivate() Q_DECL_OVERRIDE; - void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) Q_DECL_OVERRIDE; - char const *const *attributeNames() const Q_DECL_OVERRIDE; + void deactivate() override; + void updateState(const RenderState &state, QSGMaterial *newEffect, QSGMaterial *oldEffect) override; + char const *const *attributeNames() const override; protected: friend class QQuickOpenGLShaderEffectNode; - void compile() Q_DECL_OVERRIDE; - const char *vertexShader() const Q_DECL_OVERRIDE; - const char *fragmentShader() const Q_DECL_OVERRIDE; + void compile() override; + const char *vertexShader() const override; + const char *fragmentShader() const override; const QQuickOpenGLShaderEffectMaterialKey m_key; QVector<QByteArray> m_attributes; diff --git a/src/quick/items/qquickopenglshadereffectnode_p.h b/src/quick/items/qquickopenglshadereffectnode_p.h index 784294d9eb..68eece7660 100644 --- a/src/quick/items/qquickopenglshadereffectnode_p.h +++ b/src/quick/items/qquickopenglshadereffectnode_p.h @@ -110,9 +110,9 @@ public: }; explicit QQuickOpenGLShaderEffectMaterial(QQuickOpenGLShaderEffectNode *node = 0); - QSGMaterialType *type() const Q_DECL_OVERRIDE; - QSGMaterialShader *createShader() const Q_DECL_OVERRIDE; - int compare(const QSGMaterial *other) const Q_DECL_OVERRIDE; + QSGMaterialType *type() const override; + QSGMaterialShader *createShader() const override; + int compare(const QSGMaterial *other) const override; QVector<QByteArray> attributes; QVector<UniformData> uniforms[QQuickOpenGLShaderEffectMaterialKey::ShaderTypeCount]; @@ -151,7 +151,7 @@ public: QQuickOpenGLShaderEffectNode(); virtual ~QQuickOpenGLShaderEffectNode(); - void preprocess() Q_DECL_OVERRIDE; + void preprocess() override; Q_SIGNALS: void logAndStatusChanged(const QString &, int status); diff --git a/src/quick/items/qquickpainteditem.h b/src/quick/items/qquickpainteditem.h index e8b471ac01..66a0ea83c9 100644 --- a/src/quick/items/qquickpainteditem.h +++ b/src/quick/items/qquickpainteditem.h @@ -57,7 +57,7 @@ class Q_QUICK_EXPORT QQuickPaintedItem : public QQuickItem Q_PROPERTY(QSize textureSize READ textureSize WRITE setTextureSize NOTIFY textureSizeChanged) public: - explicit QQuickPaintedItem(QQuickItem *parent = Q_NULLPTR); + explicit QQuickPaintedItem(QQuickItem *parent = nullptr); virtual ~QQuickPaintedItem(); enum RenderTarget { @@ -107,8 +107,8 @@ public: virtual void paint(QPainter *painter) = 0; - bool isTextureProvider() const Q_DECL_OVERRIDE; - QSGTextureProvider *textureProvider() const Q_DECL_OVERRIDE; + bool isTextureProvider() const override; + QSGTextureProvider *textureProvider() const override; Q_SIGNALS: void fillColorChanged(); @@ -118,10 +118,10 @@ Q_SIGNALS: void textureSizeChanged(); protected: - QQuickPaintedItem(QQuickPaintedItemPrivate &dd, QQuickItem *parent = Q_NULLPTR); - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; - void releaseResources() Q_DECL_OVERRIDE; - void itemChange(ItemChange, const ItemChangeData &) Q_DECL_OVERRIDE; + QQuickPaintedItem(QQuickPaintedItemPrivate &dd, QQuickItem *parent = nullptr); + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; + void releaseResources() override; + void itemChange(ItemChange, const ItemChangeData &) override; private Q_SLOTS: void invalidateSceneGraph(); diff --git a/src/quick/items/qquickpincharea_p.h b/src/quick/items/qquickpincharea_p.h index fc96594a4b..2363f1e2d4 100644 --- a/src/quick/items/qquickpincharea_p.h +++ b/src/quick/items/qquickpincharea_p.h @@ -286,13 +286,13 @@ Q_SIGNALS: Q_REVISION(1) void smartZoom(QQuickPinchEvent *pinch); protected: - bool childMouseEventFilter(QQuickItem *i, QEvent *e) Q_DECL_OVERRIDE; - void touchEvent(QTouchEvent *event) Q_DECL_OVERRIDE; + bool childMouseEventFilter(QQuickItem *i, QEvent *e) override; + void touchEvent(QTouchEvent *event) override; void geometryChanged(const QRectF &newGeometry, - const QRectF &oldGeometry) Q_DECL_OVERRIDE; - void itemChange(ItemChange change, const ItemChangeData& value) Q_DECL_OVERRIDE; - bool event(QEvent *) Q_DECL_OVERRIDE; + const QRectF &oldGeometry) override; + void itemChange(ItemChange change, const ItemChangeData& value) override; + bool event(QEvent *) override; private: void clearPinch(); diff --git a/src/quick/items/qquickpositioners_p.h b/src/quick/items/qquickpositioners_p.h index 9ae7029d69..ce583aefe8 100644 --- a/src/quick/items/qquickpositioners_p.h +++ b/src/quick/items/qquickpositioners_p.h @@ -158,10 +158,10 @@ public: protected: QQuickBasePositioner(QQuickBasePositionerPrivate &dd, PositionerType at, QQuickItem *parent); - void componentComplete() Q_DECL_OVERRIDE; - void itemChange(ItemChange, const ItemChangeData &) Q_DECL_OVERRIDE; + void componentComplete() override; + void itemChange(ItemChange, const ItemChangeData &) override; - void updatePolish() Q_DECL_OVERRIDE; + void updatePolish() override; Q_SIGNALS: void spacingChanged(); @@ -234,8 +234,8 @@ public: QQuickColumn(QQuickItem *parent=0); protected: - void doPositioning(QSizeF *contentSize) Q_DECL_OVERRIDE; - void reportConflictingAnchors() Q_DECL_OVERRIDE; + void doPositioning(QSizeF *contentSize) override; + void reportConflictingAnchors() override; private: Q_DISABLE_COPY(QQuickColumn) }; @@ -258,8 +258,8 @@ Q_SIGNALS: void effectiveLayoutDirectionChanged(); protected: - void doPositioning(QSizeF *contentSize) Q_DECL_OVERRIDE; - void reportConflictingAnchors() Q_DECL_OVERRIDE; + void doPositioning(QSizeF *contentSize) override; + void reportConflictingAnchors() override; private: Q_DISABLE_COPY(QQuickRow) Q_DECLARE_PRIVATE(QQuickRow) @@ -335,8 +335,8 @@ Q_SIGNALS: Q_REVISION(1) void verticalAlignmentChanged(VAlignment alignment); protected: - void doPositioning(QSizeF *contentSize) Q_DECL_OVERRIDE; - void reportConflictingAnchors() Q_DECL_OVERRIDE; + void doPositioning(QSizeF *contentSize) override; + void reportConflictingAnchors() override; private: int m_rows; @@ -377,8 +377,8 @@ Q_SIGNALS: void effectiveLayoutDirectionChanged(); protected: - void doPositioning(QSizeF *contentSize) Q_DECL_OVERRIDE; - void reportConflictingAnchors() Q_DECL_OVERRIDE; + void doPositioning(QSizeF *contentSize) override; + void reportConflictingAnchors() override; protected: QQuickFlow(QQuickFlowPrivate &dd, QQuickItem *parent); private: diff --git a/src/quick/items/qquickpositioners_p_p.h b/src/quick/items/qquickpositioners_p_p.h index 0be4c56df6..f4cb283a22 100644 --- a/src/quick/items/qquickpositioners_p_p.h +++ b/src/quick/items/qquickpositioners_p_p.h @@ -122,7 +122,7 @@ public: Qt::LayoutDirection layoutDirection; - void mirrorChange() Q_DECL_OVERRIDE { + void mirrorChange() override { effectiveLayoutDirectionChange(); } bool isLeftToRight() const { @@ -132,24 +132,24 @@ public: return effectiveLayoutMirror ? layoutDirection == Qt::RightToLeft : layoutDirection == Qt::LeftToRight; } - void itemSiblingOrderChanged(QQuickItem* other) Q_DECL_OVERRIDE + void itemSiblingOrderChanged(QQuickItem* other) override { Q_UNUSED(other); setPositioningDirty(); } - void itemGeometryChanged(QQuickItem *, QQuickGeometryChange change, const QRectF &) Q_DECL_OVERRIDE + void itemGeometryChanged(QQuickItem *, QQuickGeometryChange change, const QRectF &) override { if (change.sizeChange()) setPositioningDirty(); } - void itemVisibilityChanged(QQuickItem *) Q_DECL_OVERRIDE + void itemVisibilityChanged(QQuickItem *) override { setPositioningDirty(); } - void itemDestroyed(QQuickItem *item) Q_DECL_OVERRIDE + void itemDestroyed(QQuickItem *item) override { Q_Q(QQuickBasePositioner); int index = q->positionedItems.find(QQuickBasePositioner::PositionedItem(item)); diff --git a/src/quick/items/qquickrectangle_p.h b/src/quick/items/qquickrectangle_p.h index 724a06013c..52f0bc975b 100644 --- a/src/quick/items/qquickrectangle_p.h +++ b/src/quick/items/qquickrectangle_p.h @@ -170,7 +170,7 @@ Q_SIGNALS: void radiusChanged(); protected: - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; private Q_SLOTS: void doUpdate(); diff --git a/src/quick/items/qquickrendercontrol.h b/src/quick/items/qquickrendercontrol.h index 31ea176cc1..a626216f84 100644 --- a/src/quick/items/qquickrendercontrol.h +++ b/src/quick/items/qquickrendercontrol.h @@ -55,7 +55,7 @@ class Q_QUICK_EXPORT QQuickRenderControl : public QObject Q_OBJECT public: - explicit QQuickRenderControl(QObject *parent = Q_NULLPTR); + explicit QQuickRenderControl(QObject *parent = nullptr); ~QQuickRenderControl(); void prepareThread(QThread *targetThread); @@ -68,8 +68,8 @@ public: QImage grab(); - static QWindow *renderWindowFor(QQuickWindow *win, QPoint *offset = Q_NULLPTR); - virtual QWindow *renderWindow(QPoint *offset) { Q_UNUSED(offset); return Q_NULLPTR; } + static QWindow *renderWindowFor(QQuickWindow *win, QPoint *offset = nullptr); + virtual QWindow *renderWindow(QPoint *offset) { Q_UNUSED(offset); return nullptr; } Q_SIGNALS: void renderRequested(); diff --git a/src/quick/items/qquickrepeater_p.h b/src/quick/items/qquickrepeater_p.h index c14c1fb8cb..b630999547 100644 --- a/src/quick/items/qquickrepeater_p.h +++ b/src/quick/items/qquickrepeater_p.h @@ -94,8 +94,8 @@ private: void regenerate(); protected: - void componentComplete() Q_DECL_OVERRIDE; - void itemChange(ItemChange change, const ItemChangeData &value) Q_DECL_OVERRIDE; + void componentComplete() override; + void itemChange(ItemChange change, const ItemChangeData &value) override; private Q_SLOTS: void createdItem(int index, QObject *item); diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp index 8f0866f417..592485d6fa 100644 --- a/src/quick/items/qquickshadereffect.cpp +++ b/src/quick/items/qquickshadereffect.cpp @@ -876,7 +876,7 @@ void QQuickShaderEffectPrivate::updatePolish() #if QT_CONFIG(opengl) bool QQuickShaderEffect::isOpenGLShaderEffect() const { - return m_glImpl != Q_NULLPTR; + return m_glImpl != nullptr; } #endif diff --git a/src/quick/items/qquickshadereffectmesh_p.h b/src/quick/items/qquickshadereffectmesh_p.h index aa3112b5a5..f3ac956f60 100644 --- a/src/quick/items/qquickshadereffectmesh_p.h +++ b/src/quick/items/qquickshadereffectmesh_p.h @@ -95,10 +95,10 @@ class QQuickGridMesh : public QQuickShaderEffectMesh Q_PROPERTY(QSize resolution READ resolution WRITE setResolution NOTIFY resolutionChanged) public: QQuickGridMesh(QObject *parent = 0); - bool validateAttributes(const QVector<QByteArray> &attributes, int *posIndex) Q_DECL_OVERRIDE; + bool validateAttributes(const QVector<QByteArray> &attributes, int *posIndex) override; QSGGeometry *updateGeometry(QSGGeometry *geometry, int attrCount, int posIndex, - const QRectF &srcRect, const QRectF &rect) Q_DECL_OVERRIDE; - QString log() const Q_DECL_OVERRIDE { return m_log; } + const QRectF &srcRect, const QRectF &rect) override; + QString log() const override { return m_log; } void setResolution(const QSize &res); QSize resolution() const; diff --git a/src/quick/items/qquickshadereffectsource.cpp b/src/quick/items/qquickshadereffectsource.cpp index f61bad1179..b4a45431c5 100644 --- a/src/quick/items/qquickshadereffectsource.cpp +++ b/src/quick/items/qquickshadereffectsource.cpp @@ -87,7 +87,7 @@ public: : texture(t) , provider(p) {} - void run() Q_DECL_OVERRIDE { + void run() override { delete texture; delete provider; } diff --git a/src/quick/items/qquickshadereffectsource_p.h b/src/quick/items/qquickshadereffectsource_p.h index d9f9079a3d..185c5179b6 100644 --- a/src/quick/items/qquickshadereffectsource_p.h +++ b/src/quick/items/qquickshadereffectsource_p.h @@ -146,8 +146,8 @@ public: TextureMirroring textureMirroring() const; void setTextureMirroring(TextureMirroring mirroring); - bool isTextureProvider() const Q_DECL_OVERRIDE { return true; } - QSGTextureProvider *textureProvider() const Q_DECL_OVERRIDE; + bool isTextureProvider() const override { return true; } + QSGTextureProvider *textureProvider() const override; Q_INVOKABLE void scheduleUpdate(); @@ -174,11 +174,11 @@ private Q_SLOTS: void invalidateSceneGraph(); protected: - void releaseResources() Q_DECL_OVERRIDE; - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + void releaseResources() override; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; - void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) Q_DECL_OVERRIDE; - void itemChange(ItemChange change, const ItemChangeData &value) Q_DECL_OVERRIDE; + void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &) override; + void itemChange(ItemChange change, const ItemChangeData &value) override; private: void ensureTexture(); diff --git a/src/quick/items/qquicksprite_p.h b/src/quick/items/qquicksprite_p.h index d68a45ecc0..2f7f6da5c0 100644 --- a/src/quick/items/qquicksprite_p.h +++ b/src/quick/items/qquicksprite_p.h @@ -161,7 +161,7 @@ public: return m_frameDurationVariation; } - int variedDuration() const Q_DECL_OVERRIDE; + int variedDuration() const override; bool frameSync() const { diff --git a/src/quick/items/qquickspriteengine_p.h b/src/quick/items/qquickspriteengine_p.h index 4e5458a938..a1c156fa94 100644 --- a/src/quick/items/qquickspriteengine_p.h +++ b/src/quick/items/qquickspriteengine_p.h @@ -290,8 +290,8 @@ public: int spriteCount() const;//Like state count int maxFrames() const; - void restart(int index=0) Q_DECL_OVERRIDE; - void advance(int index=0) Q_DECL_OVERRIDE; + void restart(int index=0) override; + void advance(int index=0) override; //Similar API to QQuickPixmap for async loading convenience bool isNull() const { return status() == QQuickPixmap::Null; } diff --git a/src/quick/items/qquickspritesequence_p.h b/src/quick/items/qquickspritesequence_p.h index b80a8348aa..ffcefecaec 100644 --- a/src/quick/items/qquickspritesequence_p.h +++ b/src/quick/items/qquickspritesequence_p.h @@ -105,7 +105,7 @@ private Q_SLOTS: protected: void reset(); - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; private: void prepareNextFrame(QSGSpriteNode *node); QSGSpriteNode* initNode(); diff --git a/src/quick/items/qquickstateoperations.cpp b/src/quick/items/qquickstateoperations.cpp index a4ce13a199..386bb058b5 100644 --- a/src/quick/items/qquickstateoperations.cpp +++ b/src/quick/items/qquickstateoperations.cpp @@ -510,7 +510,7 @@ QQuickStateActionEvent::EventType QQuickParentChange::type() const return ParentChange; } -bool QQuickParentChange::override(QQuickStateActionEvent*other) +bool QQuickParentChange::mayOverride(QQuickStateActionEvent*other) { Q_D(QQuickParentChange); if (other->type() != ParentChange) @@ -1302,7 +1302,7 @@ void QQuickAnchorChanges::clearBindings() } } -bool QQuickAnchorChanges::override(QQuickStateActionEvent*other) +bool QQuickAnchorChanges::mayOverride(QQuickStateActionEvent*other) { if (other->type() != AnchorChanges) return false; diff --git a/src/quick/items/qquickstateoperations_p.h b/src/quick/items/qquickstateoperations_p.h index 48b4b23a76..d61ed294cb 100644 --- a/src/quick/items/qquickstateoperations_p.h +++ b/src/quick/items/qquickstateoperations_p.h @@ -110,17 +110,17 @@ public: void setRotation(QQmlScriptString rotation); bool rotationIsSet() const; - ActionList actions() Q_DECL_OVERRIDE; + ActionList actions() override; - void saveOriginals() Q_DECL_OVERRIDE; + void saveOriginals() override; //virtual void copyOriginals(QQuickStateActionEvent*); - void execute() Q_DECL_OVERRIDE; - bool isReversable() Q_DECL_OVERRIDE; - void reverse() Q_DECL_OVERRIDE; - EventType type() const Q_DECL_OVERRIDE; - bool override(QQuickStateActionEvent*other) Q_DECL_OVERRIDE; - void rewind() Q_DECL_OVERRIDE; - void saveCurrentValues() Q_DECL_OVERRIDE; + void execute() override; + bool isReversable() override; + void reverse() override; + EventType type() const override; + bool mayOverride(QQuickStateActionEvent*other) override; + void rewind() override; + void saveCurrentValues() override; }; class QQuickAnchorChanges; @@ -190,28 +190,28 @@ public: QQuickAnchorChanges(QObject *parent=0); ~QQuickAnchorChanges(); - ActionList actions() Q_DECL_OVERRIDE; + ActionList actions() override; QQuickAnchorSet *anchors() const; QQuickItem *object() const; void setObject(QQuickItem *); - void execute() Q_DECL_OVERRIDE; - bool isReversable() Q_DECL_OVERRIDE; - void reverse() Q_DECL_OVERRIDE; - EventType type() const Q_DECL_OVERRIDE; - bool override(QQuickStateActionEvent*other) Q_DECL_OVERRIDE; - bool changesBindings() Q_DECL_OVERRIDE; - void saveOriginals() Q_DECL_OVERRIDE; - bool needsCopy() Q_DECL_OVERRIDE { return true; } - void copyOriginals(QQuickStateActionEvent*) Q_DECL_OVERRIDE; - void clearBindings() Q_DECL_OVERRIDE; - void rewind() Q_DECL_OVERRIDE; - void saveCurrentValues() Q_DECL_OVERRIDE; + void execute() override; + bool isReversable() override; + void reverse() override; + EventType type() const override; + bool mayOverride(QQuickStateActionEvent*other) override; + bool changesBindings() override; + void saveOriginals() override; + bool needsCopy() override { return true; } + void copyOriginals(QQuickStateActionEvent*) override; + void clearBindings() override; + void rewind() override; + void saveCurrentValues() override; QList<QQuickStateAction> additionalActions() const; - void saveTargetValues() Q_DECL_OVERRIDE; + void saveTargetValues() override; }; QT_END_NAMESPACE diff --git a/src/quick/items/qquicktext_p.h b/src/quick/items/qquicktext_p.h index a56bcdb87b..6c48dd86a9 100644 --- a/src/quick/items/qquicktext_p.h +++ b/src/quick/items/qquicktext_p.h @@ -212,15 +212,15 @@ public: FontSizeMode fontSizeMode() const; void setFontSizeMode(FontSizeMode mode); - void componentComplete() Q_DECL_OVERRIDE; + void componentComplete() override; int resourcesLoading() const; // mainly for testing qreal contentWidth() const; qreal contentHeight() const; - QRectF boundingRect() const Q_DECL_OVERRIDE; - QRectF clipRect() const Q_DECL_OVERRIDE; + QRectF boundingRect() const override; + QRectF clipRect() const override; Q_INVOKABLE void doLayout(); // ### Qt 6: remove Q_REVISION(9) Q_INVOKABLE void forceLayout(); @@ -291,18 +291,18 @@ Q_SIGNALS: protected: QQuickText(QQuickTextPrivate &dd, QQuickItem *parent = 0); - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void itemChange(ItemChange change, const ItemChangeData &value) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void itemChange(ItemChange change, const ItemChangeData &value) override; void geometryChanged(const QRectF &newGeometry, - const QRectF &oldGeometry) Q_DECL_OVERRIDE; - QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE; + const QRectF &oldGeometry) override; + QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; - void updatePolish() Q_DECL_OVERRIDE; + void updatePolish() override; - void hoverEnterEvent(QHoverEvent *event) Q_DECL_OVERRIDE; - void hoverMoveEvent(QHoverEvent *event) Q_DECL_OVERRIDE; - void hoverLeaveEvent(QHoverEvent *event) Q_DECL_OVERRIDE; + void hoverEnterEvent(QHoverEvent *event) override; + void hoverMoveEvent(QHoverEvent *event) override; + void hoverLeaveEvent(QHoverEvent *event) override; void invalidateFontCaches(); private Q_SLOTS: diff --git a/src/quick/items/qquicktext_p_p.h b/src/quick/items/qquicktext_p_p.h index 87f5162384..6fd0876a5f 100644 --- a/src/quick/items/qquicktext_p_p.h +++ b/src/quick/items/qquicktext_p_p.h @@ -78,7 +78,7 @@ public: void updateLayout(); bool determineHorizontalAlignment(); bool setHAlign(QQuickText::HAlignment, bool forceAlign = false); - void mirrorChange() Q_DECL_OVERRIDE; + void mirrorChange() override; bool isLineLaidOutConnected(); void setLineGeometry(QTextLine &line, qreal lineWidth, qreal &height); @@ -177,8 +177,8 @@ public: static const QChar elideChar; - qreal getImplicitWidth() const Q_DECL_OVERRIDE; - qreal getImplicitHeight() const Q_DECL_OVERRIDE; + qreal getImplicitWidth() const override; + qreal getImplicitHeight() const override; qreal availableWidth() const; qreal availableHeight() const; diff --git a/src/quick/items/qquicktextcontrol_p.h b/src/quick/items/qquicktextcontrol_p.h index 70104a97e0..862a81af28 100644 --- a/src/quick/items/qquicktextcontrol_p.h +++ b/src/quick/items/qquicktextcontrol_p.h @@ -177,9 +177,9 @@ public: bool cursorOn() const; protected: - void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *e) override; - bool event(QEvent *e) Q_DECL_OVERRIDE; + bool event(QEvent *e) override; private: Q_DISABLE_COPY(QQuickTextControl) diff --git a/src/quick/items/qquicktextedit.cpp b/src/quick/items/qquicktextedit.cpp index da11913bde..8f3a8998f5 100644 --- a/src/quick/items/qquicktextedit.cpp +++ b/src/quick/items/qquicktextedit.cpp @@ -2511,7 +2511,7 @@ void QQuickTextEdit::updateSize() if (d->isImplicitResizeEnabled()) { // ### Setting the implicitWidth triggers another updateSize(), and unless there are bindings nothing has changed. - if (!widthValid() && !d->requireImplicitWidth) + if (!widthValid()) setImplicitSize(newWidth + leftPadding() + rightPadding(), newHeight + topPadding() + bottomPadding()); else setImplicitHeight(newHeight + topPadding() + bottomPadding()); diff --git a/src/quick/items/qquicktextedit_p.h b/src/quick/items/qquicktextedit_p.h index 23033edb88..c883e39168 100644 --- a/src/quick/items/qquicktextedit_p.h +++ b/src/quick/items/qquicktextedit_p.h @@ -235,7 +235,7 @@ public: bool canUndo() const; bool canRedo() const; - void componentComplete() Q_DECL_OVERRIDE; + void componentComplete() override; /* FROM EDIT */ void setReadOnly(bool); @@ -244,7 +244,7 @@ public: QRectF cursorRectangle() const; #if QT_CONFIG(im) - QVariant inputMethodQuery(Qt::InputMethodQuery property) const Q_DECL_OVERRIDE; + QVariant inputMethodQuery(Qt::InputMethodQuery property) const override; Q_REVISION(4) Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const; #endif @@ -260,8 +260,8 @@ public: Q_INVOKABLE void moveCursorSelection(int pos); Q_INVOKABLE void moveCursorSelection(int pos, SelectionMode mode); - QRectF boundingRect() const Q_DECL_OVERRIDE; - QRectF clipRect() const Q_DECL_OVERRIDE; + QRectF boundingRect() const override; + QRectF clipRect() const override; bool isInputMethodComposing() const; @@ -387,28 +387,28 @@ protected: QQuickTextEdit(QQuickTextEditPrivate &dd, QQuickItem *parent = 0); void geometryChanged(const QRectF &newGeometry, - const QRectF &oldGeometry) Q_DECL_OVERRIDE; + const QRectF &oldGeometry) override; - bool event(QEvent *) Q_DECL_OVERRIDE; - void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE; - void keyReleaseEvent(QKeyEvent *) Q_DECL_OVERRIDE; - void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE; - void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE; + bool event(QEvent *) override; + void keyPressEvent(QKeyEvent *) override; + void keyReleaseEvent(QKeyEvent *) override; + void focusInEvent(QFocusEvent *event) override; + void focusOutEvent(QFocusEvent *event) override; - void hoverEnterEvent(QHoverEvent *event) Q_DECL_OVERRIDE; - void hoverMoveEvent(QHoverEvent *event) Q_DECL_OVERRIDE; - void hoverLeaveEvent(QHoverEvent *event) Q_DECL_OVERRIDE; + void hoverEnterEvent(QHoverEvent *event) override; + void hoverMoveEvent(QHoverEvent *event) override; + void hoverLeaveEvent(QHoverEvent *event) override; // mouse filter? - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; #if QT_CONFIG(im) - void inputMethodEvent(QInputMethodEvent *e) Q_DECL_OVERRIDE; + void inputMethodEvent(QInputMethodEvent *e) override; #endif - QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) Q_DECL_OVERRIDE; - void updatePolish() Q_DECL_OVERRIDE; + QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *updatePaintNodeData) override; + void updatePolish() override; friend class QQuickTextUtil; friend class QQuickTextDocument; diff --git a/src/quick/items/qquicktextedit_p_p.h b/src/quick/items/qquicktextedit_p_p.h index 455fffbcbc..09718cb49a 100644 --- a/src/quick/items/qquicktextedit_p_p.h +++ b/src/quick/items/qquicktextedit_p_p.h @@ -143,8 +143,8 @@ public: void relayoutDocument(); bool determineHorizontalAlignment(); bool setHAlign(QQuickTextEdit::HAlignment, bool forceAlign = false); - void mirrorChange() Q_DECL_OVERRIDE; - qreal getImplicitWidth() const Q_DECL_OVERRIDE; + void mirrorChange() override; + qreal getImplicitWidth() const override; Qt::LayoutDirection textDirection(const QString &text) const; bool isLinkHoveredConnected(); diff --git a/src/quick/items/qquicktextinput_p.h b/src/quick/items/qquicktextinput_p.h index c4da807471..b7d3fb00fa 100644 --- a/src/quick/items/qquicktextinput_p.h +++ b/src/quick/items/qquicktextinput_p.h @@ -118,7 +118,7 @@ public: QQuickTextInput(QQuickItem * parent=0); ~QQuickTextInput(); - void componentComplete() Q_DECL_OVERRIDE; + void componentComplete() override; enum EchoMode {//To match QLineEdit::EchoMode Normal, @@ -267,12 +267,12 @@ public: bool hasAcceptableInput() const; #if QT_CONFIG(im) - QVariant inputMethodQuery(Qt::InputMethodQuery property) const Q_DECL_OVERRIDE; + QVariant inputMethodQuery(Qt::InputMethodQuery property) const override; Q_REVISION(3) Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument) const; #endif - QRectF boundingRect() const Q_DECL_OVERRIDE; - QRectF clipRect() const Q_DECL_OVERRIDE; + QRectF boundingRect() const override; + QRectF clipRect() const override; bool canPaste() const; @@ -366,23 +366,23 @@ protected: QQuickTextInput(QQuickTextInputPrivate &dd, QQuickItem *parent = 0); void geometryChanged(const QRectF &newGeometry, - const QRectF &oldGeometry) Q_DECL_OVERRIDE; + const QRectF &oldGeometry) override; - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseDoubleClickEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void keyPressEvent(QKeyEvent* ev) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent *event) override; + void mouseMoveEvent(QMouseEvent *event) override; + void mouseReleaseEvent(QMouseEvent *event) override; + void mouseDoubleClickEvent(QMouseEvent *event) override; + void keyPressEvent(QKeyEvent* ev) override; #if QT_CONFIG(im) - void inputMethodEvent(QInputMethodEvent *) Q_DECL_OVERRIDE; + void inputMethodEvent(QInputMethodEvent *) override; #endif - void mouseUngrabEvent() Q_DECL_OVERRIDE; - bool event(QEvent *e) Q_DECL_OVERRIDE; - void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE; - void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE; - void timerEvent(QTimerEvent *event) Q_DECL_OVERRIDE; - QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) Q_DECL_OVERRIDE; - void updatePolish() Q_DECL_OVERRIDE; + void mouseUngrabEvent() override; + bool event(QEvent *e) override; + void focusOutEvent(QFocusEvent *event) override; + void focusInEvent(QFocusEvent *event) override; + void timerEvent(QTimerEvent *event) override; + QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) override; + void updatePolish() override; public Q_SLOTS: void selectAll(); diff --git a/src/quick/items/qquicktextinput_p_p.h b/src/quick/items/qquicktextinput_p_p.h index c3218197a4..c795aebfa9 100644 --- a/src/quick/items/qquicktextinput_p_p.h +++ b/src/quick/items/qquicktextinput_p_p.h @@ -172,7 +172,7 @@ public: void updateVerticalScroll(); bool determineHorizontalAlignment(); bool setHAlign(QQuickTextInput::HAlignment, bool forceAlign = false); - void mirrorChange() Q_DECL_OVERRIDE; + void mirrorChange() override; bool sendMouseEventToInputContext(QMouseEvent *event); #if QT_CONFIG(im) Qt::InputMethodHints effectiveInputMethodHints() const; @@ -451,7 +451,7 @@ public: void updateLayout(); void updateBaselineOffset(); - qreal getImplicitWidth() const Q_DECL_OVERRIDE; + qreal getImplicitWidth() const override; inline qreal padding() const { return extra.isAllocated() ? extra->padding : 0.0; } void setTopPadding(qreal value, bool reset = false); diff --git a/src/quick/items/qquicktranslate_p.h b/src/quick/items/qquicktranslate_p.h index 1bceba20cf..b0199cef40 100644 --- a/src/quick/items/qquicktranslate_p.h +++ b/src/quick/items/qquicktranslate_p.h @@ -75,7 +75,7 @@ public: qreal y() const; void setY(qreal); - void applyTo(QMatrix4x4 *matrix) const Q_DECL_OVERRIDE; + void applyTo(QMatrix4x4 *matrix) const override; Q_SIGNALS: void xChanged(); @@ -111,7 +111,7 @@ public: qreal zScale() const; void setZScale(qreal); - void applyTo(QMatrix4x4 *matrix) const Q_DECL_OVERRIDE; + void applyTo(QMatrix4x4 *matrix) const override; Q_SIGNALS: void originChanged(); @@ -146,7 +146,7 @@ public: void setAxis(const QVector3D &axis); void setAxis(Qt::Axis axis); - void applyTo(QMatrix4x4 *matrix) const Q_DECL_OVERRIDE; + void applyTo(QMatrix4x4 *matrix) const override; Q_SIGNALS: void originChanged(); @@ -170,7 +170,7 @@ public: QMatrix4x4 matrix() const; void setMatrix(const QMatrix4x4& matrix); - void applyTo(QMatrix4x4 *matrix) const Q_DECL_OVERRIDE; + void applyTo(QMatrix4x4 *matrix) const override; Q_SIGNALS: void matrixChanged(); diff --git a/src/quick/items/qquickview.h b/src/quick/items/qquickview.h index 6d3b30e4c4..142607fa39 100644 --- a/src/quick/items/qquickview.h +++ b/src/quick/items/qquickview.h @@ -60,9 +60,9 @@ class Q_QUICK_EXPORT QQuickView : public QQuickWindow Q_PROPERTY(Status status READ status NOTIFY statusChanged) Q_PROPERTY(QUrl source READ source WRITE setSource DESIGNABLE true) public: - explicit QQuickView(QWindow *parent = Q_NULLPTR); + explicit QQuickView(QWindow *parent = nullptr); QQuickView(QQmlEngine* engine, QWindow *parent); - explicit QQuickView(const QUrl &source, QWindow *parent = Q_NULLPTR); + explicit QQuickView(const QUrl &source, QWindow *parent = nullptr); virtual ~QQuickView(); QUrl source() const; diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index bd1a5076fd..3dfc1295fb 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -132,7 +132,7 @@ public: } protected: - void timerEvent(QTimerEvent *) Q_DECL_OVERRIDE + void timerEvent(QTimerEvent *) override { killTimer(m_timer); m_timer = 0; @@ -163,7 +163,7 @@ public slots: void animationStopped() { incubate(); } protected: - void incubatingObjectCountChanged(int count) Q_DECL_OVERRIDE + void incubatingObjectCountChanged(int count) override { if (count && !m_renderLoop->interleaveIncubation()) incubateAgain(); diff --git a/src/quick/items/qquickwindow.h b/src/quick/items/qquickwindow.h index 022c4738f2..58cfff5ace 100644 --- a/src/quick/items/qquickwindow.h +++ b/src/quick/items/qquickwindow.h @@ -106,7 +106,7 @@ public: }; Q_ENUM(TextRenderType) - explicit QQuickWindow(QWindow *parent = Q_NULLPTR); + explicit QQuickWindow(QWindow *parent = nullptr); explicit QQuickWindow(QQuickRenderControl *renderControl); virtual ~QQuickWindow(); @@ -114,7 +114,7 @@ public: QQuickItem *contentItem() const; QQuickItem *activeFocusItem() const; - QObject *focusObject() const Q_DECL_OVERRIDE; + QObject *focusObject() const override; QQuickItem *mouseGrabberItem() const; @@ -136,7 +136,7 @@ public: QQmlIncubationController *incubationController() const; #if QT_CONFIG(accessibility) - QAccessibleInterface *accessibleRoot() const Q_DECL_OVERRIDE; + QAccessibleInterface *accessibleRoot() const override; #endif // Scene graph specific functions @@ -202,27 +202,27 @@ public Q_SLOTS: void releaseResources(); protected: - QQuickWindow(QQuickWindowPrivate &dd, QWindow *parent = Q_NULLPTR); + QQuickWindow(QQuickWindowPrivate &dd, QWindow *parent = nullptr); - void exposeEvent(QExposeEvent *) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE; + void exposeEvent(QExposeEvent *) override; + void resizeEvent(QResizeEvent *) override; - void showEvent(QShowEvent *) Q_DECL_OVERRIDE; - void hideEvent(QHideEvent *) Q_DECL_OVERRIDE; + void showEvent(QShowEvent *) override; + void hideEvent(QHideEvent *) override; // TODO Qt 6: reimplement QWindow::closeEvent to emit closing - void focusInEvent(QFocusEvent *) Q_DECL_OVERRIDE; - void focusOutEvent(QFocusEvent *) Q_DECL_OVERRIDE; + void focusInEvent(QFocusEvent *) override; + void focusOutEvent(QFocusEvent *) override; - bool event(QEvent *) Q_DECL_OVERRIDE; - void keyPressEvent(QKeyEvent *) Q_DECL_OVERRIDE; - void keyReleaseEvent(QKeyEvent *) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *) Q_DECL_OVERRIDE; - void mouseDoubleClickEvent(QMouseEvent *) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *) Q_DECL_OVERRIDE; + bool event(QEvent *) override; + void keyPressEvent(QKeyEvent *) override; + void keyReleaseEvent(QKeyEvent *) override; + void mousePressEvent(QMouseEvent *) override; + void mouseReleaseEvent(QMouseEvent *) override; + void mouseDoubleClickEvent(QMouseEvent *) override; + void mouseMoveEvent(QMouseEvent *) override; #if QT_CONFIG(wheelevent) - void wheelEvent(QWheelEvent *) Q_DECL_OVERRIDE; + void wheelEvent(QWheelEvent *) override; #endif private Q_SLOTS: diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h index 0399b26f62..c636719258 100644 --- a/src/quick/items/qquickwindow_p.h +++ b/src/quick/items/qquickwindow_p.h @@ -333,7 +333,7 @@ class QQuickWindowQObjectCleanupJob : public QRunnable { public: QQuickWindowQObjectCleanupJob(QObject *o) : object(o) { } - void run() Q_DECL_OVERRIDE { delete object; } + void run() override { delete object; } QObject *object; static void schedule(QQuickWindow *window, QObject *object) { Q_ASSERT(window); diff --git a/src/quick/items/qquickwindowattached.cpp b/src/quick/items/qquickwindowattached.cpp index c8d71139ca..ae62a7a496 100644 --- a/src/quick/items/qquickwindowattached.cpp +++ b/src/quick/items/qquickwindowattached.cpp @@ -68,12 +68,12 @@ bool QQuickWindowAttached::isActive() const QQuickItem *QQuickWindowAttached::activeFocusItem() const { - return (m_window ? m_window->activeFocusItem() : Q_NULLPTR); + return (m_window ? m_window->activeFocusItem() : nullptr); } QQuickItem *QQuickWindowAttached::contentItem() const { - return (m_window ? m_window->contentItem() : Q_NULLPTR); + return (m_window ? m_window->contentItem() : nullptr); } int QQuickWindowAttached::width() const diff --git a/src/quick/items/qquickwindowmodule_p.h b/src/quick/items/qquickwindowmodule_p.h index 869d5b9a8e..e7033e9b8d 100644 --- a/src/quick/items/qquickwindowmodule_p.h +++ b/src/quick/items/qquickwindowmodule_p.h @@ -70,7 +70,7 @@ class Q_QUICK_PRIVATE_EXPORT QQuickWindowQmlImpl : public QQuickWindow, public Q Q_PROPERTY(QObject *screen READ screen WRITE setScreen NOTIFY screenChanged REVISION 2) public: - QQuickWindowQmlImpl(QWindow *parent = Q_NULLPTR); + QQuickWindowQmlImpl(QWindow *parent = nullptr); void setVisible(bool visible); void setVisibility(Visibility visibility); @@ -86,8 +86,8 @@ Q_SIGNALS: Q_REVISION(2) void screenChanged(); protected: - void classBegin() Q_DECL_OVERRIDE; - void componentComplete() Q_DECL_OVERRIDE; + void classBegin() override; + void componentComplete() override; private Q_SLOTS: void setWindowVisibility(); |