Line | |
---|
1 | #include "PushButton.h"
|
---|
2 | #include "ConnectionLayout.h"
|
---|
3 | #include <QPushButton>
|
---|
4 |
|
---|
5 | PushButton::PushButton(Layout* parent,int row, int col,QString name):XmlWidget(name,"PushButton",parent)
|
---|
6 | {
|
---|
7 | button=new QPushButton(name);
|
---|
8 | parent->addWidget(button,row,col);
|
---|
9 |
|
---|
10 | SetValue("0");
|
---|
11 |
|
---|
12 | connect(button, SIGNAL(clicked(bool)),this, SLOT(button_clicked(bool)));
|
---|
13 | }
|
---|
14 |
|
---|
15 | PushButton::~PushButton()
|
---|
16 | {
|
---|
17 | delete button;
|
---|
18 | }
|
---|
19 |
|
---|
20 | void PushButton::button_clicked(bool state)
|
---|
21 | {
|
---|
22 | SetValue("1");
|
---|
23 | connectionLayout()->XmlToSend(XmlDoc());
|
---|
24 | SetValue("0");
|
---|
25 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.