CTK 0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Loading...
Searching...
No Matches
ctkWorkflowButtonBoxWidget.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Library: CTK
4
5 Copyright (c) Kitware Inc.
6
7 Licensed under the Apache License, Version 2.0 (the "License");
8 you may not use this file except in compliance with the License.
9 You may obtain a copy of the License at
10
11 http://www.apache.org/licenses/LICENSE-2.0.txt
12
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
18
19=========================================================================*/
20
21#ifndef __ctkWorkflowButtonBoxWidget_h
22#define __ctkWorkflowButtonBoxWidget_h
23
24// QT includes
25#include <QBoxLayout>
26#include <QWidget>
27
28// CTK includes
29#include "ctkPimpl.h"
30#include "ctkWidgetsExport.h"
31class ctkPushButton;
32class ctkWorkflow;
33class ctkWorkflowStep;
34
35class ctkWorkflowButtonBoxWidgetPrivate;
36
49
50class CTK_WIDGETS_EXPORT ctkWorkflowButtonBoxWidget : public QWidget
51{
52 Q_OBJECT
53
58 Q_PROPERTY(QString backButtonFormat
59 READ backButtonFormat WRITE setBackButtonFormat)
60
61
65 Q_PROPERTY(QString nextButtonFormat
66 READ nextButtonFormat WRITE setNextButtonFormat)
67
73 Q_PROPERTY(QString goToButtonsFormat
74 READ goToButtonsFormat WRITE setGoToButtonsFormat)
75
79 Q_PROPERTY(bool hideGoToButtons READ hideGoToButtons WRITE setHideGoToButtons)
80
84 Q_PROPERTY(bool hideInvalidButtons READ hideInvalidButtons WRITE setHideInvalidButtons)
85
86public:
87 typedef QWidget Superclass;
88 explicit ctkWorkflowButtonBoxWidget(ctkWorkflow* newWorkflow, QWidget* newParent = 0);
89 explicit ctkWorkflowButtonBoxWidget(QWidget* newParent = 0);
91
93 ctkWorkflow* workflow()const;
94
96 void setWorkflow(ctkWorkflow * newWorkflow);
97
99 Q_INVOKABLE ctkPushButton* backButton()const;
100
103 QString backButtonFormat()const;
104
107 void setBackButtonFormat(const QString& format);
108
110 Q_INVOKABLE ctkPushButton* nextButton()const;
111
114 QString nextButtonFormat()const;
115
118 void setNextButtonFormat(const QString& format);
119
122 QString goToButtonsFormat()const;
123
126 void setGoToButtonsFormat(const QString& format);
127
129 QList<ctkPushButton*> goToButtons()const;
130
133 QBoxLayout::Direction direction()const;
134 void setDirection(const QBoxLayout::Direction& newDirection);
135
138 bool hideGoToButtons()const;
141 void setHideGoToButtons(bool hide);
142
145 bool hideInvalidButtons()const;
146 void setHideInvalidButtons(bool newHide);
147
148public Q_SLOTS:
151 virtual void updateButtons(ctkWorkflowStep* currentStep);
152
153protected Q_SLOTS:
156 virtual void prepareGoToStep();
157
158protected:
159 QScopedPointer<ctkWorkflowButtonBoxWidgetPrivate> d_ptr;
160
161private:
162 Q_DECLARE_PRIVATE(ctkWorkflowButtonBoxWidget);
163 Q_DISABLE_COPY(ctkWorkflowButtonBoxWidget);
164
165};
166
167#endif
168
A widget that controls a workflow.
ctkWorkflowStep is the basis for a workflow step.
ctkWorkflow is the basis for a workflow engine, i.e. a state machine with enhancements to support ctk...
Definition ctkWorkflow.h:40