CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Types | Public Slots | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Properties | List of all members
ctkWorkflowWidget Class Reference

ctkWorkflowWidget is the basis for a workflow with a user interface. It groups together and manages a ctkWorkflowGroupBox (to display the step) and a ctkWorkflowButtonBoxWidget (providing buttons for traversing the workflow). More...

#include <Libs/Widgets/ctkWorkflowWidget.h>

Inheritance diagram for ctkWorkflowWidget:
Inheritance graph
[legend]
Collaboration diagram for ctkWorkflowWidget:
Collaboration graph
[legend]

Public Types

typedef QWidget Superclass
 

Public Slots

virtual void onCurrentStepChanged (ctkWorkflowStep *currentStep)
 

Public Member Functions

Q_INVOKABLE ctkWorkflowButtonBoxWidgetbuttonBoxWidget () const
 Get the widget with the 'next', 'back' and 'goTo' buttons. More...
 
 ctkWorkflowWidget (QWidget *parent=0)
 
void setShowButtonBoxWidget (bool newShowButtonBoxWidget)
 
virtual Q_INVOKABLE void setWorkflow (ctkWorkflow *newWorkflow)
 
bool showButtonBoxWidget () const
 Set/get whether or not to associate a buttonBoxWidget with this step (default true) More...
 
Q_INVOKABLE ctkWorkflowWidgetStepwidgetStep (const QString &id) const
 
virtual Q_INVOKABLE ctkWorkflowworkflow () const
 Set/get the workflow associated with this widget. More...
 
virtual Q_INVOKABLE ctkWorkflowGroupBoxworkflowGroupBox () const
 
virtual ~ctkWorkflowWidget ()
 

Static Public Member Functions

static void formatButton (QAbstractButton *button, const QString &format, ctkWorkflowWidgetStep *step)
 
static QString formatText (const QString &format, ctkWorkflowWidgetStep *step)
 

Protected Slots

void onStepRegistered (ctkWorkflowStep *step)
 

Protected Member Functions

void updateButtonBoxUI (ctkWorkflowStep *currentStep)
 
virtual void updateStepUI (ctkWorkflowStep *currentStep)
 

Static Protected Member Functions

static QVariant buttonItem (QString formatItem, ctkWorkflowWidgetStep *step)
 
static QMap< QString, QVariant > parse (const QString &format, ctkWorkflowWidgetStep *step)
 

Protected Attributes

QScopedPointer< ctkWorkflowWidgetPrivate > d_ptr
 

Properties

bool showButtonBoxWidget
 

Detailed Description

ctkWorkflowWidget is the basis for a workflow with a user interface. It groups together and manages a ctkWorkflowGroupBox (to display the step) and a ctkWorkflowButtonBoxWidget (providing buttons for traversing the workflow).

Definition at line 44 of file ctkWorkflowWidget.h.

Member Typedef Documentation

◆ Superclass

Definition at line 50 of file ctkWorkflowWidget.h.

Constructor & Destructor Documentation

◆ ctkWorkflowWidget()

ctkWorkflowWidget::ctkWorkflowWidget ( QWidget *  parent = 0)
explicit

◆ ~ctkWorkflowWidget()

virtual ctkWorkflowWidget::~ctkWorkflowWidget ( )
virtual

Member Function Documentation

◆ buttonBoxWidget()

Q_INVOKABLE ctkWorkflowButtonBoxWidget* ctkWorkflowWidget::buttonBoxWidget ( ) const

Get the widget with the 'next', 'back' and 'goTo' buttons.

◆ buttonItem()

static QVariant ctkWorkflowWidget::buttonItem ( QString  formatItem,
ctkWorkflowWidgetStep step 
)
staticprotected

Return the value of the formatItem.

See also
format()

◆ formatButton()

static void ctkWorkflowWidget::formatButton ( QAbstractButton *  button,
const QString &  format,
ctkWorkflowWidgetStep step 
)
static

Apply the text, icon and tooltip format to the button.

  • {PROP}, [prop] or (PROP): value of the PROP property (e.g. stepid, name, description...) used as button text, icon or tooltip respectively. PROP can be prefixed by 'back:', 'next:' or 'current:', the property will then be the one of the previous, next or current step.
  • [<-]: Back arrow icon. If it is the first item, the icon is to the left of the button text.
  • [->]: Next arrow icon. If it is the last item, the icon is to the right of the button text if the button is a ctkPushButton.
  • {#} or (#): 1-based index of the step (int)
  • {!#} or {!#} : Total number of steps (int)
  • "ABCD": text for the button
  • {PROP|"ABCD"}: Use ABCD as fallback if PROP is not a valid property or if the text is empty.

Examples: "{next:#}"/"{!#}") "{next:name}(next:description)[->]" will format the button with:

  • text="3/3) Compute Algorithm" if the next step is the last step of a 3-step-workflow, and its name is "Compute Algorithm".
  • icon=QStyle::SP_ArrowRight
  • tooltip="This step computes the algorithm" if the next step description is "This step...".
    See also
    parse(), formatText()

◆ formatText()

static QString ctkWorkflowWidget::formatText ( const QString &  format,
ctkWorkflowWidgetStep step 
)
static

Return the text contained in format.

See also
parse(), formatButton()

◆ onCurrentStepChanged

virtual void ctkWorkflowWidget::onCurrentStepChanged ( ctkWorkflowStep currentStep)
virtualslot

Triggers updates of the the workflowGroupBox and the buttonBoxWidget when the current workflow step has changed.

◆ onStepRegistered

void ctkWorkflowWidget::onStepRegistered ( ctkWorkflowStep step)
protectedslot

◆ parse()

static QMap<QString, QVariant> ctkWorkflowWidget::parse ( const QString &  format,
ctkWorkflowWidgetStep step 
)
staticprotected

Return a dictionary of formats. Keys can be 'text', 'icon', 'iconalignment' or 'tooltip'.

See also
buttonItem(), formatButton(), formatText()

◆ setShowButtonBoxWidget()

void ctkWorkflowWidget::setShowButtonBoxWidget ( bool  newShowButtonBoxWidget)

◆ setWorkflow()

virtual Q_INVOKABLE void ctkWorkflowWidget::setWorkflow ( ctkWorkflow newWorkflow)
virtual

◆ showButtonBoxWidget()

bool ctkWorkflowWidget::showButtonBoxWidget ( ) const

Set/get whether or not to associate a buttonBoxWidget with this step (default true)

◆ updateButtonBoxUI()

void ctkWorkflowWidget::updateButtonBoxUI ( ctkWorkflowStep currentStep)
protected

◆ updateStepUI()

virtual void ctkWorkflowWidget::updateStepUI ( ctkWorkflowStep currentStep)
protectedvirtual

Reimplemented in ctkWorkflowAbstractPagedWidget.

◆ widgetStep()

Q_INVOKABLE ctkWorkflowWidgetStep* ctkWorkflowWidget::widgetStep ( const QString &  id) const

◆ workflow()

virtual Q_INVOKABLE ctkWorkflow* ctkWorkflowWidget::workflow ( ) const
virtual

Set/get the workflow associated with this widget.

◆ workflowGroupBox()

virtual Q_INVOKABLE ctkWorkflowGroupBox* ctkWorkflowWidget::workflowGroupBox ( ) const
virtual

Get the widget constaining the title, subtitle, pre-text, post-text, error-text and client area layout.

Member Data Documentation

◆ d_ptr

QScopedPointer<ctkWorkflowWidgetPrivate> ctkWorkflowWidget::d_ptr
protected

Definition at line 123 of file ctkWorkflowWidget.h.

Property Documentation

◆ showButtonBoxWidget

bool ctkWorkflowWidget::showButtonBoxWidget
readwrite

Definition at line 1 of file ctkWorkflowWidget.h.


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