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

This is a QDialog subclass that is aware of the undo-redo sub-system. More...

#include <pqDialog.h>

Inheritance diagram for pqDialog:
Inheritance graph
[legend]

Signals

void beginUndo (const QString &)
 Fired when dialog begins undo-able changes. More...
 
void endUndo ()
 Fired when dialog is done with undo-able changes. More...
 

Public Member Functions

 pqDialog (QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags{})
 
 ~pqDialog () override
 
void setUndoLabel (const QString &label)
 Set the label used for undo command. More...
 
void accept () override
 
void done (int r) override
 

Protected Member Functions

virtual void acceptInternal ()
 Subclassess should override this instead of accept();. More...
 
virtual void doneInternal (int)
 Subclassess should override this instead of done(). More...
 

Protected Attributes

QString UndoLabel
 

Detailed Description

This is a QDialog subclass that is aware of the undo-redo sub-system.

Many dialogs show information about server manager objects. The user can change the information and then when he/she hits "Accept" or "Apply", we change the underlying server manager object(s). For this change to be undoable, it is essential that the undo set generation is commenced before doing any changes to the server manager. This manages the start/end of building the undo stack for us. For any such dialogs, instead of using a QDialog, one should simply use this. One can use the accepted(), finished() signals safely to perform any changes to the server manager. However, is should not override the accept() or done() methods, instead one should override acceptInternal() or doneInternal().

Definition at line 25 of file pqDialog.h.

Constructor & Destructor Documentation

◆ pqDialog()

pqDialog::pqDialog ( QWidget *  parent = nullptr,
Qt::WindowFlags  f = Qt::WindowFlags{} 
)

◆ ~pqDialog()

pqDialog::~pqDialog ( )
override

Member Function Documentation

◆ setUndoLabel()

void pqDialog::setUndoLabel ( const QString &  label)
inline

Set the label used for undo command.

Definition at line 37 of file pqDialog.h.

◆ beginUndo

void pqDialog::beginUndo ( const QString &  )
signal

Fired when dialog begins undo-able changes.

Should be connected to undo-redo stack builder.

◆ endUndo

void pqDialog::endUndo ( )
signal

Fired when dialog is done with undo-able changes.

Should be connected to the undo-redo stack builder.

◆ accept()

void pqDialog::accept ( )
override

◆ done()

void pqDialog::done ( int  r)
override

◆ acceptInternal()

virtual void pqDialog::acceptInternal ( )
inlineprotectedvirtual

Subclassess should override this instead of accept();.

Definition at line 60 of file pqDialog.h.

◆ doneInternal()

virtual void pqDialog::doneInternal ( int  )
inlineprotectedvirtual

Subclassess should override this instead of done().

Definition at line 65 of file pqDialog.h.

Member Data Documentation

◆ UndoLabel

QString pqDialog::UndoLabel
protected

Definition at line 67 of file pqDialog.h.


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