QFile write to specific line
Unsolved
General and Desktop
-
@Sucharek you can't, and thats universal, you can only write the whole file, or seek to a specific point and overwrite everything after it.
Therefore inserting a line of text, technically not possible.
But you could get the effect. -
@Sucharek said in QFile write to specific line:
what specific point?
Specific position in the file where next read/write operation will work
https://doc.qt.io/qt-5/qfiledevice.html#seek
But, as @J-Hilk wrote, you will overwrite what is at this position, not insert.
If you want to insert something you need to write the old content at the location where you're inserting after the inserted data.