Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qwindowscursor.cpp File Reference
#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

◆ 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 96 of file qwindowscursor.cpp.

References QImage::constScanLine(), QScopedPointer< T, Cleanup >::data(), QImage::height(), i, j, qMax(), and QImage::width().

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 178 of file qwindowscursor.cpp.

References QBitmap::fromData(), QPixmap::fromImage(), QTransform::fromScale(), QPixmap::height(), qAbs(), screenCursorSize(), QPixmap::setMask(), Qt::SmoothTransformation, QPixmap::transformed(), QPixmap::width(), and QSize::width().

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 150 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 171 of file qwindowscursor.cpp.

Referenced by QWindowsCursor::customCursor().

+ Here is the caller graph for this function:

◆ systemCursorSize()

static QSize systemCursorSize ( )
static

Definition at line 148 of file qwindowscursor.cpp.

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

+ Here is the caller graph for this function: