2015-10-05 01:43:48 +02:00
|
|
|
#ifndef SLIDERITEM_H
|
|
|
|
#define SLIDERITEM_H
|
|
|
|
|
2016-09-19 00:56:10 +02:00
|
|
|
#include <QGraphicsObject>
|
2015-10-05 01:43:48 +02:00
|
|
|
|
2017-12-03 00:36:52 +01:00
|
|
|
class QColor;
|
|
|
|
|
2015-10-05 01:43:48 +02:00
|
|
|
class SliderItem : public QGraphicsObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2016-09-19 00:56:10 +02:00
|
|
|
SliderItem(QGraphicsItem *parent = 0);
|
2015-10-05 01:43:48 +02:00
|
|
|
|
|
|
|
QRectF boundingRect() const;
|
|
|
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
|
|
QWidget *widget);
|
|
|
|
|
2016-03-19 17:24:53 +01:00
|
|
|
const QRectF &area() const {return _area;}
|
2016-04-01 21:20:23 +02:00
|
|
|
void setArea(const QRectF &area);
|
2015-10-05 01:43:48 +02:00
|
|
|
|
2017-12-03 00:36:52 +01:00
|
|
|
void setColor(const QColor &color);
|
|
|
|
|
2015-12-19 20:23:07 +01:00
|
|
|
void clear();
|
|
|
|
|
2015-10-05 01:43:48 +02:00
|
|
|
signals:
|
|
|
|
void positionChanged(const QPointF&);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
QVariant itemChange(GraphicsItemChange change, const QVariant &value);
|
|
|
|
|
|
|
|
private:
|
|
|
|
QRectF _area;
|
2017-12-03 00:36:52 +01:00
|
|
|
QColor _color;
|
2015-10-05 01:43:48 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SLIDERITEM_H
|