about kde4's smart pointer

Hamish Rodda rodda at kde.org
Wed Oct 4 02:11:01 BST 2006

On Tuesday 03 October 2006 23:58, Cyrille Berger wrote:
> Hello
> Can we have the kde3 behaviour back for smart pointer ? The new one is
> really painfull. We use them a lot in krita, and what we want is them to be
> use transparently as if they were "normal" pointers.
> I mean for instance:
> typedef KSharedPtr<KisPaintDevice> KisPaintDeviceSP;
> typedef KSharedPtr<KisDevice> KisDeviceSP;
> KisPaintDeviceSP pd = KisPaintDeviceSP(new KisPaintDevice());

> KisDeviceSP d = KisDeviceSP( pd.data()); // Assuming that KisPaintDevice
> inherits from KisDevice

here you want KisDeviceSP d = KisDeviceSP::staticCast( pd );

Or dynamicCast, if you're going the other way.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20061004/f1ea3e6f/attachment.sig>

More information about the kde-core-devel mailing list