46 #ifndef QT_GRAPHICS_BUTTON_ 47 #define QT_GRAPHICS_BUTTON_ 57 #include <QGraphicsItem> 68 Q_INTERFACES(QGraphicsItem)
79 QtGraphicsButton (
const QImage &_image, QGraphicsItem *_parent = 0,
int _width = -1,
int _height = -1);
87 virtual void paint (QPainter *_painter,
const QStyleOptionGraphicsItem *_option, QWidget *_widget = 0);
91 virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *_event);
92 virtual void mousePressEvent (QGraphicsSceneMouseEvent *_event);
93 virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *_event);
95 virtual QVariant itemChange (GraphicsItemChange _change,
const QVariant &_value);
void setChecked(bool _value)
sets button checked state
virtual QRectF boundingRect() const
returns the bounding rect
QtGraphicsButton(const QImage &_image, QGraphicsItem *_parent=0, int _width=-1, int _height=-1)
bool checkable_
button state
QPixmap normalPix_
pixmaps for different button states
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *_event)
event tracking
bool isChecked() const
returns button checked state
virtual void paint(QPainter *_painter, const QStyleOptionGraphicsItem *_option, QWidget *_widget=0)
paints the button
void pressed()
signals a button press
void setCheckable(bool _value)
makes the button checkable