Fixes
authorTorste Aikio <zokier@zokier.laptop>
Wed, 19 May 2010 09:11:04 +0000 (12:11 +0300)
committerTorste Aikio <zokier@zokier.laptop>
Wed, 19 May 2010 09:11:04 +0000 (12:11 +0300)
src/irctrl.cpp
src/irctrl.h
src/mainwidget.cpp
src/mainwidget.h

index 91a6a2f..b0a821f 100644 (file)
@@ -4,27 +4,27 @@ IrCtrl::IrCtrl()
 {
 }
 
-void IrCtrl::sendCmd0()
+void IrCtrl::sendCmd0(bool)
 {
 }
 
-void IrCtrl::sendCmd1()
+void IrCtrl::sendCmd1(bool)
 {
 }
 
-void IrCtrl::sendCmd2()
+void IrCtrl::sendCmd2(bool)
 {
 }
 
-void IrCtrl::sendCmd3()
+void IrCtrl::sendCmd3(bool)
 {
 }
 
-void IrCtrl::sendCmd4()
+void IrCtrl::sendCmd4(bool)
 {
 }
 
-void IrCtrl::sendCmd5()
+void IrCtrl::sendCmd5(bool)
 {
 }
 
index 02308ba..aee214d 100644 (file)
@@ -1,18 +1,21 @@
 #ifndef IRCTRL_H
 #define IRCTRL_H
 
-class IrCtrl
+#include <QObject>
+
+class IrCtrl : public QObject
 {
+    Q_OBJECT
 public:
     IrCtrl();
 
 public slots:
-    void sendCmd0();
-    void sendCmd1();
-    void sendCmd2();
-    void sendCmd3();
-    void sendCmd4();
-    void sendCmd5();
+    void sendCmd0(bool);
+    void sendCmd1(bool);
+    void sendCmd2(bool);
+    void sendCmd3(bool);
+    void sendCmd4(bool);
+    void sendCmd5(bool);
 };
 
 #endif
index 9cfa5a4..05dc01e 100644 (file)
@@ -6,22 +6,21 @@
 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);
 }
index 8187e50..61f35f7 100644 (file)
@@ -3,6 +3,8 @@
 
 #include <QWidget>
 
+#include "irctrl.h"
+
 class QGridLayout;
 class QPushButton;