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