Bit functionality
[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     irCtrl = new IrCtrl();
10     layout = new QGridLayout(this);
11
12     for (int i = 0; i < BUTTON_COUNT; ++i)
13     {
14         QPushButton *button = new QPushButton(QString(i), this);
15         buttons[i] = button;
16         layout->addWidget(button, i/3, i%3);
17     }
18
19     connect(buttons[0], SIGNAL(triggered()), irCtrl, SLOT(sendCmd0()));
20     connect(buttons[1], SIGNAL(triggered()), irCtrl, SLOT(sendCmd1()));
21     connect(buttons[2], SIGNAL(triggered()), irCtrl, SLOT(sendCmd2()));
22     connect(buttons[3], SIGNAL(triggered()), irCtrl, SLOT(sendCmd3()));
23     connect(buttons[4], SIGNAL(triggered()), irCtrl, SLOT(sendCmd4()));
24     connect(buttons[5], SIGNAL(triggered()), irCtrl, SLOT(sendCmd5()));
25
26     this->setLayout(layout);
27 }
28