about kde4's smart pointer
rodda at kde.org
Wed Oct 4 02:11:01 BST 2006
On Tuesday 03 October 2006 23:58, Cyrille Berger wrote:
> 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
Size: 189 bytes
Desc: not available
More information about the kde-core-devel