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 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 39 of file kis_cursor_cache.cpp.

39{}

Member Function Documentation

◆ instance()

KisCursorCache * KisCursorCache::instance ( )
static

Definition at line 41 of file kis_cursor_cache.cpp.

42{
43 return s_instance;
44}

◆ load()

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

Definition at line 46 of file kis_cursor_cache.cpp.

47{
48 if (cursorHash.contains(cursorName)) {
49 return cursorHash[ cursorName ].second;
50 }
51
52 // Otherwise, construct the cursor
53 QCursor newCursor = loadImpl(cursorName, hotspotX, hotspotY);
54 cursorHash.insert(cursorName, QPair<QPoint, QCursor>(QPoint(hotspotX, hotspotY), newCursor));
55 return newCursor;
56}
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: