qskinny/playground/shapes/GeometricShape.h

46 lines
1020 B
C
Raw Normal View History

/******************************************************************************
* QSkinny - Copyright (C) 2016 Uwe Rathmann
2023-04-06 09:23:37 +02:00
* SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/
#pragma once
#include "ShapeItem.h"
class GeometricShape : public ShapeItem
{
Q_OBJECT
Q_PROPERTY( Figure figure READ figure WRITE setFigure )
Q_PROPERTY( QColor border READ border WRITE setBorder )
public:
enum Figure
{
Rectangle,
Diamond,
TriangleDown,
TriangleUp,
TriangleLeft,
TriangleRight,
Ellipse,
Ring,
Star,
Hexagon,
Arc
};
2023-04-04 08:49:11 +02:00
Q_ENUM( Figure )
GeometricShape( QQuickItem* parent = nullptr );
GeometricShape( Figure figure, QQuickItem* parent = nullptr );
void setFigure( Figure );
Figure figure() const;
void setBorder( const QColor& );
QColor border() const;
private:
Figure m_figure = Rectangle;
};