Public Slots | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
pqProgressManager Class Reference

pqProgressManager is progress manager. More...

#include <pqProgressManager.h>

Inherits QObject.

Public Slots

void setProgress (const QString &message, int progress)
 Update progress. More...
 
void setEnableProgress (bool)
 Enables progress. More...
 
void beginProgress ()
 Convenience slots that simply call setEnableProgress(). More...
 
void endProgress ()
 
void setEnableAbort (bool)
 Enables abort. More...
 
void triggerAbort ()
 fires abort(). More...
 
bool unblockEvents (bool val)
 While progress is enabled, pqProgressManager blocks key/mouse events, except for objects added using addNonBlockableObject. More...
 

Signals

void abort ()
 Emitted to trigger an abort. More...
 
void progress (const QString &message, int progress)
 
void enableProgress (bool)
 
void enableAbort (bool)
 
void progressStartEvent ()
 
void progressEndEvent ()
 

Public Member Functions

 pqProgressManager (QObject *parent=nullptr)
 
 ~pqProgressManager () override
 
void lockProgress (QObject *object)
 Locks progress to respond to progress signals set by the object alone. More...
 
void unlockProgress (QObject *object)
 Releases the progress lock. More...
 
bool isLocked () const
 Returns if the progress is currently locked by any object. More...
 
void addNonBlockableObject (QObject *o)
 When progress is enabled, the manager eats all mouse and key events fired except for those objects which are in the non-blockable list. More...
 
void removeNonBlockableObject (QObject *o)
 
const QList< QPointer< QObject > > & nonBlockableObjects () const
 Returns the list of non-blockable objects. More...
 

Protected Slots

void onStartProgress ()
 callbacks for signals fired from vtkProcessModule. More...
 
void onEndProgress ()
 
void onProgress (vtkObject *)
 
void onServerAdded (pqServer *)
 

Protected Member Functions

bool eventFilter (QObject *obj, QEvent *event) override
 Filter QApplication events. More...
 

Protected Attributes

QPointer< QObject > Lock
 
QList< QPointer< QObject > > NonBlockableObjects
 
int ProgressCount
 
bool InUpdate
 
bool EnableProgress
 
bool ReadyEnableProgress
 
bool UnblockEvents
 

Detailed Description

pqProgressManager is progress manager.

It centralizes progress raising/ handling. Provides ability for any object to lock progress so that only progress fired by itself will be notified to the rest of the world. Also, when progress is enabled, it disables handling of mouse/key events except on those objects in the NonBlockableObjects list.

Definition at line 21 of file pqProgressManager.h.

Constructor & Destructor Documentation

◆ pqProgressManager()

pqProgressManager::pqProgressManager ( QObject *  parent = nullptr)

◆ ~pqProgressManager()

pqProgressManager::~pqProgressManager ( )
override

Member Function Documentation

◆ lockProgress()

void pqProgressManager::lockProgress ( QObject *  object)

Locks progress to respond to progress signals set by the object alone.

All signals sent by other objects are ignored until Unlock is called.

◆ unlockProgress()

void pqProgressManager::unlockProgress ( QObject *  object)

Releases the progress lock.

◆ isLocked()

bool pqProgressManager::isLocked ( ) const

Returns if the progress is currently locked by any object.

◆ addNonBlockableObject()

void pqProgressManager::addNonBlockableObject ( QObject *  o)
inline

When progress is enabled, the manager eats all mouse and key events fired except for those objects which are in the non-blockable list.

This is the API to add/remove non-blockable objects.

Definition at line 49 of file pqProgressManager.h.

◆ removeNonBlockableObject()

void pqProgressManager::removeNonBlockableObject ( QObject *  o)
inline

Definition at line 50 of file pqProgressManager.h.

◆ nonBlockableObjects()

const QList<QPointer<QObject> >& pqProgressManager::nonBlockableObjects ( ) const
inline

Returns the list of non-blockable objects.

Definition at line 55 of file pqProgressManager.h.

◆ eventFilter()

bool pqProgressManager::eventFilter ( QObject *  obj,
QEvent *  event 
)
overrideprotected

Filter QApplication events.

◆ setProgress

void pqProgressManager::setProgress ( const QString &  message,
int  progress 
)
slot

Update progress.

The progress must be enbled by calling enableProgress(true) before calling this method for the progress to be updated.

◆ setEnableProgress

void pqProgressManager::setEnableProgress ( bool  )
slot

Enables progress.

◆ beginProgress

void pqProgressManager::beginProgress ( )
inlineslot

Convenience slots that simply call setEnableProgress().

Definition at line 79 of file pqProgressManager.h.

◆ endProgress

void pqProgressManager::endProgress ( )
inlineslot

Definition at line 80 of file pqProgressManager.h.

◆ setEnableAbort

void pqProgressManager::setEnableAbort ( bool  )
slot

Enables abort.

◆ triggerAbort

void pqProgressManager::triggerAbort ( )
slot

fires abort().

Must be called by the GUI that triggers abort.

◆ unblockEvents

bool pqProgressManager::unblockEvents ( bool  val)
slot

While progress is enabled, pqProgressManager blocks key/mouse events, except for objects added using addNonBlockableObject.

Sometimes it's not possible to add objects explicitly and we may want to temporarily skip blocking of events. This methods can be used for that e.g.

bool prev = progressManager->unblockEvents(true);
QMessageBox::question(....);
progressManager->unblockEvents(prev);
Returns
previous value.

◆ abort

void pqProgressManager::abort ( )
signal

Emitted to trigger an abort.

◆ progress

void pqProgressManager::progress ( const QString &  message,
int  progress 
)
signal

◆ enableProgress

void pqProgressManager::enableProgress ( bool  )
signal

◆ enableAbort

void pqProgressManager::enableAbort ( bool  )
signal

◆ progressStartEvent

void pqProgressManager::progressStartEvent ( )
signal

◆ progressEndEvent

void pqProgressManager::progressEndEvent ( )
signal

◆ onStartProgress

void pqProgressManager::onStartProgress ( )
protectedslot

callbacks for signals fired from vtkProcessModule.

◆ onEndProgress

void pqProgressManager::onEndProgress ( )
protectedslot

◆ onProgress

void pqProgressManager::onProgress ( vtkObject )
protectedslot

◆ onServerAdded

void pqProgressManager::onServerAdded ( pqServer )
protectedslot

Member Data Documentation

◆ Lock

QPointer<QObject> pqProgressManager::Lock
protected

Definition at line 133 of file pqProgressManager.h.

◆ NonBlockableObjects

QList<QPointer<QObject> > pqProgressManager::NonBlockableObjects
protected

Definition at line 134 of file pqProgressManager.h.

◆ ProgressCount

int pqProgressManager::ProgressCount
protected

Definition at line 135 of file pqProgressManager.h.

◆ InUpdate

bool pqProgressManager::InUpdate
protected

Definition at line 136 of file pqProgressManager.h.

◆ EnableProgress

bool pqProgressManager::EnableProgress
protected

Definition at line 138 of file pqProgressManager.h.

◆ ReadyEnableProgress

bool pqProgressManager::ReadyEnableProgress
protected

Definition at line 139 of file pqProgressManager.h.

◆ UnblockEvents

bool pqProgressManager::UnblockEvents
protected

Definition at line 140 of file pqProgressManager.h.


The documentation for this class was generated from the following file: