Krita Source Code Documentation
Loading...
Searching...
No Matches
KisCursorCache Class Reference

#include <kis_cursor_cache.h>

+ Inheritance diagram for KisCursorCache:

Public Member Functions

 KisCursorCache ()
 
QCursor load (const QString &cursorName, int width, int height, int hotspotX, int hotspotY)
 

Static Public Member Functions

static KisCursorCacheinstance ()
 

Private Attributes

QHash< QString, QPair< QPoint, QCursor > > cursorHash
 

Detailed Description

Definition at line 20 of file kis_cursor_cache.h.

Constructor & Destructor Documentation

◆ KisCursorCache()

KisCursorCache::KisCursorCache ( )

Definition at line 55 of file kis_cursor_cache.cpp.

55{}

Member Function Documentation

◆ instance()

KisCursorCache * KisCursorCache::instance ( )
static

Definition at line 57 of file kis_cursor_cache.cpp.

58{
59 return s_instance;
60}

◆ load()

QCursor KisCursorCache::load ( const QString & cursorName,
int width,
int height,
int hotspotX,
int hotspotY )

Definition at line 62 of file kis_cursor_cache.cpp.

63{
64 if (cursorHash.contains(cursorName)) {
65 return cursorHash[ cursorName ].second;
66 }
67
68 // Otherwise, construct the cursor
69 QCursor newCursor = loadImpl(cursorName, hotspotX, hotspotY, width, height);
70 cursorHash.insert(cursorName, QPair<QPoint, QCursor>(QPoint(hotspotX, hotspotY), newCursor));
71 return newCursor;
72}
QHash< QString, QPair< QPoint, QCursor > > cursorHash

References cursorHash.

Member Data Documentation

◆ cursorHash

QHash<QString, QPair<QPoint, QCursor> > KisCursorCache::cursorHash
private

Definition at line 32 of file kis_cursor_cache.h.


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