I have added the code in the ExThreePoints.prototype.coordinateEvent and there are no errors during execution. The file is created, but it is empty.
Could anyone suggest me what is wrong with code, or point me to documentation where I could find answer?
Code: Select all
var fileName = "d:\\points.txt";
var file = new QFile(fileName);
var flags = new QIODevice.OpenMode(QIODevice.Append | QIODevice.Text);
if (!file.open(flags)) {
EAction.handleUserWarning("cannot open file: " + fileName);
this.terminate();
return;
}
EAction.handleUserMessage("exporting: " + fileName);
var stream = new QTextStream(file);
stream << "Result: " << pos.x << pos.y;
file.close();