6#include <QtGui/QPainter>
7#include <QtGui/private/qguiapplication_p.h>
30 const char *envVar =
"QT_QPA_FB_HIDECURSOR";
47 delete mDeviceListener;
50QRect QFbCursor::getCurrentRect()
const
54 rect.translate(m_pos);
56 rect.translate(-mScreenOffset);
71 mCurrentRect = getCurrentRect();
80 m_pos =
e.globalPosition().toPoint();
83 mCurrentRect = getCurrentRect();
103 mPrevRect = mCurrentRect;
121 mCursorImage->
set(shape);
124void QFbCursor::setCursor(
const QImage &
image,
int hotx,
int hoty)
127 mCursorImage->
set(
image, hotx, hoty);
152 mCurrentRect = getCurrentRect();
172 mVisible = mDeviceListener ? mDeviceListener->
hasMouse() :
false;
178#include "moc_qfbcursor_p.cpp"
The QCursor class provides a mouse cursor with an arbitrary shape.
QPixmap pixmap() const
Returns the cursor pixmap.
Qt::CursorShape shape() const
Returns the cursor shape identifier.
QPoint hotSpot() const
Returns the cursor hot spot, or (0, 0) if it is one of the standard cursors.
void onDeviceListChanged(QInputDeviceManager::DeviceType type)
void setPos(const QPoint &pos) override
QPoint pos() const override
void pointerEvent(const QMouseEvent &event) override
This method is called by Qt whenever a QMouseEvent is generated by the underlying pointer input.
QFbCursor(QFbScreen *screen)
virtual QRect lastPainted() const
virtual QRect drawCursor(QPainter &painter)
void changeCursor(QCursor *widgetCursor, QWindow *window) override
This method is called by Qt whenever the cursor graphic should be changed.
QRect geometry() const override
Reimplement in subclass to return the pixel geometry of the screen.
virtual void setDirty(const QRect &rect)
static QInputDeviceManager * inputDeviceManager()
QRect rect() const
Returns the enclosing rectangle (0, 0, width(), height()) of the image.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
The QPainter class performs low-level painting on widgets and other paint devices.
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
Draws the rectangular portion source of the given image into the target rectangle in the paint device...
QImage toImage() const
Converts the pixmap to a QImage.
\inmodule QtCore\reentrant
constexpr int x() const noexcept
Returns the x coordinate of this point.
constexpr int y() const noexcept
Returns the y coordinate of this point.
\inmodule QtCore\reentrant
bool intersects(const QRect &r) const noexcept
Returns true if this rectangle intersects with the given rectangle (i.e., there is at least one pixel...
constexpr bool isNull() const noexcept
Returns true if the rectangle is a null rectangle, otherwise returns false.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr QRect translated(int dx, int dy) const noexcept
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis,...
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
Deletes the existing object it is pointing to (if any), and sets its pointer to other.
Combined button and popup list for selecting options.
GLint GLsizei GLsizei height
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) noexcept
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept