31 #include "ginteractor.h" 35 class _Internal_QCheckBox;
49 GCheckBox(
const string& text =
"",
bool checked =
false, QWidget* parent =
nullptr);
68 string
getType()
const override;
100 virtual void setText(
const string& text);
112 string getActionEventType()
const override;
117 _Internal_QCheckBox* _iqcheckBox;
119 friend class _Internal_QCheckBox;
126 class _Internal_QCheckBox :
public QCheckBox,
public _Internal_QWidget {
130 _Internal_QCheckBox(
GCheckBox* gcheckBox,
bool checked =
false, QWidget* parent =
nullptr);
131 void detach()
override;
132 void keyPressEvent(QKeyEvent* event)
override;
133 void keyReleaseEvent(QKeyEvent* event)
override;
134 QSize sizeHint()
const override;
137 void doubleClicked();
140 void handleStateChange(
int);
143 void mouseDoubleClickEvent(QMouseEvent* e)
override;
153 #endif // _gcheckbox_h virtual void setChecked(bool checked)
Sets whether the checkbox should be checked.
Definition: gcheckbox.cpp:79
virtual void setSelected(bool selected)
Sets whether the checkbox should be checked.
Definition: gcheckbox.cpp:85
string getType() const override
Returns a string representing the class name of this interactor, such as "GButton" or "GCheckBox"...
Definition: gcheckbox.cpp:63
virtual bool isSelected() const
Returns true if the checkbox is currently checked.
Definition: gcheckbox.cpp:75
virtual void setText(string text)
Sets the text that will appear next to the checkbox.
Definition: gcheckbox.cpp:89
virtual bool isChecked() const
Returns true if the checkbox is currently checked.
Definition: gcheckbox.cpp:71
This abstract class is the superclass for all graphical interactors.
Definition: ginteractor.h:52
QWidget* getWidget() const override
Returns a direct pointer to the internal Qt widget being wrapped by this interactor.
Definition: gcheckbox.cpp:67
_Internal_QWidget* getInternalWidget() const override
Returns a direct pointer to the internal Qt widget being wrapped by this interactor.
Definition: gcheckbox.cpp:55
string getActionCommand() const override
Returns an action command for this interactor, which is a semi-unique string you can use to identify ...
Definition: gcheckbox.cpp:43
virtual string getText() const
Returns the text next to the checkbox.
Definition: gcheckbox.cpp:59
virtual void toggle()
Reverses the checked state of the box, setting it to be checked if it was unchecked or to be unchecke...
Definition: gcheckbox.cpp:95
~GCheckBox() override
Frees memory allocated internally by the checkbox.
Definition: gcheckbox.cpp:37
This interactor subclass represents an onscreen check box.
Definition: gcheckbox.h:43
GCheckBox(string text="", bool checked=false, QWidget* parent=nullptr)
Creates a checkbox with the given text.
Definition: gcheckbox.cpp:29