![]() |
Stellarium 0.11.2 | ||
| Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure |
A Button Graphicsitem for use in Stellarium's graphic widgets. More...
#include <StelGuiItems.hpp>
Public Types | |
| enum | { ButtonStateOff = 0, ButtonStateOn = 1, ButtonStateNoChange = 2 } |
Public Slots | |
| void | setChecked (int b) |
| void | setChecked (bool b) |
Signals | |
| void | toggled (bool) |
| void | triggered () |
| void | hoverChanged (bool b) |
Public Member Functions | |
| StelButton (QGraphicsItem *parent, const QPixmap &pixOn, const QPixmap &pixOff, const QPixmap &pixHover=QPixmap(), QAction *action=NULL, bool noBackground=false) | |
| StelButton (QGraphicsItem *parent, const QPixmap &pixOn, const QPixmap &pixOff, const QPixmap &pixNoChange, const QPixmap &pixHover=QPixmap(), QAction *action=NULL, bool noBackground=false, bool isTristate=true) | |
| int | isChecked () const |
| int | getButtonPixmapWidth () const |
| void | setOpacity (double v) |
| void | setRedMode (bool b) |
| void | setBackgroundPixmap (const QPixmap &newBackground) |
Static Public Member Functions | |
| static QPixmap | makeRed (const QPixmap &p) |
Protected Member Functions | |
| virtual void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
| virtual void | hoverEnterEvent (QGraphicsSceneHoverEvent *event) |
| virtual void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event) |
| virtual void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
A Button Graphicsitem for use in Stellarium's graphic widgets.
| StelButton::StelButton | ( | QGraphicsItem * | parent, |
| const QPixmap & | pixOn, | ||
| const QPixmap & | pixOff, | ||
| const QPixmap & | pixHover = QPixmap(), |
||
| QAction * | action = NULL, |
||
| bool | noBackground = false |
||
| ) |
Constructor.
| parent | the parent item |
| pixOn | the pixmap to display when the button is toggled |
| pixOff | the pixmap to display when the button is not toggled |
| pixHover | a pixmap slowly blended when mouse is over the button |
| action | the associated action. Connections are automatically done with the signals if relevant. |
| noBackground | define whether the button background image have to be used |
| StelButton::StelButton | ( | QGraphicsItem * | parent, |
| const QPixmap & | pixOn, | ||
| const QPixmap & | pixOff, | ||
| const QPixmap & | pixNoChange, | ||
| const QPixmap & | pixHover = QPixmap(), |
||
| QAction * | action = NULL, |
||
| bool | noBackground = false, |
||
| bool | isTristate = true |
||
| ) |
Constructor.
| parent | the parent item |
| pixOn | the pixmap to display when the button is toggled |
| pixOff | the pixmap to display when the button is not toggled |
| pixNoChange | the pixmap to display when the button state of a tristate is not changed |
| pixHover | a pixmap slowly blended when mouse is over the button |
| action | the associated action. Connections are automatically done with the signals if relevant. |
| noBackground | define whether the button background image have to be used |
| isTristate | define whether the button is a tristate or an on/off button |
| int StelButton::getButtonPixmapWidth | ( | ) | const [inline] |
Get the width of the button image.
The width is based on pixOn.
| void StelButton::hoverChanged | ( | bool | b | ) | [signal] |
Emitted when the hover state change.
| b | true if the mouse entered the button |
| void StelButton::setBackgroundPixmap | ( | const QPixmap & | newBackground | ) |
Set the background pixmap of the button.
A variant for night vision mode (pixBackgroundRed) is automatically generated from the new background.
1.7.4