Workspace 6.21.5
|
Convenience class for implementing CustomOperationProperties via its properties widget. More...
#include <Workspace/Presentation/customoperationproperties.h>
Public Member Functions | |
PropertiesViaWidget (OperationT &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 CustomOperationProperties * | propertiesViaWidget (OperationT &op) |
Related Functions inherited from CustomOperationProperties | |
template<typename WidgetT , typename OperationT > | |
CustomOperationProperties * | propertiesViaWidget (OperationT &op) |
WidgetT | The type for the widget that implements the required functionality (see below). |
OperationT | The type of operation to which the properties apply. |
When implementing a subclass of CustomOperationProperties, it is often convenient to delegate the implementation of applyChanges() and allowedToApplyChanges() to the widget created as part of the call to addProperties(). To be able to use this class template, the type WidgetT must meet three criteria:
|
inline |
|
inlineoverridevirtual |
dialog | The 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.
|
inlineoverridevirtual |
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:
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).
Implements CustomOperationProperties.
|
inlineoverridevirtual |
undoStack | The 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()
.
Implements CustomOperationProperties.