Quote Originally Posted by sonulohani View Post
Okay, point out the line that is causing memory leak in my code.
Qt Code:
  1. ...
  2. if (!file->open(QIODevice::WriteOnly | QIODevice::Text))
  3. return; //memoy leak if a file can't be opened
  4. ...
To copy to clipboard, switch view to plain text mode 
The simplest way to fix this without using delete it's just provide a parent in QFile's ctor.