Hi
While saving out the position, i use
out<<(qint32(textItem->pos().x()));
out<<(qint32(textItem->pos().y()));
qDebug() << (qint32(textItem->pos().x()));
qDebug() << (qint32(textItem->pos().y()));
out<<(qint32(textItem->pos().x()));
out<<(qint32(textItem->pos().y()));
qDebug() << (qint32(textItem->pos().x()));
qDebug() << (qint32(textItem->pos().y()));
To copy to clipboard, switch view to plain text mode
qDebug() returns the following values:
-----------------------------------------------------
478
46
276
366
While reading in,
qint32 px;
qint32 py;
in >> px;
in >> py;
qDebug() << px;
qDebug() << py;
.....
textItem->pos().setX(px);
textItem->pos().setY(py);
qint32 px;
qint32 py;
in >> px;
in >> py;
qDebug() << px;
qDebug() << py;
.....
textItem->pos().setX(px);
textItem->pos().setY(py);
To copy to clipboard, switch view to plain text mode
qDebug() returns the following erroneous values:
1075786547
858993459
0
0
I checked the sequence, am writing out and reading in proper order.Is my syntax for setting the coordinates correct ? What am i missing ?
Thank you
Bookmarks