From a QCAD user:
In browsing the QCAD source, I've come across a little bit of confusion: I see RAction and ROperation, but I'm a little bit confused at the difference between them, and how they're related. Could you clarify?
RAction vs. ROperation
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.
Re: RAction vs. ROperation
RAction classes handle user interaction with a document. An action reacts to mouse clicks, coordinates that are being entered, etc.
Example for RAction implementations: File - Open, Zoom in, Draw line from two points and any other QCAD tool.
Actions are the 'glue' between the user inputs and the QCAD application.
ROperation classes encapsulate a modification that can be applied to a document.
Such an operation might add objects (entities, layers, blocks, ...), delete objects or modify objects.
Operations are a low level concept and would also exist in an application without user interface.
Example for RAction implementations: File - Open, Zoom in, Draw line from two points and any other QCAD tool.
Actions are the 'glue' between the user inputs and the QCAD application.
ROperation classes encapsulate a modification that can be applied to a document.
Such an operation might add objects (entities, layers, blocks, ...), delete objects or modify objects.
Operations are a low level concept and would also exist in an application without user interface.
Re: RAction vs. ROperation
What about RGuiActions? They seem kind of redundant with RActions
How are ROperations rolled into the undo framework provided by the transaction stack?
How are ROperations rolled into the undo framework provided by the transaction stack?
Re: RAction vs. ROperation
A GUI action (RGuiAction) represents an action in the user interface. A GUI action is typically visualized by a menu and optionally a tool button. RGuiActions can also be triggered through command input. RGuiAction is derived from QAction and serves the same purpose.galed wrote:What about RGuiActions? They seem kind of redundant with RActions
ROperations typically trigger transactions (RTransaction) on a lower level. Transactions are undoable.How are ROperations rolled into the undo framework provided by the transaction stack?