Fixes
[irwi] / src / mainwidget.cpp
1 #include "mainwidget.h"
2
3 #include <QGridLayout>
4 #include <QPushButton>
5
6 MainWidget::MainWidget (QWidget *parent)
7     : QWidget(parent)
8 {
9     layout = new QGridLayout(this);
10
11     for (int i = 0; i < BUTTON_COUNT; ++i)
12     {
13         QPushButton *button = new QPushButton(QString(i+0x30), this);
14         buttons[i] = button;
15         layout->addWidget(button, i%2, i/2);
16     }
17
18     connect(buttons[0], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd0(bool)));
19     connect(buttons[1], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd1(bool)));
20     connect(buttons[2], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd2(bool)));
21     connect(buttons[3], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd3(bool)));
22     connect(buttons[4], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd4(bool)));
23     connect(buttons[5], SIGNAL(clicked(bool)), &irCtrl, SLOT(sendCmd5(bool)));
24
25     this->setLayout(layout);
26 }
27