Developer Documentation
QtGraphicsButton Class Reference

#include <OpenFlipper/widgets/glWidget/QtGraphicsButton.hh>

Inheritance diagram for QtGraphicsButton:

Signals

void pressed ()
 signals a button press
 

Public Member Functions

 QtGraphicsButton (const QImage &_image, QGraphicsItem *_parent=0, int _width=-1, int _height=-1)
 
virtual QRectF boundingRect () const
 returns the bounding rect More...
 
virtual void paint (QPainter *_painter, const QStyleOptionGraphicsItem *_option, QWidget *_widget=0)
 paints the button More...
 
virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *_event)
 event tracking More...
 
virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *_event)
 
virtual void mousePressEvent (QGraphicsSceneMouseEvent *_event)
 
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *_event)
 
virtual QVariant itemChange (GraphicsItemChange _change, const QVariant &_value)
 
void setCheckable (bool _value)
 makes the button checkable More...
 
void setChecked (bool _value)
 sets button checked state More...
 
bool isChecked () const
 returns button checked state More...
 

Private Attributes

bool checkable_
 button state More...
 
bool checked_
 
bool pressed_
 
bool over_
 
int width_
 button size More...
 
int height_
 
QPixmap normalPix_
 pixmaps for different button states More...
 
QPixmap overPix_
 
QPixmap checkedPix_
 

Detailed Description

Simple Button implementation for QGraphicsScene

Definition at line 65 of file QtGraphicsButton.hh.

Constructor & Destructor Documentation

◆ QtGraphicsButton()

QtGraphicsButton::QtGraphicsButton ( const QImage &  _image,
QGraphicsItem *  _parent = 0,
int  _width = -1,
int  _height = -1 
)

Create a glViewer.

Parameters
_imagebutton imahe
_parentparent graphics scene item
_widthbutton width
_heightbutton height

Definition at line 61 of file QtGraphicsButton.cc.

Member Function Documentation

◆ boundingRect()

QRectF QtGraphicsButton::boundingRect ( ) const
virtual

returns the bounding rect

Definition at line 99 of file QtGraphicsButton.cc.

◆ hoverEnterEvent()

void QtGraphicsButton::hoverEnterEvent ( QGraphicsSceneHoverEvent *  _event)
virtual

event tracking

Definition at line 140 of file QtGraphicsButton.cc.

◆ hoverLeaveEvent()

void QtGraphicsButton::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  _event)
virtual

Definition at line 148 of file QtGraphicsButton.cc.

◆ isChecked()

bool QtGraphicsButton::isChecked ( ) const

returns button checked state

Definition at line 133 of file QtGraphicsButton.cc.

◆ itemChange()

QVariant QtGraphicsButton::itemChange ( GraphicsItemChange  _change,
const QVariant &  _value 
)
virtual

Definition at line 178 of file QtGraphicsButton.cc.

◆ mousePressEvent()

void QtGraphicsButton::mousePressEvent ( QGraphicsSceneMouseEvent *  _event)
virtual

Definition at line 156 of file QtGraphicsButton.cc.

◆ mouseReleaseEvent()

void QtGraphicsButton::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  _event)
virtual

Definition at line 169 of file QtGraphicsButton.cc.

◆ paint()

void QtGraphicsButton::paint ( QPainter *  _painter,
const QStyleOptionGraphicsItem *  _option,
QWidget *  _widget = 0 
)
virtual

paints the button

Definition at line 106 of file QtGraphicsButton.cc.

◆ setCheckable()

void QtGraphicsButton::setCheckable ( bool  _value)

makes the button checkable

Definition at line 119 of file QtGraphicsButton.cc.

◆ setChecked()

void QtGraphicsButton::setChecked ( bool  _value)

sets button checked state

Definition at line 126 of file QtGraphicsButton.cc.

Member Data Documentation

◆ checkable_

bool QtGraphicsButton::checkable_
private

button state

Definition at line 114 of file QtGraphicsButton.hh.

◆ checked_

bool QtGraphicsButton::checked_
private

Definition at line 115 of file QtGraphicsButton.hh.

◆ checkedPix_

QPixmap QtGraphicsButton::checkedPix_
private

Definition at line 126 of file QtGraphicsButton.hh.

◆ height_

int QtGraphicsButton::height_
private

Definition at line 121 of file QtGraphicsButton.hh.

◆ normalPix_

QPixmap QtGraphicsButton::normalPix_
private

pixmaps for different button states

Definition at line 124 of file QtGraphicsButton.hh.

◆ over_

bool QtGraphicsButton::over_
private

Definition at line 117 of file QtGraphicsButton.hh.

◆ overPix_

QPixmap QtGraphicsButton::overPix_
private

Definition at line 125 of file QtGraphicsButton.hh.

◆ pressed_

bool QtGraphicsButton::pressed_
private

Definition at line 116 of file QtGraphicsButton.hh.

◆ width_

int QtGraphicsButton::width_
private

button size

Definition at line 120 of file QtGraphicsButton.hh.


The documentation for this class was generated from the following files: