Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qfbcursor_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QFBCURSOR_P_H
5#define QFBCURSOR_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <qpa/qplatformcursor.h>
19#include <QtGui/private/qinputdevicemanager_p.h>
20
22
23class QFbScreen;
24class QFbCursor;
25
27{
29
30public:
32 bool hasMouse() const;
33
34public slots:
36
37private:
38 QFbCursor *m_cursor;
39};
40
42{
44
45public:
47 ~QFbCursor();
48
49 // output methods
52
53 // input methods
54 void pointerEvent(const QMouseEvent &event) override;
55 QPoint pos() const override;
56 void setPos(const QPoint &pos) override;
57#ifndef QT_NO_CURSOR
58 void changeCursor(QCursor *widgetCursor, QWindow *window) override;
59#endif
60
61 virtual void setDirty();
62 virtual bool isDirty() const { return mDirty; }
63 virtual bool isOnScreen() const { return mOnScreen; }
64 virtual QRect lastPainted() const { return mPrevRect; }
65
66 void updateMouseStatus();
67
68private:
69 void setCursor(const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY);
70 void setCursor(Qt::CursorShape shape);
71 void setCursor(const QImage &image, int hotx, int hoty);
72 QRect getCurrentRect() const;
73
74 bool mVisible;
75 QFbScreen *mScreen;
76 QRect mCurrentRect; // next place to draw the cursor
77 QRect mPrevRect; // last place the cursor was drawn
78 bool mDirty;
79 bool mOnScreen;
80 QScopedPointer<QPlatformCursorImage> mCursorImage;
81 QFbCursorDeviceListener *mDeviceListener;
82 QPoint m_pos;
83};
84
86
87#endif // QFBCURSOR_P_H
The QCursor class provides a mouse cursor with an arbitrary shape.
Definition qcursor.h:45
void onDeviceListChanged(QInputDeviceManager::DeviceType type)
Definition qfbcursor.cpp:16
QFbCursorDeviceListener(QFbCursor *cursor)
Definition qfbcursor_p.h:31
void setPos(const QPoint &pos) override
Definition qfbcursor.cpp:65
virtual bool isOnScreen() const
Definition qfbcursor_p.h:63
QPoint pos() const override
Definition qfbcursor.cpp:60
virtual void setDirty()
QRect dirtyRect()
void updateMouseStatus()
void pointerEvent(const QMouseEvent &event) override
This method is called by Qt whenever a QMouseEvent is generated by the underlying pointer input.
Definition qfbcursor.cpp:76
QFbCursor(QFbScreen *screen)
Definition qfbcursor.cpp:22
virtual QRect lastPainted() const
Definition qfbcursor_p.h:64
virtual QRect drawCursor(QPainter &painter)
Definition qfbcursor.cpp:88
void changeCursor(QCursor *widgetCursor, QWindow *window) override
This method is called by Qt whenever the cursor graphic should be changed.
virtual bool isDirty() const
Definition qfbcursor_p.h:62
\inmodule QtGui
Definition qimage.h:37
\inmodule QtGui
Definition qevent.h:196
\inmodule QtCore
Definition qobject.h:103
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
The QPlatformCursor class provides information about pointer device events (movement,...
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore\reentrant
Definition qrect.h:30
\inmodule QtGui
Definition qwindow.h:63
QCursor cursor
Combined button and popup list for selecting options.
CursorShape
Definition image.cpp:4
GLint GLsizei GLsizei height
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLsizei width
GLenum type
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
struct _cl_event * event
QScreen * screen
[1]
Definition main.cpp:29
#define Q_OBJECT
#define slots
unsigned char uchar
Definition qtypes.h:32
QPainter painter(this)
[7]
aWidget window() -> setWindowTitle("New Window Title")
[2]