Closed GoogleCodeExporter closed 9 years ago
Sorry for late response.
staff::Optional and staff::Nillable are intended as strong pointers, you must
have instance of Optional or Nillable to hold and access the real object.
Regarding example code you provided:
1. QPointer (Qt's) can only hold objects which is inherited from QObject.
2. staff::Optional nor staff::Nillable can't hold classes derived from QObject,
because QObject's are non-copyable (unless you only use Get operation).
3. QPointer is only guard to pointer, it does not destruct the object when it
leave scope.
After calling
{{{
person = personService->RetrieveByPk(call).RetrieveByPkResult.Get()
}}}
person will remain NULL, because temporary Optional object will be destructed
after that line. And QPointer will set internal pointer to object to NULL.
Really staff_codegen generated code even can't manage objects derived from
QObject.
Original comment by loentar
on 12 Sep 2014 at 7:22
This issue was closed by revision r875.
Original comment by loentar
on 15 Oct 2014 at 8:05
Original issue reported on code.google.com by
rafaelpi...@gmail.com
on 30 Apr 2014 at 6:40