From a8127d610268d1b8aec35cee68a4efc45996f6c3 Mon Sep 17 00:00:00 2001 From: "Vladimir Golovnev (Glassez)" Date: Thu, 18 Mar 2021 10:43:07 +0300 Subject: [PATCH] Use valid event type in QWidget::enterEvent() --- src/gui/properties/piecesbar.cpp | 4 ++++ src/gui/properties/piecesbar.h | 14 +++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/gui/properties/piecesbar.cpp b/src/gui/properties/piecesbar.cpp index d9da364cb..0c9a253e1 100644 --- a/src/gui/properties/piecesbar.cpp +++ b/src/gui/properties/piecesbar.cpp @@ -143,7 +143,11 @@ bool PiecesBar::event(QEvent *e) return base::event(e); } +#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) +void PiecesBar::enterEvent(QEnterEvent *e) +#else void PiecesBar::enterEvent(QEvent *e) +#endif { m_hovered = true; base::enterEvent(e); diff --git a/src/gui/properties/piecesbar.h b/src/gui/properties/piecesbar.h index 66f2f3074..ec70aab6c 100644 --- a/src/gui/properties/piecesbar.h +++ b/src/gui/properties/piecesbar.h @@ -54,15 +54,19 @@ public: virtual void clear(); // QObject interface - virtual bool event(QEvent*) override; + virtual bool event(QEvent *e) override; protected: // QWidget interface - void enterEvent(QEvent*) override; - void leaveEvent(QEvent*) override; - void mouseMoveEvent(QMouseEvent*) override; +#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) + void enterEvent(QEnterEvent *e) override; +#else + void enterEvent(QEvent *e) override; +#endif + void leaveEvent(QEvent *e) override; + void mouseMoveEvent(QMouseEvent *e) override; - void paintEvent(QPaintEvent*) override; + void paintEvent(QPaintEvent *e) override; void requestImageUpdate(); QColor backgroundColor() const;