QSocketNotifier help?
-
i created something like this :
@
import "fcntl.h"
// including othersint sock = open("/dev/ttyS0", O_RDWR);
Test::Test( QWidget * parent ) : QDialog(parent) {
setupUi(this);
QSocketNotifier *tmp = new QSocketNotifier(sock, QSocketNotifier::Read, this);
connect(tmp, SIGNAL(activated(int)), this, SLOT(readNow(int)));
}
void Test::readNow(int s) {
QMessageBox::information(this, "fsdfs", QString(tr("%1").arg(s)));
}
@problem is the signal not being emitted. btw, i based it here : http://stackoverflow.com/questions/789304/how-do-i-watch-a-serial-port-with-qsocketnotifier-linux