From e6dd52f83611625b1b2087ed70417ee3e5c4e826 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 10 Oct 2016 10:02:40 +0200 Subject: [PATCH] Clean up QFbCursor Task-number: QTBUG-56306 Change-Id: If0cccbf20d4956c19622651864f42f854247b54b Reviewed-by: Andy Nichols --- .../fbconvenience/qfbcursor.cpp | 18 +++++++++--------- .../fbconvenience/qfbcursor_p.h | 11 +++++------ 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/platformsupport/fbconvenience/qfbcursor.cpp b/src/platformsupport/fbconvenience/qfbcursor.cpp index 004c586de3..7daf3f4d0c 100644 --- a/src/platformsupport/fbconvenience/qfbcursor.cpp +++ b/src/platformsupport/fbconvenience/qfbcursor.cpp @@ -60,8 +60,8 @@ QFbCursor::QFbCursor(QFbScreen *screen) mScreen(screen), mDirty(false), mOnScreen(false), - mGraphic(0), - mDeviceListener(0) + mCursorImage(nullptr), + mDeviceListener(nullptr) { QByteArray hideCursorVal = qgetenv("QT_QPA_FB_HIDECURSOR"); if (!hideCursorVal.isEmpty()) @@ -69,7 +69,7 @@ QFbCursor::QFbCursor(QFbScreen *screen) if (!mVisible) return; - mGraphic = new QPlatformCursorImage(0, 0, 0, 0, 0, 0); + mCursorImage = new QPlatformCursorImage(0, 0, 0, 0, 0, 0); setCursor(Qt::ArrowCursor); mDeviceListener = new QFbCursorDeviceListener(this); @@ -85,8 +85,8 @@ QFbCursor::~QFbCursor() QRect QFbCursor::getCurrentRect() { - QRect rect = mGraphic->image()->rect().translated(-mGraphic->hotspot().x(), - -mGraphic->hotspot().y()); + QRect rect = mCursorImage->image()->rect().translated(-mCursorImage->hotspot().x(), + -mCursorImage->hotspot().y()); rect.translate(m_pos); QPoint mScreenOffset = mScreen->geometry().topLeft(); rect.translate(-mScreenOffset); // global to local translation @@ -133,7 +133,7 @@ QRect QFbCursor::drawCursor(QPainter & painter) return QRect(); mPrevRect = mCurrentRect; - painter.drawImage(mPrevRect, *mGraphic->image()); + painter.drawImage(mPrevRect, *mCursorImage->image()); mOnScreen = true; return mPrevRect; } @@ -149,17 +149,17 @@ QRect QFbCursor::dirtyRect() void QFbCursor::setCursor(Qt::CursorShape shape) { - mGraphic->set(shape); + mCursorImage->set(shape); } void QFbCursor::setCursor(const QImage &image, int hotx, int hoty) { - mGraphic->set(image, hotx, hoty); + mCursorImage->set(image, hotx, hoty); } void QFbCursor::setCursor(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY) { - mGraphic->set(data, mask, width, height, hotX, hotY); + mCursorImage->set(data, mask, width, height, hotX, hotY); } #ifndef QT_NO_CURSOR diff --git a/src/platformsupport/fbconvenience/qfbcursor_p.h b/src/platformsupport/fbconvenience/qfbcursor_p.h index f08babd45b..beda10a5f3 100644 --- a/src/platformsupport/fbconvenience/qfbcursor_p.h +++ b/src/platformsupport/fbconvenience/qfbcursor_p.h @@ -87,11 +87,11 @@ public: virtual QRect drawCursor(QPainter &painter); // input methods - void pointerEvent(const QMouseEvent &event) Q_DECL_OVERRIDE; - QPoint pos() const Q_DECL_OVERRIDE; - void setPos(const QPoint &pos) Q_DECL_OVERRIDE; + void pointerEvent(const QMouseEvent &event) override; + QPoint pos() const override; + void setPos(const QPoint &pos) override; #ifndef QT_NO_CURSOR - void changeCursor(QCursor *widgetCursor, QWindow *window) Q_DECL_OVERRIDE; + void changeCursor(QCursor *widgetCursor, QWindow *window) override; #endif virtual void setDirty(); @@ -113,7 +113,7 @@ private: QRect mPrevRect; // last place the cursor was drawn bool mDirty; bool mOnScreen; - QPlatformCursorImage *mGraphic; + QPlatformCursorImage *mCursorImage; QFbCursorDeviceListener *mDeviceListener; QPoint m_pos; }; @@ -121,4 +121,3 @@ private: QT_END_NAMESPACE #endif // QFBCURSOR_P_H -