11#include <private/qcursor_p.h>
14#include <qpa/qplatformcursor.h>
15#include <private/qguiapplication_p.h>
16#include <private/qhighdpiscaling_p.h>
269#ifndef QT_NO_DATASTREAM
285 bool isPixmap =
false;
286 if (
s.version() >= 7) {
287 isPixmap = !
c.pixmap().isNull();
293 s <<
c.bitmap() <<
c.mask();
313 bool isPixmap =
false;
314 if (
s.version() >= 7)
324 s >> bm >> bmm >> hot;
471 && lhs.hotSpot() == rhs.hotSpot()) {
472 if (!lhs.d->pixmap.isNull())
473 return lhs.d->pixmap.cacheKey() == rhs.d->pixmap.cacheKey();
475 if (!rhs.d->pixmap.isNull())
478 return lhs.d->bm->cacheKey() == rhs.d->bm->cacheKey()
479 && lhs.d->bmm->cacheKey() == rhs.d->bmm->cacheKey();
656#ifndef QT_NO_DEBUG_STREAM
660 dbg.nospace() <<
"QCursor(Qt::CursorShape(" <<
c.shape() <<
"))";
713 qWarning(
"QCursor: Cannot create bitmap cursor; invalid bitmap(s)");
722 d->hx = hotX >= 0 ? hotX :
bitmap.width() / 2 / devicePixelRatio;
723 d->hy = hotY >= 0 ? hotY :
bitmap.height() / 2 / devicePixelRatio;
static QBitmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Returns a copy of the given image converted to a bitmap using the specified image conversion flags.
static bool startingUp()
Returns true if an application object has not been created yet; otherwise returns false.
QCursorData(Qt::CursorShape s=Qt::ArrowCursor)
static QCursorData * setBitmap(const QBitmap &bitmap, const QBitmap &mask, int hotX, int hotY, qreal devicePixelRatio)
The QCursor class provides a mouse cursor with an arbitrary shape.
QBitmap bitmap() const
Returns the cursor bitmap, or a null bitmap if it is one of the standard cursors.
QPixmap pixmap() const
Returns the cursor pixmap.
~QCursor()
Destroys the cursor.
static void setPos(int x, int y)
Moves the cursor (hot spot) of the primary screen to the global screen position (x,...
Qt::CursorShape shape() const
Returns the cursor shape identifier.
static QPoint pos()
Returns the position of the cursor (hot spot) of the primary screen in global screen coordinates.
QCursor & operator=(const QCursor &cursor)
Move-assigns other to this QCursor instance.
QCursor()
Constructs a cursor with the default arrow shape.
QPoint hotSpot() const
Returns the cursor hot spot, or (0, 0) if it is one of the standard cursors.
void setShape(Qt::CursorShape newShape)
Sets the cursor to the shape identified by shape.
QBitmap mask() const
Returns the cursor bitmap mask, or a null bitmap if it is one of the standard cursors.
\inmodule QtCore\reentrant
static struct QGuiApplicationPrivate::QLastCursorPosition lastCursorPosition
QScreen * primaryScreen
the primary (or default) screen of the application.
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const &
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
QImage toImage() const
Converts the pixmap to a QImage.
QSize size() const
Returns the size of the pixmap.
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
QBitmap mask() const
Returns true if this pixmap has an alpha channel, or has a mask, otherwise returns false.
void setMask(const QBitmap &)
Sets a mask bitmap.
void fill(const QColor &fillColor=Qt::white)
Fills the pixmap with the given color.
qreal devicePixelRatio() const
Returns the device pixel ratio for the pixmap.
\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.
The QScreen class is used to query screen properties. \inmodule QtGui.
QScreen * virtualSiblingAt(QPoint point)
Returns the screen at point within the set of \l QScreen::virtualSiblings(), or nullptr if outside of...
QPlatformScreen * handle() const
Get the platform screen handle.
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
T toNativePixels(const T &value, const C *context)
T fromNativePixels(const T &value, const C *context)
Combined button and popup list for selecting options.
QCursorData * qt_cursorTable[Qt::LastCursor+1]
QDataStream & operator<<(QDataStream &s, const QCursor &c)
bool operator==(const QCursor &lhs, const QCursor &rhs) noexcept
QDataStream & operator>>(QDataStream &s, QCursor &c)
QCursorData * qt_cursorTable[Qt::LastCursor+1]
GLint GLint GLint GLint GLint x
[0]
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLsizei GLfixed GLfixed GLfixed GLfixed const GLubyte * bitmap
Q_GUI_EXPORT QPoint toPoint() const noexcept