in function
void QespTest::transmitMsg()
{
int i= port->write( j.toAscii(), j.length() );
qDebug( "trasmitted : %s", i );
}
void QespTest::transmitMsg()
{
QString j=rand()%1000;
int i= port->write( j.toAscii(), j.length() );
qDebug( "trasmitted : %s", i );
}
To copy to clipboard, switch view to plain text mode
when you use QString j=rand()%1000; you call
QString::QString ( const QChar * unicode, int size )
To copy to clipboard, switch view to plain text mode
constructor which call
QChar ( int code )
To copy to clipboard, switch view to plain text mode
and its the reason why you get ASCII values, not integer
use it to get integer
int a = qrand() % 1000;
int a = qrand() % 1000;
QString j( QString::number( a ) );
To copy to clipboard, switch view to plain text mode
Bookmarks