[Development] QFile: writing via a temporary file

Stephen Kelly stephen.kelly at kdab.com
Sat Jan 7 16:56:19 CET 2012


On Friday, January 06, 2012 19:09:26 Thiago Macieira wrote:
> If the method accepted a QFile pointer before, then a class derived from
> QFile  will automatically downcast to the type.

This could be a downcast-vs-upcast definition mismatch in your understandings?

I think David is saying that a method which takes a QFile* would have to 
qobject_cast<QSaveFile*>(file) to call its rollback method if it were a 
separate class.

Of course it's also common to have methods that do writing to take a 
QIODevice*. Does it make any sense to add a virtual rollback() to that (which 
obviously would do nothing in many overrides)?

Thanks,

-- 
Stephen Kelly <stephen.kelly at kdab.com> | Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-Independent Software Solutions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120107/d743cfe1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120107/d743cfe1/attachment.sig>


More information about the Development mailing list