matrixion/src/ui/NhekoCursorShape.h

31 lines
715 B
C
Raw Normal View History

2021-03-05 02:35:15 +03:00
// SPDX-FileCopyrightText: 2021 Nheko Contributors
//
// SPDX-License-Identifier: GPL-3.0-or-later
2021-02-14 03:28:28 +03:00
#pragma once
// see
// https://stackoverflow.com/questions/27821054/how-to-change-cursor-shape-in-qml-when-mousearea-is-covered-with-another-mousear/29382092#29382092
#include <QQuickItem>
class NhekoCursorShape : public QQuickItem
{
2021-09-18 01:22:33 +03:00
Q_OBJECT
2021-02-14 03:28:28 +03:00
2021-09-18 01:22:33 +03:00
Q_PROPERTY(
Qt::CursorShape cursorShape READ cursorShape WRITE setCursorShape NOTIFY cursorShapeChanged)
2021-02-14 03:28:28 +03:00
public:
2021-09-18 01:22:33 +03:00
explicit NhekoCursorShape(QQuickItem *parent = 0);
2021-02-14 03:28:28 +03:00
private:
2021-09-18 01:22:33 +03:00
Qt::CursorShape cursorShape() const;
void setCursorShape(Qt::CursorShape cursorShape);
2021-02-14 03:28:28 +03:00
2021-09-18 01:22:33 +03:00
Qt::CursorShape currentShape_;
2021-02-14 03:28:28 +03:00
signals:
2021-09-18 01:22:33 +03:00
void cursorShapeChanged();
2021-02-14 03:28:28 +03:00
};