PeriDyno 1.0.0
Loading...
Searching...
No Matches
QToggleButton.cpp
Go to the documentation of this file.
1#include "QToggleButton.h"
2
3#include "Module.h"
4#include "Node.h"
5#include "Field.h"
6#include "SceneGraphFactory.h"
7
8#include <QVBoxLayout>
9
10namespace dyno
11{
13 QPushButton(pParent)
14 {
15 connect(this, &QPushButton::clicked,this, &QToggleButton::ModifyText);
16 }
17
18 QToggleButton::QToggleButton(bool isChecked, QWidget* pParent) :
19 QPushButton(pParent)
20 {
21 connect(this, &QPushButton::clicked, this, &QToggleButton::ModifyText);
22 }
23
25 {
26 //std::cout << textChecked << " : " << textUnChecked << std::endl;
27 QString t;
28 std::string s;
30 if (isPress)
31 {
32 t = QString::fromStdString(textChecked);
33 }
34 else
35 {
36 t = QString::fromStdString(textUnChecked);
37 }
38 this->QPushButton::setText(t);
39
40 emit clicked();
41 }
42
43 void QToggleButton::setText(std::string textUnCheck, std::string textCheck)
44 {
45 textUnChecked = textUnCheck;
46 textChecked = textCheck;
47 updateText();
48 }
49
50
51
52}
53
std::string textUnChecked
std::string textChecked
void setText(std::string textUnCheck, std::string textCheck)
QToggleButton(QWidget *pParent=NULL)
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25