A Button Graphicsitem for use in Stellarium's graphic widgets.
More...
#include <StelGuiItems.hpp>
|
enum | { ButtonStateOff = 0,
ButtonStateOn = 1,
ButtonStateNoChange = 2
} |
| Button states. More...
|
|
|
void | setChecked (int b) |
| set whether the button is checked More...
|
|
void | setChecked (bool b) |
|
|
| StelButton (QGraphicsItem *parent, const QPixmap &pixOn, const QPixmap &pixOff, const QPixmap &pixHover=QPixmap(), class StelAction *action=NULL, bool noBackground=false) |
| Constructor. More...
|
|
| StelButton (QGraphicsItem *parent, const QPixmap &pixOn, const QPixmap &pixOff, const QPixmap &pixHover, const QString &actionId, bool noBackground=false) |
| Constructor. More...
|
|
| StelButton (QGraphicsItem *parent, const QPixmap &pixOn, const QPixmap &pixOff, const QPixmap &pixNoChange, const QPixmap &pixHover, const QString &actionId=QString(), bool noBackground=false, bool isTristate=true) |
| Constructor. More...
|
|
int | isChecked () const |
| Get whether the button is checked. More...
|
|
int | getButtonPixmapWidth () const |
| Get the width of the button image. More...
|
|
void | setOpacity (double v) |
| Set the button opacity. More...
|
|
void | setBackgroundPixmap (const QPixmap &newBackground) |
| Set the background pixmap of the button. More...
|
|
void | setFocusOnSky (bool b) |
| While configuring buttons, call this with true when after key release focus should go back to the sky (typical for bottom buttons; left buttons call panels which receive focus after button press, so those should be configured with b=false) More...
|
|
|
virtual void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
|
virtual void | hoverEnterEvent (QGraphicsSceneHoverEvent *event) |
|
virtual void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event) |
|
virtual void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
|
|
class | BottomStelBar |
|
class | LeftStelBar |
|
A Button Graphicsitem for use in Stellarium's graphic widgets.
Definition at line 65 of file StelGuiItems.hpp.
StelButton::StelButton |
( |
QGraphicsItem * |
parent, |
|
|
const QPixmap & |
pixOn, |
|
|
const QPixmap & |
pixOff, |
|
|
const QPixmap & |
pixHover = QPixmap() , |
|
|
class StelAction * |
action = NULL , |
|
|
bool |
noBackground = false |
|
) |
| |
Constructor.
- Parameters
-
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 & |
pixHover, |
|
|
const QString & |
actionId, |
|
|
bool |
noBackground = false |
|
) |
| |
Constructor.
- Parameters
-
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 |
actionId | the id of 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, |
|
|
const QString & |
actionId = QString() , |
|
|
bool |
noBackground = false , |
|
|
bool |
isTristate = true |
|
) |
| |
Constructor.
- Parameters
-
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 |
actionId | 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.
Definition at line 113 of file StelGuiItems.hpp.
void StelButton::hoverChanged |
( |
bool |
b | ) |
|
|
signal |
Emitted when the hover state change.
- Parameters
-
b | true if the mouse entered the button |
int StelButton::isChecked |
( |
| ) |
const |
|
inline |
void StelButton::setBackgroundPixmap |
( |
const QPixmap & |
newBackground | ) |
|
Set the background pixmap of the button.
void StelButton::setChecked |
( |
int |
b | ) |
|
|
slot |
set whether the button is checked
void StelButton::setFocusOnSky |
( |
bool |
b | ) |
|
|
inline |
While configuring buttons, call this with true when after key release focus should go back to the sky (typical for bottom buttons; left buttons call panels which receive focus after button press, so those should be configured with b=false)
Definition at line 124 of file StelGuiItems.hpp.
void StelButton::setOpacity |
( |
double |
v | ) |
|
|
inline |
void StelButton::toggled |
( |
bool |
| ) |
|
|
signal |
Triggered when the button state changes.
void StelButton::triggered |
( |
| ) |
|
|
signal |
Triggered when the button state changes.
The documentation for this class was generated from the following file: