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
QPlatformCursorImage Class Reference

The QPlatformCursorImage class provides a set of graphics intended to be used as cursors. More...

#include <qplatformcursor.h>

+ Collaboration diagram for QPlatformCursorImage:

Public Member Functions

 QPlatformCursorImage (const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY)
 Sets the cursor image to the graphic represented by the combination of data and mask, with dimensions given by width and height and a hotspot at the point specified by (hotX, hotY).
 
QImageimage ()
 Return the cursor graphic as a pointer to a QImage.
 
QPoint hotspot () const
 Return the cursor's hotspot.
 
void set (const uchar *data, const uchar *mask, int width, int height, int hotX, int hotY)
 Sets the cursor image to the graphic represented by the combination of data and mask, with dimensions given by width and height and a hotspot at the point specified by (hx, hy).
 
void set (const QImage &image, int hx, int hy)
 Sets the cursor image to the given image, with the hotspot at the point specified by (hx, hy).
 
void set (Qt::CursorShape)
 Calling this method sets the cursor image to the specified shape.
 

Detailed Description

The QPlatformCursorImage class provides a set of graphics intended to be used as cursors.

Since
5.0

\preliminary

See also
QPlatformCursor

Definition at line 28 of file qplatformcursor.h.

Constructor & Destructor Documentation

◆ QPlatformCursorImage()

QPlatformCursorImage::QPlatformCursorImage ( const uchar * data,
const uchar * mask,
int width,
int height,
int hotX,
int hotY )
inline

Sets the cursor image to the graphic represented by the combination of data and mask, with dimensions given by width and height and a hotspot at the point specified by (hotX, hotY).

See also
set()

Definition at line 30 of file qplatformcursor.h.

References set.

Member Function Documentation

◆ hotspot()

QPoint QPlatformCursorImage::hotspot ( ) const
inline

Return the cursor's hotspot.

Definition at line 33 of file qplatformcursor.h.

Referenced by QDirectFBCursor::changeCursor(), and QEglFSKmsGbmCursor::setPos().

+ Here is the caller graph for this function:

◆ image()

QImage * QPlatformCursorImage::image ( )
inline

Return the cursor graphic as a pointer to a QImage.

Definition at line 32 of file qplatformcursor.h.

Referenced by QDirectFBCursor::changeCursor(), QEglFSKmsGbmCursor::changeCursor(), QFbCursor::drawCursor(), and set().

+ Here is the caller graph for this function:

◆ set() [1/3]

void QPlatformCursorImage::set ( const QImage & image,
int hx,
int hy )

Sets the cursor image to the given image, with the hotspot at the point specified by (hx, hy).

Definition at line 544 of file qplatformcursor.cpp.

References image(), QPoint::setX(), and QPoint::setY().

+ Here is the call graph for this function:

◆ set() [2/3]

void QPlatformCursorImage::set ( const uchar * data,
const uchar * mask,
int width,
int height,
int hx,
int hy )

Sets the cursor image to the graphic represented by the combination of data and mask, with dimensions given by width and height and a hotspot at the point specified by (hx, hy).

The image data specified by data must be supplied in the format described by QImage::Format_Indexed8.

The corresponding mask data specified by mask must be supplied in a character array containing packed 1 bit per pixel format data, with any padding bits at the end of the array. Bits of value 0 represent transparent pixels in the image data.

Definition at line 566 of file qplatformcursor.cpp.

References QImage::bits(), QImage::bytesPerLine(), d, QImage::Format_Indexed8, i, QImage::isNull(), j, QImage::setColor(), QImage::setColorCount(), QPoint::setX(), and QPoint::setY().

Referenced by QDirectFBCursor::changeCursor(), and QEglFSKmsGbmCursor::changeCursor().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set() [3/3]

void QPlatformCursorImage::set ( Qt::CursorShape id)

Calling this method sets the cursor image to the specified shape.

id is one of the defined Qt::CursorShape values.

If id is invalid, Qt::BitmapCursor, or unknown by the implementation, Qt::ArrowCursor is used instead.

Definition at line 521 of file qplatformcursor.cpp.

References Qt::ArrowCursor, cursor, Qt::LastCursor, and systemCursorTable.


The documentation for this class was generated from the following files: