jjbabu
6th November 2008, 09:07
Hi,
I have a function like below
void Class Name::stop()
{
QByteArray p("A008@");
port->open(QIODevice::ReadWrite);
port->write(p);
port->close();
}
when i cal the function directly(like this stop();),The data is going to port and that will be collected at the other end.
But the problem is when i call like below,
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(stop()));
timer->start(1000);
nothing is going from the port,am not able to collect the data at other end.
What is the problem with that above code?
can anybody help me on this issue
thanks a lot.
I have a function like below
void Class Name::stop()
{
QByteArray p("A008@");
port->open(QIODevice::ReadWrite);
port->write(p);
port->close();
}
when i cal the function directly(like this stop();),The data is going to port and that will be collected at the other end.
But the problem is when i call like below,
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(stop()));
timer->start(1000);
nothing is going from the port,am not able to collect the data at other end.
What is the problem with that above code?
can anybody help me on this issue
thanks a lot.