yagabey
24th January 2008, 08:21
Hello,
I want to check how many bytes are written on the port after I send an amount of data..
I connected bytesWritten signal of IODevice to a slot for viewing the amount of bytes written..
But when i print it on a textedit display, i see a value like:
-3617008641903833651
What does this mean? I was expecting something like 1024 (bytes)...
Here is the code:
Here I connected the slot to bytesWrittenSignal:
connect(serial, SIGNAL(QIODevice::bytesWritten(qint64)),this,SLOT( writtenBytes(qint64)));
That is the slot definition:
qint64 SerialPort::writtenBytes(qint64 bytes)
{
allWrittenBytes = bytes;
return bytes;
}
I printed it on QTextEdit.(I converted it to QString for compatibility)
qint64 writtenBytes_x;
writtenBytes_x = sp->allWrittenBytes;
QString writtenBytesString = QString::number(writtenBytes_x,10);
textEdit->append(writtenBytesString);
I want to check how many bytes are written on the port after I send an amount of data..
I connected bytesWritten signal of IODevice to a slot for viewing the amount of bytes written..
But when i print it on a textedit display, i see a value like:
-3617008641903833651
What does this mean? I was expecting something like 1024 (bytes)...
Here is the code:
Here I connected the slot to bytesWrittenSignal:
connect(serial, SIGNAL(QIODevice::bytesWritten(qint64)),this,SLOT( writtenBytes(qint64)));
That is the slot definition:
qint64 SerialPort::writtenBytes(qint64 bytes)
{
allWrittenBytes = bytes;
return bytes;
}
I printed it on QTextEdit.(I converted it to QString for compatibility)
qint64 writtenBytes_x;
writtenBytes_x = sp->allWrittenBytes;
QString writtenBytesString = QString::number(writtenBytes_x,10);
textEdit->append(writtenBytesString);