Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_cursor_cache.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Michael Abrahams <miabraha@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef KIS_CURSOR_CACHE_H
8#define KIS_CURSOR_CACHE_H
9
10#include <QString>
11#include <QCursor>
12#include <QObject>
13#include <QPair>
14#include <QPoint>
15#include <QHash>
16
17// KisCursorCache implements a global static database of cursors. This allows
18// Krita to load cursor data only once.
19
20class KisCursorCache: public QObject
21{
22 Q_OBJECT
23public:
24 static KisCursorCache* instance();
26
27 QCursor load(const QString & cursorName, int hotspotX, int hotspotY);
28
29private:
30
31 // Stores cursor hash
32 QHash<QString, QPair<QPoint, QCursor>> cursorHash;
33};
34
35#endif
static KisCursorCache * instance()
QHash< QString, QPair< QPoint, QCursor > > cursorHash
QCursor load(const QString &cursorName, int hotspotX, int hotspotY)