diff options
Diffstat (limited to 'src/widgets/kernel')
32 files changed, 194 insertions, 197 deletions
diff --git a/src/widgets/kernel/qaction.h b/src/widgets/kernel/qaction.h index e1d431100e..84bf92d2ac 100644 --- a/src/widgets/kernel/qaction.h +++ b/src/widgets/kernel/qaction.h @@ -161,7 +161,7 @@ public: enum ActionEvent { Trigger, Hover }; void activate(ActionEvent event); - bool showStatusText(QWidget *widget = Q_NULLPTR); + bool showStatusText(QWidget *widget = nullptr); void setMenuRole(MenuRole menuRole); MenuRole menuRole() const; @@ -180,7 +180,7 @@ public: #endif protected: - bool event(QEvent *) Q_DECL_OVERRIDE; + bool event(QEvent *) override; QAction(QActionPrivate &dd, QObject *parent); public Q_SLOTS: diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 943aeaa2d9..93e2db4b1a 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -2804,7 +2804,7 @@ void QApplicationPrivate::sendSyntheticEnterLeave(QWidget *widget) */ QDesktopWidget *QApplication::desktop() { - CHECK_QAPP_INSTANCE(Q_NULLPTR) + CHECK_QAPP_INSTANCE(nullptr) if (!qt_desktopWidget || // not created yet !(qt_desktopWidget->windowType() == Qt::Desktop)) { // reparented away qt_desktopWidget = new QDesktopWidget(); @@ -3284,7 +3284,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) // sequence, so we reset wheel_widget in case no one accepts the event // or if we didn't get (or missed) a ScrollEnd previously. if (spontaneous && phase == Qt::ScrollBegin) - QApplicationPrivate::wheel_widget = Q_NULLPTR; + QApplicationPrivate::wheel_widget = nullptr; const QPoint &relpos = wheel->pos(); @@ -3334,7 +3334,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e) d->notify_helper(QApplicationPrivate::wheel_widget, &we); wheel->setAccepted(we.isAccepted()); if (phase == Qt::ScrollEnd) - QApplicationPrivate::wheel_widget = Q_NULLPTR; + QApplicationPrivate::wheel_widget = nullptr; } } break; diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h index 396d0c9474..7a5d7ba1a9 100644 --- a/src/widgets/kernel/qapplication.h +++ b/src/widgets/kernel/qapplication.h @@ -110,11 +110,11 @@ public: using QGuiApplication::palette; static QPalette palette(const QWidget *); static QPalette palette(const char *className); - static void setPalette(const QPalette &, const char* className = Q_NULLPTR); + static void setPalette(const QPalette &, const char* className = nullptr); static QFont font(); static QFont font(const QWidget*); static QFont font(const char *className); - static void setFont(const QFont &, const char* className = Q_NULLPTR); + static void setFont(const QFont &, const char* className = nullptr); static QFontMetrics fontMetrics(); #if QT_VERSION < 0x060000 // remove these forwarders in Qt 6 @@ -177,7 +177,7 @@ public: #endif static int exec(); - bool notify(QObject *, QEvent *) Q_DECL_OVERRIDE; + bool notify(QObject *, QEvent *) override; #ifdef QT_KEYPAD_NAVIGATION static Q_DECL_DEPRECATED void setKeypadNavigationEnabled(bool); @@ -201,8 +201,8 @@ public Q_SLOTS: static void aboutQt(); protected: - bool event(QEvent *) Q_DECL_OVERRIDE; - bool compressEvent(QEvent *, QObject *receiver, QPostEventList *) Q_DECL_OVERRIDE; + bool event(QEvent *) override; + bool compressEvent(QEvent *, QObject *receiver, QPostEventList *) override; private: Q_DISABLE_COPY(QApplication) diff --git a/src/widgets/kernel/qapplication_p.h b/src/widgets/kernel/qapplication_p.h index 5dca2e85f1..e83d6e5820 100644 --- a/src/widgets/kernel/qapplication_p.h +++ b/src/widgets/kernel/qapplication_p.h @@ -106,11 +106,11 @@ public: QApplicationPrivate(int &argc, char **argv, int flags); ~QApplicationPrivate(); - virtual void notifyLayoutDirectionChange() Q_DECL_OVERRIDE; - virtual void notifyActiveWindowChange(QWindow *) Q_DECL_OVERRIDE; + virtual void notifyLayoutDirectionChange() override; + virtual void notifyActiveWindowChange(QWindow *) override; - virtual bool shouldQuit() Q_DECL_OVERRIDE; - bool tryCloseAllWindows() Q_DECL_OVERRIDE; + virtual bool shouldQuit() override; + bool tryCloseAllWindows() override; #if 0 // Used to be included in Qt4 for Q_WS_X11 #ifndef QT_NO_SETTINGS @@ -122,13 +122,13 @@ public: static QString desktopStyleKey(); - void createEventDispatcher() Q_DECL_OVERRIDE; + void createEventDispatcher() override; static void dispatchEnterLeave(QWidget *enter, QWidget *leave, const QPointF &globalPosF); - void notifyWindowIconChanged() Q_DECL_OVERRIDE; + void notifyWindowIconChanged() override; //modality - bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = 0) const Q_DECL_OVERRIDE; + bool isWindowBlocked(QWindow *window, QWindow **blockingWindow = 0) const override; static bool isBlockedByModal(QWidget *widget); static bool modalState(); static bool tryModalHelper(QWidget *widget, QWidget **rettop = 0); @@ -158,7 +158,7 @@ public: #endif static bool inPopupMode(); - bool popupActive() Q_DECL_OVERRIDE { return inPopupMode(); } + bool popupActive() override { return inPopupMode(); } void closePopup(QWidget *popup); void openPopup(QWidget *popup); static void setFocusWidget(QWidget *focus, Qt::FocusReason reason); @@ -183,9 +183,9 @@ public: static QPalette *set_pal; protected: - void notifyThemeChanged() Q_DECL_OVERRIDE; + void notifyThemeChanged() override; #ifndef QT_NO_DRAGANDDROP - void notifyDragStarted(const QDrag *) Q_DECL_OVERRIDE; + void notifyDragStarted(const QDrag *) override; #endif // QT_NO_DRAGANDDROP public: @@ -284,7 +284,7 @@ public: ulong timestamp); static void translateTouchCancel(QTouchDevice *device, ulong timestamp); - QPixmap applyQIconStyleHelper(QIcon::Mode mode, const QPixmap& base) const Q_DECL_OVERRIDE; + QPixmap applyQIconStyleHelper(QIcon::Mode mode, const QPixmap& base) const override; private: static QApplicationPrivate *self; static bool tryCloseAllWidgetWindows(QWindowList *processedWindows); diff --git a/src/widgets/kernel/qboxlayout.cpp b/src/widgets/kernel/qboxlayout.cpp index 588cec2b95..a368f379ad 100644 --- a/src/widgets/kernel/qboxlayout.cpp +++ b/src/widgets/kernel/qboxlayout.cpp @@ -124,7 +124,7 @@ public: void calcHfw(int); void effectiveMargins(int *left, int *top, int *right, int *bottom) const; - QLayoutItem* replaceAt(int index, QLayoutItem*) Q_DECL_OVERRIDE; + QLayoutItem* replaceAt(int index, QLayoutItem*) override; }; QBoxLayoutPrivate::~QBoxLayoutPrivate() diff --git a/src/widgets/kernel/qboxlayout.h b/src/widgets/kernel/qboxlayout.h index 9c7d0e593f..6bb8f8aafa 100644 --- a/src/widgets/kernel/qboxlayout.h +++ b/src/widgets/kernel/qboxlayout.h @@ -61,7 +61,7 @@ public: enum Direction { LeftToRight, RightToLeft, TopToBottom, BottomToTop, Down = TopToBottom, Up = BottomToTop }; - explicit QBoxLayout(Direction, QWidget *parent = Q_NULLPTR); + explicit QBoxLayout(Direction, QWidget *parent = nullptr); ~QBoxLayout(); @@ -74,7 +74,7 @@ public: void addWidget(QWidget *, int stretch = 0, Qt::Alignment alignment = Qt::Alignment()); void addLayout(QLayout *layout, int stretch = 0); void addStrut(int); - void addItem(QLayoutItem *) Q_DECL_OVERRIDE; + void addItem(QLayoutItem *) override; void insertSpacing(int index, int size); void insertStretch(int index, int stretch = 0); @@ -91,20 +91,20 @@ public: void setStretch(int index, int stretch); int stretch(int index) const; - QSize sizeHint() const Q_DECL_OVERRIDE; - QSize minimumSize() const Q_DECL_OVERRIDE; - QSize maximumSize() const Q_DECL_OVERRIDE; + QSize sizeHint() const override; + QSize minimumSize() const override; + QSize maximumSize() const override; - bool hasHeightForWidth() const Q_DECL_OVERRIDE; - int heightForWidth(int) const Q_DECL_OVERRIDE; - int minimumHeightForWidth(int) const Q_DECL_OVERRIDE; + bool hasHeightForWidth() const override; + int heightForWidth(int) const override; + int minimumHeightForWidth(int) const override; - Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE; - void invalidate() Q_DECL_OVERRIDE; - QLayoutItem *itemAt(int) const Q_DECL_OVERRIDE; - QLayoutItem *takeAt(int) Q_DECL_OVERRIDE; - int count() const Q_DECL_OVERRIDE; - void setGeometry(const QRect&) Q_DECL_OVERRIDE; + Qt::Orientations expandingDirections() const override; + void invalidate() override; + QLayoutItem *itemAt(int) const override; + QLayoutItem *takeAt(int) override; + int count() const override; + void setGeometry(const QRect&) override; private: Q_DISABLE_COPY(QBoxLayout) diff --git a/src/widgets/kernel/qdesktopwidget.cpp b/src/widgets/kernel/qdesktopwidget.cpp index 1b9cf88efe..09e39c7cff 100644 --- a/src/widgets/kernel/qdesktopwidget.cpp +++ b/src/widgets/kernel/qdesktopwidget.cpp @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE QDesktopScreenWidget::QDesktopScreenWidget(QScreen *screen, const QRect &geometry) - : QWidget(Q_NULLPTR, Qt::Desktop), m_screen(screen) + : QWidget(nullptr, Qt::Desktop), m_screen(screen) { setVisible(false); if (QWindow *winHandle = windowHandle()) @@ -114,7 +114,7 @@ QDesktopScreenWidget *QDesktopWidgetPrivate::widgetForScreen(QScreen *qScreen) c if (widget->screen() == qScreen) return widget; } - return Q_NULLPTR; + return nullptr; } void QDesktopWidgetPrivate::_q_updateScreens() @@ -330,7 +330,7 @@ int QDesktopWidgetPrivate::screenNumber(const QWidget *w) if (!w->isWindow()) frame.moveTopLeft(w->mapToGlobal(QPoint(0, 0))); - QScreen *widgetScreen = Q_NULLPTR; + QScreen *widgetScreen = nullptr; int largestArea = 0; foreach (QScreen *screen, screens) { const QRect deviceIndependentScreenGeometry = diff --git a/src/widgets/kernel/qdesktopwidget.h b/src/widgets/kernel/qdesktopwidget.h index 64e1c568eb..97eef70263 100644 --- a/src/widgets/kernel/qdesktopwidget.h +++ b/src/widgets/kernel/qdesktopwidget.h @@ -65,7 +65,7 @@ public: int screenCount() const; int primaryScreen() const; - int screenNumber(const QWidget *widget = Q_NULLPTR) const; + int screenNumber(const QWidget *widget = nullptr) const; int screenNumber(const QPoint &) const; QWidget *screen(int screen = -1); @@ -87,7 +87,7 @@ Q_SIGNALS: void primaryScreenChanged(); protected: - void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent *e) override; private: Q_DISABLE_COPY(QDesktopWidget) diff --git a/src/widgets/kernel/qformlayout.cpp b/src/widgets/kernel/qformlayout.cpp index 868ac17b6f..8a5b863bb5 100644 --- a/src/widgets/kernel/qformlayout.cpp +++ b/src/widgets/kernel/qformlayout.cpp @@ -224,7 +224,7 @@ public: int hSpacing; int vSpacing; - QLayoutItem* replaceAt(int index, QLayoutItem*) Q_DECL_OVERRIDE; + QLayoutItem* replaceAt(int index, QLayoutItem*) override; }; QFormLayoutPrivate::QFormLayoutPrivate() diff --git a/src/widgets/kernel/qformlayout.h b/src/widgets/kernel/qformlayout.h index 5ec27433d3..40424f2a49 100644 --- a/src/widgets/kernel/qformlayout.h +++ b/src/widgets/kernel/qformlayout.h @@ -88,7 +88,7 @@ public: QLayoutItem *fieldItem; }; - explicit QFormLayout(QWidget *parent = Q_NULLPTR); + explicit QFormLayout(QWidget *parent = nullptr); ~QFormLayout(); void setFieldGrowthPolicy(FieldGrowthPolicy policy); @@ -142,19 +142,19 @@ public: QWidget *labelForField(QLayout *field) const; // reimplemented from QLayout - void addItem(QLayoutItem *item) Q_DECL_OVERRIDE; - QLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE; - QLayoutItem *takeAt(int index) Q_DECL_OVERRIDE; - - void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; - QSize minimumSize() const Q_DECL_OVERRIDE; - QSize sizeHint() const Q_DECL_OVERRIDE; - void invalidate() Q_DECL_OVERRIDE; - - bool hasHeightForWidth() const Q_DECL_OVERRIDE; - int heightForWidth(int width) const Q_DECL_OVERRIDE; - Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE; - int count() const Q_DECL_OVERRIDE; + void addItem(QLayoutItem *item) override; + QLayoutItem *itemAt(int index) const override; + QLayoutItem *takeAt(int index) override; + + void setGeometry(const QRect &rect) override; + QSize minimumSize() const override; + QSize sizeHint() const override; + void invalidate() override; + + bool hasHeightForWidth() const override; + int heightForWidth(int width) const override; + Qt::Orientations expandingDirections() const override; + int count() const override; int rowCount() const; diff --git a/src/widgets/kernel/qgesture.h b/src/widgets/kernel/qgesture.h index 1eda611d64..c5b2cee83d 100644 --- a/src/widgets/kernel/qgesture.h +++ b/src/widgets/kernel/qgesture.h @@ -70,7 +70,7 @@ class Q_WIDGETS_EXPORT QGesture : public QObject Q_PROPERTY(bool hasHotSpot READ hasHotSpot) public: - explicit QGesture(QObject *parent = Q_NULLPTR); + explicit QGesture(QObject *parent = nullptr); ~QGesture(); Qt::GestureType gestureType() const; @@ -114,7 +114,7 @@ class Q_WIDGETS_EXPORT QPanGesture : public QGesture Q_PRIVATE_PROPERTY(QPanGesture::d_func(), qreal verticalVelocity READ verticalVelocity WRITE setVerticalVelocity) public: - explicit QPanGesture(QObject *parent = Q_NULLPTR); + explicit QPanGesture(QObject *parent = nullptr); ~QPanGesture(); QPointF lastOffset() const; @@ -162,7 +162,7 @@ public: Q_PROPERTY(QPointF centerPoint READ centerPoint WRITE setCenterPoint) public: - explicit QPinchGesture(QObject *parent = Q_NULLPTR); + explicit QPinchGesture(QObject *parent = nullptr); ~QPinchGesture(); ChangeFlags totalChangeFlags() const; @@ -218,7 +218,7 @@ public: enum SwipeDirection { NoDirection, Left, Right, Up, Down }; Q_ENUM(SwipeDirection) - explicit QSwipeGesture(QObject *parent = Q_NULLPTR); + explicit QSwipeGesture(QObject *parent = nullptr); ~QSwipeGesture(); SwipeDirection horizontalDirection() const; @@ -239,7 +239,7 @@ class Q_WIDGETS_EXPORT QTapGesture : public QGesture Q_PROPERTY(QPointF position READ position WRITE setPosition) public: - explicit QTapGesture(QObject *parent = Q_NULLPTR); + explicit QTapGesture(QObject *parent = nullptr); ~QTapGesture(); QPointF position() const; @@ -257,7 +257,7 @@ class Q_WIDGETS_EXPORT QTapAndHoldGesture : public QGesture Q_PROPERTY(QPointF position READ position WRITE setPosition) public: - explicit QTapAndHoldGesture(QObject *parent = Q_NULLPTR); + explicit QTapAndHoldGesture(QObject *parent = nullptr); ~QTapAndHoldGesture(); QPointF position() const; diff --git a/src/widgets/kernel/qgridlayout.cpp b/src/widgets/kernel/qgridlayout.cpp index 29df38f19c..db8ef89477 100644 --- a/src/widgets/kernel/qgridlayout.cpp +++ b/src/widgets/kernel/qgridlayout.cpp @@ -170,7 +170,7 @@ public: } return 0; } - QLayoutItem* replaceAt(int index, QLayoutItem *newitem) Q_DECL_OVERRIDE + QLayoutItem* replaceAt(int index, QLayoutItem *newitem) override { if (!newitem) return 0; diff --git a/src/widgets/kernel/qgridlayout.h b/src/widgets/kernel/qgridlayout.h index 51dd65d181..0283ec2028 100644 --- a/src/widgets/kernel/qgridlayout.h +++ b/src/widgets/kernel/qgridlayout.h @@ -66,9 +66,9 @@ public: ~QGridLayout(); - QSize sizeHint() const Q_DECL_OVERRIDE; - QSize minimumSize() const Q_DECL_OVERRIDE; - QSize maximumSize() const Q_DECL_OVERRIDE; + QSize sizeHint() const override; + QSize minimumSize() const override; + QSize maximumSize() const override; void setHorizontalSpacing(int spacing); int horizontalSpacing() const; @@ -92,12 +92,12 @@ public: QRect cellRect(int row, int column) const; - bool hasHeightForWidth() const Q_DECL_OVERRIDE; - int heightForWidth(int) const Q_DECL_OVERRIDE; - int minimumHeightForWidth(int) const Q_DECL_OVERRIDE; + bool hasHeightForWidth() const override; + int heightForWidth(int) const override; + int minimumHeightForWidth(int) const override; - Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE; - void invalidate() Q_DECL_OVERRIDE; + Qt::Orientations expandingDirections() const override; + void invalidate() override; inline void addWidget(QWidget *w) { QLayout::addWidget(w); } void addWidget(QWidget *, int row, int column, Qt::Alignment = Qt::Alignment()); @@ -108,11 +108,11 @@ public: void setOriginCorner(Qt::Corner); Qt::Corner originCorner() const; - QLayoutItem *itemAt(int index) const Q_DECL_OVERRIDE; + QLayoutItem *itemAt(int index) const override; QLayoutItem *itemAtPosition(int row, int column) const; - QLayoutItem *takeAt(int index) Q_DECL_OVERRIDE; - int count() const Q_DECL_OVERRIDE; - void setGeometry(const QRect&) Q_DECL_OVERRIDE; + QLayoutItem *takeAt(int index) override; + int count() const override; + void setGeometry(const QRect&) override; void addItem(QLayoutItem *item, int row, int column, int rowSpan = 1, int columnSpan = 1, Qt::Alignment = Qt::Alignment()); @@ -120,7 +120,7 @@ public: void getItemPosition(int idx, int *row, int *column, int *rowSpan, int *columnSpan) const; protected: - void addItem(QLayoutItem *) Q_DECL_OVERRIDE; + void addItem(QLayoutItem *) override; private: Q_DISABLE_COPY(QGridLayout) diff --git a/src/widgets/kernel/qlayout.h b/src/widgets/kernel/qlayout.h index 2de12b4f99..abadf2e69d 100644 --- a/src/widgets/kernel/qlayout.h +++ b/src/widgets/kernel/qlayout.h @@ -104,8 +104,8 @@ public: QWidget *parentWidget() const; - void invalidate() Q_DECL_OVERRIDE; - QRect geometry() const Q_DECL_OVERRIDE; + void invalidate() override; + QRect geometry() const override; bool activate(); void update(); @@ -115,16 +115,16 @@ public: void removeWidget(QWidget *w); void removeItem(QLayoutItem *); - Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE; - QSize minimumSize() const Q_DECL_OVERRIDE; - QSize maximumSize() const Q_DECL_OVERRIDE; - virtual void setGeometry(const QRect&) Q_DECL_OVERRIDE; + Qt::Orientations expandingDirections() const override; + QSize minimumSize() const override; + QSize maximumSize() const override; + virtual void setGeometry(const QRect&) override; virtual QLayoutItem *itemAt(int index) const = 0; virtual QLayoutItem *takeAt(int index) = 0; virtual int indexOf(QWidget *) const; virtual int count() const = 0; - bool isEmpty() const Q_DECL_OVERRIDE; - QSizePolicy::ControlTypes controlTypes() const Q_DECL_OVERRIDE; + bool isEmpty() const override; + QSizePolicy::ControlTypes controlTypes() const override; // ### Qt 6 make this function virtual QLayoutItem *replaceWidget(QWidget *from, QWidget *to, Qt::FindChildOptions options = Qt::FindChildrenRecursively); @@ -133,7 +133,7 @@ public: QSize totalMinimumSize() const; QSize totalMaximumSize() const; QSize totalSizeHint() const; - QLayout *layout() Q_DECL_OVERRIDE; + QLayout *layout() override; void setEnabled(bool); bool isEnabled() const; @@ -143,7 +143,7 @@ public: protected: void widgetEvent(QEvent *); - void childEvent(QChildEvent *e) Q_DECL_OVERRIDE; + void childEvent(QChildEvent *e) override; void addChildLayout(QLayout *l); void addChildWidget(QWidget *w); bool adoptLayout(QLayout *layout); diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp index 5bc408a8cd..07588d2ee2 100644 --- a/src/widgets/kernel/qopenglwidget.cpp +++ b/src/widgets/kernel/qopenglwidget.cpp @@ -536,8 +536,8 @@ public: : QOpenGLPaintDevicePrivate(QSize()), w(widget) { } - void beginPaint() Q_DECL_OVERRIDE; - void endPaint() Q_DECL_OVERRIDE; + void beginPaint() override; + void endPaint() override; QOpenGLWidget *w; }; @@ -547,7 +547,7 @@ class QOpenGLWidgetPaintDevice : public QOpenGLPaintDevice public: QOpenGLWidgetPaintDevice(QOpenGLWidget *widget) : QOpenGLPaintDevice(*new QOpenGLWidgetPaintDevicePrivate(widget)) { } - void ensureActiveTarget() Q_DECL_OVERRIDE; + void ensureActiveTarget() override; }; class QOpenGLWidgetPrivate : public QWidgetPrivate @@ -576,8 +576,8 @@ public: void reset(); void recreateFbo(); - GLuint textureId() const Q_DECL_OVERRIDE; - QPlatformTextureList::Flags textureListFlags() Q_DECL_OVERRIDE; + GLuint textureId() const override; + QPlatformTextureList::Flags textureListFlags() override; void initialize(); void invokeUserPaint(); @@ -585,14 +585,14 @@ public: void invalidateFbo(); - QImage grabFramebuffer() Q_DECL_OVERRIDE; - void beginBackingStorePainting() Q_DECL_OVERRIDE { inBackingStorePaint = true; } - void endBackingStorePainting() Q_DECL_OVERRIDE { inBackingStorePaint = false; } - void beginCompose() Q_DECL_OVERRIDE; - void endCompose() Q_DECL_OVERRIDE; - void initializeViewportFramebuffer() Q_DECL_OVERRIDE; - void resizeViewportFramebuffer() Q_DECL_OVERRIDE; - void resolveSamples() Q_DECL_OVERRIDE; + QImage grabFramebuffer() override; + void beginBackingStorePainting() override { inBackingStorePaint = true; } + void endBackingStorePainting() override { inBackingStorePaint = false; } + void beginCompose() override; + void endCompose() override; + void initializeViewportFramebuffer() override; + void resizeViewportFramebuffer() override; + void resolveSamples() override; QOpenGLContext *context; QOpenGLFramebufferObject *fbo; diff --git a/src/widgets/kernel/qopenglwidget.h b/src/widgets/kernel/qopenglwidget.h index c0a6e41522..9eb4a9ba5a 100644 --- a/src/widgets/kernel/qopenglwidget.h +++ b/src/widgets/kernel/qopenglwidget.h @@ -63,7 +63,7 @@ public: PartialUpdate }; - explicit QOpenGLWidget(QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); + explicit QOpenGLWidget(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); ~QOpenGLWidget(); void setUpdateBehavior(UpdateBehavior updateBehavior); @@ -96,13 +96,13 @@ protected: virtual void resizeGL(int w, int h); virtual void paintGL(); - void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; - bool event(QEvent *e) Q_DECL_OVERRIDE; + void paintEvent(QPaintEvent *e) override; + void resizeEvent(QResizeEvent *e) override; + bool event(QEvent *e) override; - int metric(QPaintDevice::PaintDeviceMetric metric) const Q_DECL_OVERRIDE; - QPaintDevice *redirected(QPoint *p) const Q_DECL_OVERRIDE; - QPaintEngine *paintEngine() const Q_DECL_OVERRIDE; + int metric(QPaintDevice::PaintDeviceMetric metric) const override; + QPaintDevice *redirected(QPoint *p) const override; + QPaintEngine *paintEngine() const override; private: Q_DISABLE_COPY(QOpenGLWidget) diff --git a/src/widgets/kernel/qshortcut.h b/src/widgets/kernel/qshortcut.h index 22c667c9c1..6dcf4971b2 100644 --- a/src/widgets/kernel/qshortcut.h +++ b/src/widgets/kernel/qshortcut.h @@ -62,7 +62,7 @@ class Q_WIDGETS_EXPORT QShortcut : public QObject public: explicit QShortcut(QWidget *parent); QShortcut(const QKeySequence& key, QWidget *parent, - const char *member = Q_NULLPTR, const char *ambiguousMember = Q_NULLPTR, + const char *member = nullptr, const char *ambiguousMember = nullptr, Qt::ShortcutContext context = Qt::WindowShortcut); ~QShortcut(); @@ -91,7 +91,7 @@ Q_SIGNALS: void activatedAmbiguously(); protected: - bool event(QEvent *e) Q_DECL_OVERRIDE; + bool event(QEvent *e) override; }; #endif // QT_NO_SHORTCUT diff --git a/src/widgets/kernel/qstackedlayout.cpp b/src/widgets/kernel/qstackedlayout.cpp index b8b6f4302d..7430d833db 100644 --- a/src/widgets/kernel/qstackedlayout.cpp +++ b/src/widgets/kernel/qstackedlayout.cpp @@ -51,7 +51,7 @@ class QStackedLayoutPrivate : public QLayoutPrivate Q_DECLARE_PUBLIC(QStackedLayout) public: QStackedLayoutPrivate() : index(-1), stackingMode(QStackedLayout::StackOne) {} - QLayoutItem* replaceAt(int index, QLayoutItem *newitem) Q_DECL_OVERRIDE; + QLayoutItem* replaceAt(int index, QLayoutItem *newitem) override; QList<QLayoutItem *> list; int index; QStackedLayout::StackingMode stackingMode; diff --git a/src/widgets/kernel/qstackedlayout.h b/src/widgets/kernel/qstackedlayout.h index 6f5eded1f0..966ee2aae4 100644 --- a/src/widgets/kernel/qstackedlayout.h +++ b/src/widgets/kernel/qstackedlayout.h @@ -75,20 +75,20 @@ public: int currentIndex() const; using QLayout::widget; QWidget *widget(int) const; - int count() const Q_DECL_OVERRIDE; + int count() const override; StackingMode stackingMode() const; void setStackingMode(StackingMode stackingMode); // abstract virtual functions: - void addItem(QLayoutItem *item) Q_DECL_OVERRIDE; - QSize sizeHint() const Q_DECL_OVERRIDE; - QSize minimumSize() const Q_DECL_OVERRIDE; - QLayoutItem *itemAt(int) const Q_DECL_OVERRIDE; - QLayoutItem *takeAt(int) Q_DECL_OVERRIDE; - void setGeometry(const QRect &rect) Q_DECL_OVERRIDE; - bool hasHeightForWidth() const Q_DECL_OVERRIDE; - int heightForWidth(int width) const Q_DECL_OVERRIDE; + void addItem(QLayoutItem *item) override; + QSize sizeHint() const override; + QSize minimumSize() const override; + QLayoutItem *itemAt(int) const override; + QLayoutItem *takeAt(int) override; + void setGeometry(const QRect &rect) override; + bool hasHeightForWidth() const override; + int heightForWidth(int width) const override; Q_SIGNALS: void widgetRemoved(int index); diff --git a/src/widgets/kernel/qstandardgestures_p.h b/src/widgets/kernel/qstandardgestures_p.h index 9b2cffaa9a..6de09361fe 100644 --- a/src/widgets/kernel/qstandardgestures_p.h +++ b/src/widgets/kernel/qstandardgestures_p.h @@ -64,9 +64,9 @@ class QPanGestureRecognizer : public QGestureRecognizer public: explicit QPanGestureRecognizer(int pointCount = 2) : m_pointCount(pointCount) {} - QGesture *create(QObject *target) Q_DECL_OVERRIDE; - QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) Q_DECL_OVERRIDE; - void reset(QGesture *state) Q_DECL_OVERRIDE; + QGesture *create(QObject *target) override; + QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) override; + void reset(QGesture *state) override; private: const int m_pointCount; @@ -77,9 +77,9 @@ class QPinchGestureRecognizer : public QGestureRecognizer public: QPinchGestureRecognizer(); - QGesture *create(QObject *target) Q_DECL_OVERRIDE; - QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) Q_DECL_OVERRIDE; - void reset(QGesture *state) Q_DECL_OVERRIDE; + QGesture *create(QObject *target) override; + QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) override; + void reset(QGesture *state) override; }; class QSwipeGestureRecognizer : public QGestureRecognizer @@ -87,9 +87,9 @@ class QSwipeGestureRecognizer : public QGestureRecognizer public: QSwipeGestureRecognizer(); - QGesture *create(QObject *target) Q_DECL_OVERRIDE; - QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) Q_DECL_OVERRIDE; - void reset(QGesture *state) Q_DECL_OVERRIDE; + QGesture *create(QObject *target) override; + QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) override; + void reset(QGesture *state) override; }; class QTapGestureRecognizer : public QGestureRecognizer @@ -97,9 +97,9 @@ class QTapGestureRecognizer : public QGestureRecognizer public: QTapGestureRecognizer(); - QGesture *create(QObject *target) Q_DECL_OVERRIDE; - QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) Q_DECL_OVERRIDE; - void reset(QGesture *state) Q_DECL_OVERRIDE; + QGesture *create(QObject *target) override; + QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) override; + void reset(QGesture *state) override; }; class QTapAndHoldGestureRecognizer : public QGestureRecognizer @@ -107,9 +107,9 @@ class QTapAndHoldGestureRecognizer : public QGestureRecognizer public: QTapAndHoldGestureRecognizer(); - QGesture *create(QObject *target) Q_DECL_OVERRIDE; - QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) Q_DECL_OVERRIDE; - void reset(QGesture *state) Q_DECL_OVERRIDE; + QGesture *create(QObject *target) override; + QGestureRecognizer::Result recognize(QGesture *state, QObject *watched, QEvent *event) override; + void reset(QGesture *state) override; }; QT_END_NAMESPACE diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp index 80dc65e2d2..f30a83611d 100644 --- a/src/widgets/kernel/qtooltip.cpp +++ b/src/widgets/kernel/qtooltip.cpp @@ -127,7 +127,7 @@ public: ~QTipLabel(); static QTipLabel *instance; - bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE; + bool eventFilter(QObject *, QEvent *) override; QBasicTimer hideTimer, expireTimer; @@ -143,10 +143,10 @@ public: static int getTipScreen(const QPoint &pos, QWidget *w); protected: - void timerEvent(QTimerEvent *e) Q_DECL_OVERRIDE; - void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *e) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *e) Q_DECL_OVERRIDE; + void timerEvent(QTimerEvent *e) override; + void paintEvent(QPaintEvent *e) override; + void mouseMoveEvent(QMouseEvent *e) override; + void resizeEvent(QResizeEvent *e) override; #ifndef QT_NO_STYLE_STYLESHEET public slots: diff --git a/src/widgets/kernel/qtooltip.h b/src/widgets/kernel/qtooltip.h index 5e68eef0a7..edf1de0c1d 100644 --- a/src/widgets/kernel/qtooltip.h +++ b/src/widgets/kernel/qtooltip.h @@ -53,7 +53,7 @@ class Q_WIDGETS_EXPORT QToolTip QToolTip() Q_DECL_EQ_DELETE; public: // ### Qt 6 - merge the three showText functions below - static void showText(const QPoint &pos, const QString &text, QWidget *w = Q_NULLPTR); + static void showText(const QPoint &pos, const QString &text, QWidget *w = nullptr); static void showText(const QPoint &pos, const QString &text, QWidget *w, const QRect &rect); static void showText(const QPoint &pos, const QString &text, QWidget *w, const QRect &rect, int msecShowTime); static inline void hideText() { showText(QPoint(), QString()); } diff --git a/src/widgets/kernel/qwhatsthis.cpp b/src/widgets/kernel/qwhatsthis.cpp index 91d2b503e0..96d0cf61c4 100644 --- a/src/widgets/kernel/qwhatsthis.cpp +++ b/src/widgets/kernel/qwhatsthis.cpp @@ -145,12 +145,12 @@ public: static QWhatsThat *instance; protected: - void showEvent(QShowEvent *e) Q_DECL_OVERRIDE; - void mousePressEvent(QMouseEvent*) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent*) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent*) Q_DECL_OVERRIDE; - void keyPressEvent(QKeyEvent*) Q_DECL_OVERRIDE; - void paintEvent(QPaintEvent*) Q_DECL_OVERRIDE; + void showEvent(QShowEvent *e) override; + void mousePressEvent(QMouseEvent*) override; + void mouseReleaseEvent(QMouseEvent*) override; + void mouseMoveEvent(QMouseEvent*) override; + void keyPressEvent(QKeyEvent*) override; + void paintEvent(QPaintEvent*) override; private: QPointer<QWidget>widget; @@ -365,7 +365,7 @@ class QWhatsThisPrivate : public QObject QWhatsThisPrivate(); ~QWhatsThisPrivate(); static QWhatsThisPrivate *instance; - bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE; + bool eventFilter(QObject *, QEvent *) override; QPointer<QAction> action; static void say(QWidget *, const QString &, int x = 0, int y = 0); static void notifyToplevels(QEvent *e); diff --git a/src/widgets/kernel/qwhatsthis.h b/src/widgets/kernel/qwhatsthis.h index 3211796d3e..1f0f82b2a2 100644 --- a/src/widgets/kernel/qwhatsthis.h +++ b/src/widgets/kernel/qwhatsthis.h @@ -59,10 +59,10 @@ public: static bool inWhatsThisMode(); static void leaveWhatsThisMode(); - static void showText(const QPoint &pos, const QString &text, QWidget *w = Q_NULLPTR); + static void showText(const QPoint &pos, const QString &text, QWidget *w = nullptr); static void hideText(); - static QAction *createAction(QObject *parent = Q_NULLPTR); + static QAction *createAction(QObject *parent = nullptr); }; diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 3369548f18..6a633fb575 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2017 The Qt Company Ltd. ** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** @@ -1169,7 +1169,7 @@ void QWidgetPrivate::init(QWidget *parentWidget, Qt::WindowFlags f) if (targetScreen >= 0) { topData()->initialScreenIndex = targetScreen; if (QWindow *window = q->windowHandle()) - window->setScreen(QGuiApplication::screens().value(targetScreen, Q_NULLPTR)); + window->setScreen(QGuiApplication::screens().value(targetScreen, nullptr)); } data.fstrut_dirty = true; @@ -1461,7 +1461,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO screenNumber = q->windowType() != Qt::Desktop ? QDesktopWidgetPrivate::screenNumber(q) : 0; } - win->setScreen(QGuiApplication::screens().value(screenNumber, Q_NULLPTR)); + win->setScreen(QGuiApplication::screens().value(screenNumber, nullptr)); } QSurfaceFormat format = win->requestedFormat(); @@ -1502,7 +1502,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO QBackingStore *store = q->backingStore(); if (!store) { - if (win && q->windowType() != Qt::Desktop) { + if (q->windowType() != Qt::Desktop) { if (q->isTopLevel()) q->setBackingStore(new QBackingStore(win)); } else { @@ -7903,7 +7903,7 @@ void QWidgetPrivate::show_helper() const bool isWindow = q->isWindow(); #if QT_CONFIG(graphicsview) - bool isEmbedded = isWindow && q->graphicsProxyWidget() != Q_NULLPTR; + bool isEmbedded = isWindow && q->graphicsProxyWidget() != nullptr; #else bool isEmbedded = false; #endif @@ -12458,7 +12458,7 @@ static inline bool canMapPosition(QWindow *window) #if QT_CONFIG(graphicsview) static inline QGraphicsProxyWidget *graphicsProxyWidget(const QWidget *w) { - QGraphicsProxyWidget *result = Q_NULLPTR; + QGraphicsProxyWidget *result = nullptr; const QWidgetPrivate *d = qt_widget_private(const_cast<QWidget *>(w)); if (d->extra) result = d->extra->proxyWidget; @@ -12474,7 +12474,7 @@ struct MapToGlobalTransformResult { static MapToGlobalTransformResult mapToGlobalTransform(const QWidget *w) { MapToGlobalTransformResult result; - result.window = Q_NULLPTR; + result.window = nullptr; for ( ; w ; w = w->parentWidget()) { #if QT_CONFIG(graphicsview) if (QGraphicsProxyWidget *qgpw = graphicsProxyWidget(w)) { diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h index 732af4de09..5087d330ee 100644 --- a/src/widgets/kernel/qwidget.h +++ b/src/widgets/kernel/qwidget.h @@ -211,10 +211,10 @@ public: }; Q_DECLARE_FLAGS(RenderFlags, RenderFlag) - explicit QWidget(QWidget* parent = Q_NULLPTR, Qt::WindowFlags f = Qt::WindowFlags()); + explicit QWidget(QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); ~QWidget(); - int devType() const Q_DECL_OVERRIDE; + int devType() const override; WId winId() const; void createWinId(); // internal, going away @@ -578,7 +578,7 @@ public: void setAttribute(Qt::WidgetAttribute, bool on = true); inline bool testAttribute(Qt::WidgetAttribute) const; - QPaintEngine *paintEngine() const Q_DECL_OVERRIDE; + QPaintEngine *paintEngine() const override; void ensurePolished() const; @@ -596,7 +596,7 @@ public: QWindow *windowHandle() const; - static QWidget *createWindowContainer(QWindow *window, QWidget *parent=Q_NULLPTR, Qt::WindowFlags flags=Qt::WindowFlags()); + static QWidget *createWindowContainer(QWindow *window, QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::WindowFlags()); friend class QDesktopScreenWidget; @@ -608,7 +608,7 @@ Q_SIGNALS: protected: // Event handlers - bool event(QEvent *event) Q_DECL_OVERRIDE; + bool event(QEvent *event) override; virtual void mousePressEvent(QMouseEvent *event); virtual void mouseReleaseEvent(QMouseEvent *event); virtual void mouseDoubleClickEvent(QMouseEvent *event); @@ -650,10 +650,10 @@ protected: // Misc. protected functions virtual void changeEvent(QEvent *); - int metric(PaintDeviceMetric) const Q_DECL_OVERRIDE; - void initPainter(QPainter *painter) const Q_DECL_OVERRIDE; - QPaintDevice *redirected(QPoint *offset) const Q_DECL_OVERRIDE; - QPainter *sharedPainter() const Q_DECL_OVERRIDE; + int metric(PaintDeviceMetric) const override; + void initPainter(QPainter *painter) const override; + QPaintDevice *redirected(QPoint *offset) const override; + QPainter *sharedPainter() const override; virtual void inputMethodEvent(QInputMethodEvent *); public: @@ -738,12 +738,12 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QWidget::RenderFlags) #ifndef Q_QDOC template <> inline QWidget *qobject_cast<QWidget*>(QObject *o) { - if (!o || !o->isWidgetType()) return Q_NULLPTR; + if (!o || !o->isWidgetType()) return nullptr; return static_cast<QWidget*>(o); } template <> inline const QWidget *qobject_cast<const QWidget*>(const QObject *o) { - if (!o || !o->isWidgetType()) return Q_NULLPTR; + if (!o || !o->isWidgetType()) return nullptr; return static_cast<const QWidget*>(o); } #endif // !Q_QDOC diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h index 4a86f87c71..26f8b53392 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -903,26 +903,26 @@ public: : QGraphicsEffectSourcePrivate(), m_widget(widget), context(0), updateDueToGraphicsEffect(false) {} - void detach() Q_DECL_OVERRIDE + void detach() override { m_widget->d_func()->graphicsEffect = 0; } - const QGraphicsItem *graphicsItem() const Q_DECL_OVERRIDE + const QGraphicsItem *graphicsItem() const override { return 0; } - const QWidget *widget() const Q_DECL_OVERRIDE + const QWidget *widget() const override { return m_widget; } - void update() Q_DECL_OVERRIDE + void update() override { updateDueToGraphicsEffect = true; m_widget->update(); updateDueToGraphicsEffect = false; } - bool isPixmap() const Q_DECL_OVERRIDE + bool isPixmap() const override { return false; } - void effectBoundingRectChanged() Q_DECL_OVERRIDE + void effectBoundingRectChanged() override { // ### This function should take a rect parameter; then we can avoid // updating too much on the parent widget. @@ -932,16 +932,16 @@ public: update(); } - const QStyleOption *styleOption() const Q_DECL_OVERRIDE + const QStyleOption *styleOption() const override { return 0; } - QRect deviceRect() const Q_DECL_OVERRIDE + QRect deviceRect() const override { return m_widget->window()->rect(); } - QRectF boundingRect(Qt::CoordinateSystem system) const Q_DECL_OVERRIDE; - void draw(QPainter *p) Q_DECL_OVERRIDE; + QRectF boundingRect(Qt::CoordinateSystem system) const override; + void draw(QPainter *p) override; QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset, - QGraphicsEffect::PixmapPadMode mode) const Q_DECL_OVERRIDE; + QGraphicsEffect::PixmapPadMode mode) const override; QWidget *m_widget; QWidgetPaintContext *context; diff --git a/src/widgets/kernel/qwidgetaction.h b/src/widgets/kernel/qwidgetaction.h index 3da691a430..4769332a23 100644 --- a/src/widgets/kernel/qwidgetaction.h +++ b/src/widgets/kernel/qwidgetaction.h @@ -66,8 +66,8 @@ public: void releaseWidget(QWidget *widget); protected: - virtual bool event(QEvent *) Q_DECL_OVERRIDE; - virtual bool eventFilter(QObject *, QEvent *) Q_DECL_OVERRIDE; + virtual bool event(QEvent *) override; + virtual bool eventFilter(QObject *, QEvent *) override; virtual QWidget *createWidget(QWidget *parent); virtual void deleteWidget(QWidget *widget); QList<QWidget *> createdWidgets() const; diff --git a/src/widgets/kernel/qwidgetbackingstore.cpp b/src/widgets/kernel/qwidgetbackingstore.cpp index 52080fe05f..3b093283cd 100644 --- a/src/widgets/kernel/qwidgetbackingstore.cpp +++ b/src/widgets/kernel/qwidgetbackingstore.cpp @@ -1058,7 +1058,7 @@ static QPlatformTextureList *widgetTexturesFor(QWidget *tlw, QWidget *widget) { Q_UNUSED(tlw); Q_UNUSED(widget); - return Q_NULLPTR; + return nullptr; } #endif // QT_NO_OPENGL diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index d8d6eab7b1..ac32c32e12 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -78,7 +78,7 @@ public: QWindowPrivate::setVisible(visible); } - QWindow *eventReceiver() Q_DECL_OVERRIDE { + QWindow *eventReceiver() override { Q_Q(QWidgetWindow); QWindow *w = q; while (w->parent() && qobject_cast<QWidgetWindow *>(w) && qobject_cast<QWidgetWindow *>(w->parent())) { @@ -87,7 +87,7 @@ public: return w; } - void clearFocusObject() Q_DECL_OVERRIDE + void clearFocusObject() override { Q_Q(QWidgetWindow); QWidget *widget = q->widget(); @@ -95,7 +95,7 @@ public: widget->focusWidget()->clearFocus(); } - QRectF closestAcceptableGeometry(const QRectF &rect) const Q_DECL_OVERRIDE; + QRectF closestAcceptableGeometry(const QRectF &rect) const override; #if QT_CONFIG(opengl) QOpenGLContext *shareContext() const override; #endif @@ -171,7 +171,7 @@ QObject *QWidgetWindow::focusObject() const { QWidget *windowWidget = m_widget; if (!windowWidget) - return Q_NULLPTR; + return nullptr; // A window can't have a focus object if it's being destroyed. if (QWidgetPrivate::get(windowWidget)->data.in_destructor) @@ -422,7 +422,7 @@ void QWidgetWindow::handleEnterLeaveEvent(QEvent *event) const QEnterEvent *ee = static_cast<QEnterEvent *>(event); QWidget *child = m_widget->childAt(ee->pos()); QWidget *receiver = child ? child : m_widget.data(); - QWidget *leave = Q_NULLPTR; + QWidget *leave = nullptr; if (QApplicationPrivate::inPopupMode() && receiver == m_widget && qt_last_mouse_receiver != m_widget) { // This allows to deliver the leave event to the native widget @@ -529,11 +529,11 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) // Prevent negative mouse position on enter event - this event // should be properly handled in "handleEnterLeaveEvent()". if (receiverMapped.x() >= 0 && receiverMapped.y() >= 0) { - QApplicationPrivate::dispatchEnterLeave(receiver, Q_NULLPTR, event->screenPos()); + QApplicationPrivate::dispatchEnterLeave(receiver, nullptr, event->screenPos()); qt_last_mouse_receiver = receiver; } } else { - QApplicationPrivate::dispatchEnterLeave(Q_NULLPTR, qt_last_mouse_receiver, event->screenPos()); + QApplicationPrivate::dispatchEnterLeave(nullptr, qt_last_mouse_receiver, event->screenPos()); qt_last_mouse_receiver = receiver; receiver = activePopupWidget; } @@ -637,12 +637,9 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) QWidget *receiver = QApplicationPrivate::pickMouseReceiver(m_widget, event->windowPos().toPoint(), &mapped, event->type(), event->buttons(), qt_button_down, widget); - - if (!receiver) { - if (event->type() == QEvent::MouseButtonRelease) - QApplicationPrivate::mouse_buttons &= ~event->button(); + if (!receiver) return; - } + if ((event->type() != QEvent::MouseButtonPress) || !(event->flags().testFlag(Qt::MouseEventCreatedDoubleClick))) { diff --git a/src/widgets/kernel/qwidgetwindow_p.h b/src/widgets/kernel/qwidgetwindow_p.h index be3f808a22..d0f1d55c2a 100644 --- a/src/widgets/kernel/qwidgetwindow_p.h +++ b/src/widgets/kernel/qwidgetwindow_p.h @@ -75,13 +75,13 @@ public: QWidget *widget() const { return m_widget; } #ifndef QT_NO_ACCESSIBILITY - QAccessibleInterface *accessibleRoot() const Q_DECL_OVERRIDE; + QAccessibleInterface *accessibleRoot() const override; #endif - QObject *focusObject() const Q_DECL_OVERRIDE; + QObject *focusObject() const override; void setNativeWindowVisibility(bool visible); protected: - bool event(QEvent *) Q_DECL_OVERRIDE; + bool event(QEvent *) override; void handleCloseEvent(QCloseEvent *); void handleEnterLeaveEvent(QEvent *); @@ -102,7 +102,7 @@ protected: #endif void handleExposeEvent(QExposeEvent *); void handleWindowStateChangedEvent(QWindowStateChangeEvent *event); - bool nativeEvent(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE; + bool nativeEvent(const QByteArray &eventType, void *message, long *result) override; #if QT_CONFIG(tabletevent) void handleTabletEvent(QTabletEvent *); #endif diff --git a/src/widgets/kernel/qwindowcontainer_p.h b/src/widgets/kernel/qwindowcontainer_p.h index 1d838c8dd6..a8754232a8 100644 --- a/src/widgets/kernel/qwindowcontainer_p.h +++ b/src/widgets/kernel/qwindowcontainer_p.h @@ -75,7 +75,7 @@ public: static void parentWasLowered(QWidget *parent); protected: - bool event(QEvent *ev) Q_DECL_OVERRIDE; + bool event(QEvent *ev) override; private slots: void focusWindowChanged(QWindow *focusWindow); |