Page 1 of 1

Paste is exception

Posted: Sat Mar 26, 2016 10:30 am
by liguosheng
the actions of copy and cut are ok, when i paste the elentities by using the following code:
RPasteOperation *op = new RPasteOperation(getDocument()->getClipboard());
finally, the class of Rdocumentinterface is used to apply the operation by the following:
getDocumentInterface()->previewOperation(op);// it's preview

but there's a exception, when i debug it step by step, the exception happen to the following function:
RS::Unit RStorage::getUnit() const {
QSharedPointer<RDocumentVariables> v = queryDocumentVariablesDirect(); // exception happen
if (v.isNull()) {
return RS::None;
return v->getUnit();