July 20, 2011

aabc aabc
Robot Herder
347 posts

[SOLVED] How can I delete the content of a file with Qt ?

 

How can I delete all the content of a file (I want to delete its content – not to delete the file) ?

4 replies

July 20, 2011

cincirin cincirin
Ant Farmer
456 posts

Open the file with QIODevice::Truncate flag.

July 20, 2011

stuk stuk
Ant Farmer
561 posts

Use QFile::resize() [doc.qt.nokia.com]

July 20, 2011

aabc aabc
Robot Herder
347 posts

Thanks!
That solved the problem.

July 20, 2011

Stavros Filippidis Stavros Filippidis
Lab Rat
388 posts

Kindly please edit the title of the thread to begin with [SOLVED]

;-)

 
  ‹‹ Getting the window title of a non Qt application      Querying iTunes COM object leads to QMutex::lock: Deadlock ››

You must log in to post a reply. Not a member yet? Register here!