2022-05-10 12:06:48 +02:00
|
|
|
// Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 12:05:43 +02:00
|
|
|
|
|
|
|
#ifndef CHIP_H
|
|
|
|
#define CHIP_H
|
|
|
|
|
2012-11-23 09:31:03 +01:00
|
|
|
#include <QColor>
|
|
|
|
#include <QGraphicsItem>
|
2011-04-27 12:05:43 +02:00
|
|
|
|
|
|
|
class Chip : public QGraphicsItem
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Chip(const QColor &color, int x, int y);
|
|
|
|
|
2016-06-15 10:12:35 +02:00
|
|
|
QRectF boundingRect() const override;
|
|
|
|
QPainterPath shape() const override;
|
|
|
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget) override;
|
2011-04-27 12:05:43 +02:00
|
|
|
|
|
|
|
protected:
|
2016-06-15 10:12:35 +02:00
|
|
|
void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
|
|
|
|
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
|
|
|
|
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override;
|
2011-04-27 12:05:43 +02:00
|
|
|
|
|
|
|
private:
|
2012-11-23 09:31:03 +01:00
|
|
|
int x;
|
|
|
|
int y;
|
2011-04-27 12:05:43 +02:00
|
|
|
QColor color;
|
2020-06-22 10:12:38 +02:00
|
|
|
QList<QPointF> stuff;
|
2011-04-27 12:05:43 +02:00
|
|
|
};
|
|
|
|
|
2012-11-23 09:31:03 +01:00
|
|
|
#endif // CHIP_H
|