2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef MOUSE_H
|
|
|
|
#define MOUSE_H
|
|
|
|
|
|
|
|
#include <QGraphicsObject>
|
|
|
|
|
|
|
|
//! [0]
|
|
|
|
class Mouse : public QGraphicsObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
Mouse();
|
|
|
|
|
2016-06-15 08:12:35 +00:00
|
|
|
QRectF boundingRect() const override;
|
|
|
|
QPainterPath shape() const override;
|
2011-04-27 10:05:43 +00:00
|
|
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
2016-06-15 08:12:35 +00:00
|
|
|
QWidget *widget) override;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
protected:
|
2016-06-15 08:12:35 +00:00
|
|
|
void timerEvent(QTimerEvent *event) override;
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
private:
|
2019-09-06 21:24:56 +00:00
|
|
|
qreal angle = 0;
|
|
|
|
qreal speed = 0;
|
|
|
|
qreal mouseEyeDirection = 0;
|
2011-04-27 10:05:43 +00:00
|
|
|
QColor color;
|
|
|
|
};
|
|
|
|
//! [0]
|
|
|
|
|
|
|
|
#endif
|