##// END OF EJS Templates
Callout example: added extra space around the text
Callout example: added extra space around the text

File last commit:

r2378:c144d02c5537
r2378:c144d02c5537
Show More
callout.h
33 lines | 693 B | text/x-c | CLexer
#ifndef CALLOUT_H
#define CALLOUT_H
#include <QGraphicsItem>
#include <QFont>
class QGraphicsSceneMouseEvent;
class Callout : public QGraphicsItem
{
public:
Callout(QGraphicsItem * parent = 0);
void setText(const QString &text);
void setAnchor(QPointF point);
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,QWidget *widget);
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
private:
QString m_text;
QRectF m_textRect;
QRectF m_rect;
QPointF m_anchor;
QFont m_font;
QPointF m_clickOffset;
};
#endif // CALLOUT_H