Workspace 6.21.5
Signals | Public Member Functions | Protected Member Functions | List of all members
DelayedAction Class Referenceabstract

Delay some action until control is returned to the event loop. More...

#include <Workspace/Presentation/delayedaction.h>

Inherits QObject.

Signals

void trigger ()
 

Public Member Functions

 DelayedAction (QObject *parent=nullptr)
 

Protected Member Functions

virtual void doAction ()=0
 

Detailed Description

This class is most useful for carrying out an action that deletes an object as part of responding to some event. Qt disallows objects from deleting themselves while processing an event, so this class provides a mechanism to delay such a deletion until it is safe to do so without having to resort to deleteLater(). The other advantage of the DelayedAction class is it can perform whatever processing the subclass wants, not just deletion.

Constructor & Destructor Documentation

◆ DelayedAction()

DelayedAction ( QObject *  parent = nullptr)

The constructor sets up a queued connection and then immediately emits the signal that triggers that connection. The effect of this is that the action will be triggered when the event loop next gets a chance to process events.

Member Function Documentation

◆ doAction()

virtual void doAction ( )
protectedpure virtual

◆ trigger

void trigger ( )
signal