Page 1 of 1

Clone object

PostPosted: Mon May 09, 2011 9:20 am
by mtfk
Hi,

Problem:
Clone object from database and save it with diffrent id as new object.

Question:
There is other possibility to do that then use qx::clone?
Because this works only with boost::shared_ptr and I have QSharedPointer.
How can I do this using QSharedPointer?

Thanks a lot for any proposition.

Re: Clone object

PostPosted: Mon May 09, 2011 10:48 am
by QxOrm admin
Hi,

"qx::clone() " function returns a "boost::shared_ptr<T>" object.

If you want a "QSharedPointer<T>" object, you can use this function : "qx::clone_to_qt_shared_ptr()".
If you don't want a smart-pointer, you can use this function : "qx::clone_to_nude_ptr()".