Hi, Anisha.
You can provide you own signal and appropriate slot for it.
For example
class CJoistikReader
: public QObject{
Q_OBJECT
public:
signals:
//you can emmit this signal, with button's id when appropriate button of joystik is pressed
void evButtonPressed(int button_id);
//-------- other methods and members of class -----
};
class CJoistikSignalReciver
: public QObject{
Q_OBJECT
public:
CJoistikSignalReciver
(QObject*parent
=0);
public slots:
// connect this slot to CJoistikReader::evButtonPressed(int) signal and process pressing
void processPressingButton(int button_id);
//-------- other methods and members of class -----
};
class CJoistikReader : public QObject
{
Q_OBJECT
public:
CJoistikReader(QObject*parent=0);
signals:
//you can emmit this signal, with button's id when appropriate button of joystik is pressed
void evButtonPressed(int button_id);
//-------- other methods and members of class -----
};
class CJoistikSignalReciver : public QObject
{
Q_OBJECT
public:
CJoistikSignalReciver(QObject*parent=0);
public slots:
// connect this slot to CJoistikReader::evButtonPressed(int) signal and process pressing
void processPressingButton(int button_id);
//-------- other methods and members of class -----
};
To copy to clipboard, switch view to plain text mode
In QtGui model (though QApplication eventLoop) EVENTs (not signals) sending during about keyboadr and mouse manipulating (EKeyPressEvent, EMousePressEvent and so on). See QWidget documentation.
Bookmarks