Compound widget that toggles between "play" and "pause" states.
More...
#include <playpausebutton.h>
|
| void | setPlaying (bool value, bool blockSignal=false) |
| | Set the playing state and optionally suppress the signal.
|
| |
| void | setText (const QString &value) |
| | Set the companion text label text.
|
| |
| void | setTextVisible (bool value) |
| | Show or hide the companion text label.
|
| |
| void | setTextAlignment (Qt::Alignment value) |
| | Set the text label alignment.
|
| |
| void | setIconWhilePlaying (const QIcon &value) |
| | Set the icon displayed while in the playing state.
|
| |
| void | setIconWhilePaused (const QIcon &value) |
| | Set the icon displayed while in the paused state.
|
| |
|
|
void | clicked () |
| | Emitted when the button is clicked.
|
| |
| void | playingChanged (bool playing) |
| | Emitted when the playing state changes.
|
| |
| void | textChanged (bool playing) |
| | Emitted when the text label text changes.
|
| |
|
| | PlayPauseButton (QWidget *parent=nullptr) |
| | Construct with an optional parent.
|
| |
| bool | isPlaying () const |
| | Return whether the widget is in the "playing" state.
|
| |
| QString | text () const |
| | Return the companion text label's text.
|
| |
| bool | isTextVisible () const |
| | Return whether the companion text label is visible.
|
| |
| void | setButtonSize (const QSize &min, const QSize &max, const QSize &icon) |
| | Set minimum, maximum, and icon sizes on the button.
|
| |
| Qt::Alignment | textAlignment () const |
| | Return the alignment of the companion text label.
|
| |
| QIcon | iconWhilePlaying () const |
| | Return the icon shown while playing.
|
| |
| QIcon | iconWhilePaused () const |
| | Return the icon shown while paused.
|
| |
|
| bool | playing |
| | Whether the button is in the playing state.
|
| |
| bool | textVisible |
| | Whether the companion text label is visible.
|
| |
| QString | text |
| | Text shown in the companion label.
|
| |
| QIcon | iconWhilePlaying |
| | Icon displayed while the button is in the playing state.
|
| |
| QIcon | iconWhilePaused |
| | Icon displayed while the button is in the paused state.
|
| |
| Qt::Alignment | textAlignment |
| | Alignment of the companion text label.
|
| |
Compound widget that toggles between "play" and "pause" states.
PlayPauseButton displays a QPushButton whose icon switches between iconWhilePlaying and iconWhilePaused according to the current playing state. An optional text label can be shown alongside the button with configurable alignment. The playing property is fully bindable and notifies via playingChanged().
Definition at line 19 of file playpausebutton.h.
◆ PlayPauseButton()
| PlayPauseButton::PlayPauseButton |
( |
QWidget * |
parent = nullptr | ) |
|
|
explicit |
Construct with an optional parent.
- Parameters
-
| parent | Optional QWidget parent |
◆ iconWhilePaused()
| QIcon PlayPauseButton::iconWhilePaused |
( |
| ) |
const |
|
inline |
Return the icon shown while paused.
- Returns
- Paused icon
Definition at line 84 of file playpausebutton.h.
◆ iconWhilePlaying()
| QIcon PlayPauseButton::iconWhilePlaying |
( |
| ) |
const |
|
inline |
Return the icon shown while playing.
- Returns
- Playing icon
Definition at line 78 of file playpausebutton.h.
◆ isPlaying()
| bool PlayPauseButton::isPlaying |
( |
| ) |
const |
|
inline |
Return whether the widget is in the "playing" state.
- Returns
- true if playing
Definition at line 46 of file playpausebutton.h.
◆ isTextVisible()
| bool PlayPauseButton::isTextVisible |
( |
| ) |
const |
Return whether the companion text label is visible.
- Returns
- true if visible
◆ playingChanged
| void PlayPauseButton::playingChanged |
( |
bool |
playing | ) |
|
|
signal |
Emitted when the playing state changes.
- Parameters
-
◆ setButtonSize()
| void PlayPauseButton::setButtonSize |
( |
const QSize & |
min, |
|
|
const QSize & |
max, |
|
|
const QSize & |
icon |
|
) |
| |
Set minimum, maximum, and icon sizes on the button.
- Parameters
-
| min | Minimum button size |
| max | Maximum button size |
| icon | Icon size |
◆ setIconWhilePaused
| void PlayPauseButton::setIconWhilePaused |
( |
const QIcon & |
value | ) |
|
|
inlineslot |
Set the icon displayed while in the paused state.
- Parameters
-
Definition at line 122 of file playpausebutton.h.
◆ setIconWhilePlaying
| void PlayPauseButton::setIconWhilePlaying |
( |
const QIcon & |
value | ) |
|
|
inlineslot |
Set the icon displayed while in the playing state.
- Parameters
-
Definition at line 116 of file playpausebutton.h.
◆ setPlaying
| void PlayPauseButton::setPlaying |
( |
bool |
value, |
|
|
bool |
blockSignal = false |
|
) |
| |
|
slot |
Set the playing state and optionally suppress the signal.
- Parameters
-
| value | true for playing, false for paused |
| blockSignal | true to suppress playingChanged() |
◆ setText
| void PlayPauseButton::setText |
( |
const QString & |
value | ) |
|
|
slot |
Set the companion text label text.
- Parameters
-
◆ setTextAlignment
| void PlayPauseButton::setTextAlignment |
( |
Qt::Alignment |
value | ) |
|
|
slot |
Set the text label alignment.
- Parameters
-
◆ setTextVisible
| void PlayPauseButton::setTextVisible |
( |
bool |
value | ) |
|
|
slot |
Show or hide the companion text label.
- Parameters
-
| value | true to show, false to hide |
◆ text()
| QString PlayPauseButton::text |
( |
| ) |
const |
|
inline |
◆ textAlignment()
| Qt::Alignment PlayPauseButton::textAlignment |
( |
| ) |
const |
|
inline |
Return the alignment of the companion text label.
- Returns
- Qt alignment flags
Definition at line 72 of file playpausebutton.h.
◆ textChanged
| void PlayPauseButton::textChanged |
( |
bool |
playing | ) |
|
|
signal |
Emitted when the text label text changes.
- Parameters
-
| playing | New playing state at time of text change |
◆ iconWhilePaused
| QIcon PlayPauseButton::iconWhilePaused |
|
readwrite |
Icon displayed while the button is in the paused state.
Definition at line 31 of file playpausebutton.h.
◆ iconWhilePlaying
| QIcon PlayPauseButton::iconWhilePlaying |
|
readwrite |
Icon displayed while the button is in the playing state.
Definition at line 29 of file playpausebutton.h.
◆ playing
| bool PlayPauseButton::playing |
|
readwrite |
◆ text
| QString PlayPauseButton::text |
|
readwrite |
◆ textAlignment
| Qt::Alignment PlayPauseButton::textAlignment |
|
readwrite |
◆ textVisible
| bool PlayPauseButton::textVisible |
|
readwrite |
The documentation for this class was generated from the following file: