The following code I am using to find the number of read bytes from QFile. With some files it gives the correct file size, but with some files it gives me a value that is approximatively fileCSV.size()/2. I am sending two files that have same number of characters in it files..zip, but have different file sizes. Should i use some other objects for reading the QFile?
Qt Code:
emit errorOccurredReadingCSV(this); int fileCSVSize = fileCSV.size()); qint64 reconstructedCSVFileSize = 0; while ( !textStreamCSV.atEnd() ) { if (!line.isEmpty()) { reconstructedCSVFileSize += line.size(); //this doesn't work always reconstructedCSVFileSize += 2; } else reconstructedCSVFileSize += 2; }To copy to clipboard, switch view to plain text mode
I know that reading the size of QString is wrong, give me some other solutions if you can.
Thank you.
Bookmarks