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