Bit functionality
authorTorste Aikio <zokier@zokier.laptop>
Wed, 19 May 2010 08:57:07 +0000 (11:57 +0300)
committerTorste Aikio <zokier@zokier.laptop>
Wed, 19 May 2010 08:57:07 +0000 (11:57 +0300)
src/irctrl.cpp [new file with mode: 0644]
src/irctrl.h [new file with mode: 0644]
src/mainwidget.cpp
src/mainwidget.h

diff --git a/src/irctrl.cpp b/src/irctrl.cpp
new file mode 100644 (file)
index 0000000..91a6a2f
--- /dev/null
@@ -0,0 +1,30 @@
+#include "irctrl.h"
+
+IrCtrl::IrCtrl()
+{
+}
+
+void IrCtrl::sendCmd0()
+{
+}
+
+void IrCtrl::sendCmd1()
+{
+}
+
+void IrCtrl::sendCmd2()
+{
+}
+
+void IrCtrl::sendCmd3()
+{
+}
+
+void IrCtrl::sendCmd4()
+{
+}
+
+void IrCtrl::sendCmd5()
+{
+}
+
diff --git a/src/irctrl.h b/src/irctrl.h
new file mode 100644 (file)
index 0000000..02308ba
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef IRCTRL_H
+#define IRCTRL_H
+
+class IrCtrl
+{
+public:
+    IrCtrl();
+
+public slots:
+    void sendCmd0();
+    void sendCmd1();
+    void sendCmd2();
+    void sendCmd3();
+    void sendCmd4();
+    void sendCmd5();
+};
+
+#endif
+
index 3b99154..9cfa5a4 100644 (file)
@@ -6,13 +6,23 @@
 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);
 }
 
index 912445a..8187e50 100644 (file)
@@ -16,6 +16,7 @@ private:
     static const int BUTTON_COUNT = 6;
     QGridLayout *layout;
     QPushButton *buttons[BUTTON_COUNT];
+    IrCtrl irCtrl;
 };
 
 #endif