MainWidget::MainWidget (QWidget *parent)
: QWidget(parent)
{
+ irCtrl = new IrCtrl();
layout = new QGridLayout(this);
for (int i = 0; i < BUTTON_COUNT; ++i)
{
- buttons[i] = new QPushButton(this);
- layout->addWidget(buttons[i], i/3, i%3);
+ QPushButton *button = new QPushButton(QString(i), this);
+ buttons[i] = button;
+ layout->addWidget(button, i/3, i%3);
}
+
+ connect(buttons[0], SIGNAL(triggered()), irCtrl, SLOT(sendCmd0()));
+ connect(buttons[1], SIGNAL(triggered()), irCtrl, SLOT(sendCmd1()));
+ connect(buttons[2], SIGNAL(triggered()), irCtrl, SLOT(sendCmd2()));
+ connect(buttons[3], SIGNAL(triggered()), irCtrl, SLOT(sendCmd3()));
+ connect(buttons[4], SIGNAL(triggered()), irCtrl, SLOT(sendCmd4()));
+ connect(buttons[5], SIGNAL(triggered()), irCtrl, SLOT(sendCmd5()));
+
this->setLayout(layout);
}