Workspace 6.21.5
Public Member Functions | List of all members
ModifyGroupProperties Class Reference

#include <Workspace/Presentation/modifygrouppropertieswidget.h>

Inheritance diagram for ModifyGroupProperties:
[legend]

Public Member Functions

 ModifyGroupProperties (DataExecution::ModifyGroup &op)
 
void addProperties (OperationPropertiesDialog &dialog) override
 
bool allowedToApplyChanges () override
 
void applyChanges (QUndoStack &undoStack) override
 
- Public Member Functions inherited from CustomOperationProperties
virtual ~CustomOperationProperties ()=default
 
virtual void addProperties (OperationPropertiesDialog &dialog)=0
 
virtual bool allowedToApplyChanges ()=0
 
virtual void applyChanges (QUndoStack &undoStack)=0
 

Additional Inherited Members

- Static Public Member Functions inherited from CustomOperationProperties
template<typename WidgetT , typename OperationT >
static CustomOperationPropertiespropertiesViaWidget (OperationT &op)
 

Constructor & Destructor Documentation

◆ ModifyGroupProperties()

Member Function Documentation

◆ addProperties()

void addProperties ( OperationPropertiesDialog dialog)
overridevirtual
Parameters
dialogThe dialog to which the custom properties should be added.

Subclasses would normally implement this function by creating widget pages and adding them through OperationPropertiesDialog::addPropertyPage().

Implements CustomOperationProperties.

◆ allowedToApplyChanges()

bool allowedToApplyChanges ( )
overridevirtual
Returns
True if the custom properties as set in the dialog can be accepted/applied. If the subclass is going to return false, it should also present a message box to the user explaining why the changes cannot not be accepted.

Custom properties often relate to changes that are unsafe to make while a workspace is executing. If the subclass has this restriction, one of the first things that allowedToApplyChanges() would typically contain is code like the following:

return false;
static bool canAllowTask(DataExecution::Updatable &updatable, bool promptAndStop=true)
Definition: stillexecutingchecker.cpp:60

where op_ is a private member variable holding a reference to the operation in question. What the above will do is check for execution and ask the user if they want to stop it or cancel the current task (in this case changing the properties).

Note
This function must not try to apply the property changes. It should only check to see if the changes could be applied.
See also
applyChanges()

Implements CustomOperationProperties.

◆ applyChanges()

void applyChanges ( QUndoStack &  undoStack)
overridevirtual
Parameters
undoStackThe stack onto which the undoable commands must be pushed. The caller is responsible for ensuring that undoStack is appropriate for this object's operation.

This function will be called when the caller requires the object's custom properties to be saved to the operation. The operation's custom properties cannot be manipulated directly, they must only be changed through undoable events pushed onto the undoStack provided. Note that the command(s) pushed onto the undoStack will appear as separate command(s) to the one used to change the general properties, so the name of the undoable command(s) should be chosen with this in mind. If more than one undoable command will be pushed on to the undoStack, it is recommended that they be grouped into a single logical command with undoStack.beginMacro() and undoStack.endMacro().

See also
allowedToApplyChanges()

Implements CustomOperationProperties.