You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
573 B
30 lines
573 B
#ifndef QQUICKCUSTOMITEM_H
|
|
#define QQUICKCUSTOMITEM_H
|
|
|
|
#include <QQuickPaintedItem>
|
|
#include <QPainter>
|
|
#include <QPainterPath>
|
|
|
|
class QQuickCustomItem : public QQuickPaintedItem
|
|
{
|
|
Q_OBJECT
|
|
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
|
|
public:
|
|
QQuickCustomItem(QQuickPaintedItem *parent = Q_NULLPTR);
|
|
|
|
protected:
|
|
void paint(QPainter *painter);
|
|
|
|
QColor color() const;
|
|
void setColor(const QColor &color);
|
|
|
|
private:
|
|
QColor m_color;
|
|
bool m_needUpdate;
|
|
|
|
signals:
|
|
void colorChanged();
|
|
};
|
|
|
|
#endif // QQUICKCUSTOMITEM_H
|