RhythmGame 1.4.3
Loading...
Searching...
No Matches
Lr2NativeCursor.h
Go to the documentation of this file.
1#pragma once
2
3#include <QImage>
4#include <QQuickItem>
5#include <QRectF>
6#include <QSizeF>
7
8class QQuickWindow;
9
10namespace qml_components {
11
12class Lr2NativeCursor : public QQuickItem
13{
14 Q_OBJECT
15 Q_PROPERTY(bool active READ active WRITE setActive NOTIFY activeChanged)
16 Q_PROPERTY(QString source READ source WRITE setSource NOTIFY sourceChanged)
17 Q_PROPERTY(QRectF sourceRect READ sourceRect WRITE setSourceRect NOTIFY sourceRectChanged)
18 Q_PROPERTY(QSizeF targetSize READ targetSize WRITE setTargetSize NOTIFY targetSizeChanged)
19
20 public:
21 explicit Lr2NativeCursor(QQuickItem* parent = nullptr);
22 ~Lr2NativeCursor() override;
23
24 auto active() const -> bool;
25 void setActive(bool active);
26
27 auto source() const -> QString;
28 void setSource(const QString& source);
29
30 auto sourceRect() const -> QRectF;
31 void setSourceRect(const QRectF& sourceRect);
32
33 auto targetSize() const -> QSizeF;
34 void setTargetSize(const QSizeF& targetSize);
35
36 signals:
41
42 private:
43 void updateCursor();
44 void clearCursor();
45 auto cursorImage() -> QImage;
46 static auto localPathForSource(const QString& source) -> QString;
47
48 bool m_active = false;
49 QString m_source;
50 QRectF m_sourceRect;
51 QSizeF m_targetSize;
52 QQuickWindow* m_window = nullptr;
53 QString m_loadedSource;
54 QImage m_loadedImage;
55 QString m_appliedKey;
56 bool m_applied = false;
57};
58
59} // namespace qml_components
Definition Lr2NativeCursor.h:13
void setSourceRect(const QRectF &sourceRect)
Definition Lr2NativeCursor.cpp:87
QRectF sourceRect
Definition Lr2NativeCursor.h:17
void setSource(const QString &source)
Definition Lr2NativeCursor.cpp:70
QString source
Definition Lr2NativeCursor.h:16
void setTargetSize(const QSizeF &targetSize)
Definition Lr2NativeCursor.cpp:104
QSizeF targetSize
Definition Lr2NativeCursor.h:18
bool active
Definition Lr2NativeCursor.h:15
void setActive(bool active)
Definition Lr2NativeCursor.cpp:53
Contains classes that wrap some functionality for use in QML.
Definition ProfileArenaIdentityProvider.h:9