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
qwindowscursor.cpp File Reference

(af0edfbc7c33261d11b559cb4842045457adc4a1)

#include "qwindowscursor.h"
#include "qwindowscontext.h"
#include "qwindowswindow.h"
#include "qwindowsscreen.h"
#include <QtGui/qbitmap.h>
#include <QtGui/qimage.h>
#include <QtGui/qguiapplication.h>
#include <QtGui/qscreen.h>
#include <QtGui/private/qguiapplication_p.h>
#include <QtGui/private/qhighdpiscaling_p.h>
#include <QtGui/private/qpixmap_win_p.h>
#include <QtCore/private/qwinregistry_p.h>
#include <QtCore/qdebug.h>
#include <QtCore/qscopedpointer.h>
+ Include dependency graph for qwindowscursor.cpp:

Go to the source code of this file.

Classes

struct  QWindowsStandardCursorMapping
 

Functions

static bool initResources ()
 
static HCURSOR createBitmapCursor (const QImage &bbits, const QImage &mbits, QPoint hotSpot=QPoint(-1, -1), bool invb=false, bool invm=false)
 
static HCURSOR createBitmapCursor (const QCursor &cursor, qreal scaleFactor=1)
 
static QSize systemCursorSize ()
 
static QSize screenCursorSize (const QPlatformScreen *screen=nullptr)
 
static QSize standardCursorSize ()
 
static QWindowsCursor::PixmapCursor createPixmapCursorFromData (const QSize &screenCursorSize, const QSize &bitmapTargetCursorSize, int bitmapSize, const uchar *bits, const uchar *maskBits)
 

Function Documentation

◆ createBitmapCursor() [1/2]

static HCURSOR createBitmapCursor ( const QCursor & cursor,
qreal scaleFactor = 1 )
static

Definition at line 139 of file qwindowscursor.cpp.

References QCursor::bitmap(), Qt::BitmapCursor, createBitmapCursor(), cursor, QImage::devicePixelRatio(), QImage::Format_Mono, QCursor::hotSpot(), QPixmap::isNull(), Qt::KeepAspectRatio, QCursor::mask(), Q_ASSERT, qFuzzyCompare(), qGray(), QSize::scaled(), QCursor::shape(), Qt::SmoothTransformation, and QPixmap::toImage().

+ Here is the call graph for this function:

◆ createBitmapCursor() [2/2]

static HCURSOR createBitmapCursor ( const QImage & bbits,
const QImage & mbits,
QPoint hotSpot = QPoint(-1, -1),
bool invb = false,
bool invm = false )
static

Definition at line 98 of file qwindowscursor.cpp.

References i, j, and qMax().

Referenced by createBitmapCursor(), QWindowsCursor::createCursorFromShape(), and QWindowsCursor::pixmapWindowCursor().

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

◆ createPixmapCursorFromData()

static QWindowsCursor::PixmapCursor createPixmapCursorFromData ( const QSize & screenCursorSize,
const QSize & bitmapTargetCursorSize,
int bitmapSize,
const uchar * bits,
const uchar * maskBits )
static

Definition at line 187 of file qwindowscursor.cpp.

References QBitmap::fromData(), QPixmap::fromImage(), QTransform::fromScale(), qAbs(), screenCursorSize(), and Qt::SmoothTransformation.

Referenced by QWindowsCursor::customCursor().

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

◆ initResources()

static bool initResources ( )
static

Definition at line 23 of file qwindowscursor.cpp.

References Q_INIT_RESOURCE.

◆ screenCursorSize()

static QSize screenCursorSize ( const QPlatformScreen * screen = nullptr)
static

Definition at line 159 of file qwindowscursor.cpp.

References QPlatformScreen::logicalDpi(), QGuiApplication::primaryScreen, qFuzzyCompare(), screen, and systemCursorSize().

Referenced by createPixmapCursorFromData(), QWindowsCursor::customCursor(), and QWindowsCursor::size().

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

◆ standardCursorSize()

static QSize standardCursorSize ( )
inlinestatic

Definition at line 180 of file qwindowscursor.cpp.

Referenced by QWindowsCursor::customCursor().

+ Here is the caller graph for this function:

◆ systemCursorSize()

static QSize systemCursorSize ( )
static

Definition at line 157 of file qwindowscursor.cpp.

Referenced by QWindowsCursor::createCursorFromShape(), and screenCursorSize().

+ Here is the caller graph for this function: