more unfinished changes, process tab for dashboard
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user