NeTrainSim 0.1.1 beta
The Open-Source Network Trains Simulator
 
Loading...
Searching...
No Matches
togglebutton.h
Go to the documentation of this file.
1#ifndef TOGGLEBUTTON_H
2#define TOGGLEBUTTON_H
3
4#include <QObject>
5#include <QWidget>
6#include <QPushButton>
7
8
9class ToggleButton : public QPushButton {
10 Q_OBJECT
11
12public:
13 explicit ToggleButton(QWidget *parent = nullptr);
15
16 void setOnOffText(const QString &onText, const QString &offText); // method to set on and off text
17 bool isToggled() const; // method to get if the button is on or off
18
19
20private:
21 QString onText;
22 QString offText;
23};
24
25#endif // TOGGLEBUTTON_H
Definition togglebutton.h:9
bool isToggled() const
Definition togglebutton.cpp:26
~ToggleButton()
Definition togglebutton.cpp:17
void setOnOffText(const QString &onText, const QString &offText)
Definition togglebutton.cpp:20