RAction vs. ROperation

Discussion forum for C++ and script developers who are using the QCAD development platform or who are looking to contribute to QCAD (translations, documentation, etc).

Moderator: andrew

Forum rules

Always indicate your operating system and QCAD version.

Attach drawing files, scripts and screenshots.

Post one question per topic.

Post Reply
User avatar
andrew
Site Admin
Posts: 9036
Joined: Fri Mar 30, 2007 6:07 am

RAction vs. ROperation

Post by andrew » Mon Nov 18, 2013 10:41 am

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?

User avatar
andrew
Site Admin
Posts: 9036
Joined: Fri Mar 30, 2007 6:07 am

Re: RAction vs. ROperation

Post by andrew » Mon Nov 18, 2013 10:47 am

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.

galed
Registered Member
Posts: 1
Joined: Sun Nov 24, 2013 11:59 pm

Re: RAction vs. ROperation

Post by galed » Mon Nov 25, 2013 7:07 pm

What about RGuiActions? They seem kind of redundant with RActions

How are ROperations rolled into the undo framework provided by the transaction stack?

User avatar
andrew
Site Admin
Posts: 9036
Joined: Fri Mar 30, 2007 6:07 am

Re: RAction vs. ROperation

Post by andrew » Tue Nov 26, 2013 10:27 am

galed wrote:What about RGuiActions? They seem kind of redundant with RActions
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.
How are ROperations rolled into the undo framework provided by the transaction stack?
ROperations typically trigger transactions (RTransaction) on a lower level. Transactions are undoable.

Post Reply

Return to “QCAD Programming, Script Programming and Contributing”