Files
z-bar-qt/Plugins/ZShell/Internal/cursor.hpp
T
zach 9ea1f846ae
C++ / fmt (pull_request) Failing after 5s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 11s
JS/TS / fmt (pull_request) Successful in 9s
JS/TS / lint (pull_request) Successful in 10s
Python / static (pull_request) Successful in 34s
Rust / build (pull_request) Successful in 59s
Python / verify (pull_request) Successful in 1m48s
Rust / fmt (pull_request) Successful in 47s
Rust / clippy (pull_request) Successful in 1m6s
more unfinished changes, process tab for dashboard
2026-09-25 16:51:28 +02:00

37 lines
656 B
C++

#pragma once
#include <qcursor.h>
#include <qguiapplication.h>
#include <qobject.h>
#include <qqmlintegration.h>
namespace ZShell::internal {
class Cursor : public QObject {
Q_OBJECT
QML_SINGLETON
QML_ELEMENT
public:
Q_INVOKABLE void setOverride(Qt::CursorShape shape) {
if (m_override)
QGuiApplication::changeOverrideCursor(QCursor(shape));
else {
QGuiApplication::setOverrideCursor(QCursor(shape));
m_override = true;
}
}
Q_INVOKABLE void clearOverride() {
if (!m_override) return;
QGuiApplication::restoreOverrideCursor();
m_override = false;
}
private:
bool m_override = false;
};
} // namespace ZShell::internal