#include "mainwidget.h"
+#include <QtGui/qinputdialog.h>
#include <QGridLayout>
#include <QPushButton>
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+0x30), this);
+ buttons[i] = button;
+ layout->addWidget(button, i%2, i/2);
}
+
+ 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);
}
+void MainWidget::showSettingsDialog()
+{
+ bool isOk;
+ QString newText = QInputDialog::getText(this, tr("New Text"),
+ tr("Please enter a new text:"), QLineEdit::Normal,
+ "foo", &isOk);
+// if (isOk)
+// setText(newText);
+}
+
+