hi,
using this sample code :
QString date = QDate::currentDate().toString("dd/MM/yy");
QByteArray block;
QDataStream out(&block, QIODevice::WriteOnly);
out.setByteOrder(QDataStream::LittleEndian);
out.setVersion(QDataStream::Qt_4_0);
To copy to clipboard, switch view to plain text mode
* test 1 :
out << date.toAscii(); // size = 12
qDebug() << "size = " << block.size();
out << date.toAscii(); // size = 12
qDebug() << "size = " << block.size();
To copy to clipboard, switch view to plain text mode
* test 2 :
out << qPrintable(date); // size = 13
qDebug() << "size = " << block.size();
out << qPrintable(date); // size = 13
qDebug() << "size = " << block.size();
To copy to clipboard, switch view to plain text mode
* test 3 :
out << date; // size = 20
qDebug() << "size = " << block.size();
out << date; // size = 20
qDebug() << "size = " << block.size();
To copy to clipboard, switch view to plain text mode
i expected to find (or would find) size = 8 like :
block[0] = 'd'
block[1] = 'd'
block[2] = '/'
block[3] = 'M'
block[4] = 'M'
block[5] = '/'
block[6] = 'y'
block[7] = 'y'
any clarifications for me ?
cheers,
Fathi
Bookmarks