I'm trying to run a transaction but it has no effect:
... RTransaction t(document.getStorage(), QObject::tr("Set Layer Properties")); layer->setFrozen(false); layer->setLocked(false); t.addObject(layer, false); t.end(); ...
Transaction not applied
Moderator: andrew
Forum rules
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Always indicate your operating system and QCAD version.
Attach drawing files, scripts and screenshots.
Post one question per topic.
Transaction not applied
From a QCAD user:
Re: Transaction not applied
Transactions are usually only used on a lower level in QCAD (a transaction records all changes on a set of objects caused by an operation, i.e. when adding, deleting or modifying objects).
Operations are the concept used for more comfortable, higher level modifications:
Operations are the concept used for more comfortable, higher level modifications:
RModifyObjectsOperation op; op.addObject(layer); di->applyOperation(&op);This will update the document and also the views, layer lists, etc. accordingly. A transaction object is returned by applyOperation which contains information about objects that were changed.