This is a very bad idea, someone who suggested you the idea didn't know what he was talking about. QFile is a QObject which can't be copied around safely. Do not do this or sooner or later you will run into problems. QObjects are identity based and not value based, don't copy them. There is a point why operator= and copy constructor of all QObject subclasses are private.
Bookmarks