31 lines
764 B
C
31 lines
764 B
C
|
|
#ifndef GRAPHICSRECTITEM_H
|
||
|
|
#define GRAPHICSRECTITEM_H
|
||
|
|
|
||
|
|
#include "graphicsBaseItem.h"
|
||
|
|
|
||
|
|
class GraphicsRectItem : public GraphicsBaseItem
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
GraphicsRectItem(const QRect &rect, bool isRound = false, QGraphicsItem *parent = 0);
|
||
|
|
virtual ~GraphicsRectItem();
|
||
|
|
|
||
|
|
void resize(int,double, double, const QPointF&);
|
||
|
|
void updateCoordinate();
|
||
|
|
void move(const QPointF&);
|
||
|
|
void editShape(int, const QPointF&);
|
||
|
|
|
||
|
|
protected:
|
||
|
|
virtual QPainterPath shape();
|
||
|
|
virtual void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*);
|
||
|
|
|
||
|
|
private:
|
||
|
|
virtual void updateHandles();
|
||
|
|
|
||
|
|
QRectF m_lastBoudingRect; //记录上一时刻的boundingRect
|
||
|
|
bool m_bIsRound; //是否为圆角矩形
|
||
|
|
double m_dRatioX;
|
||
|
|
double m_dRatioY;
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif
|