CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkCmdLineModuleFrontendQtGui.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  Library: CTK
4 
5  Copyright (c) German Cancer Research Center,
6  Division of Medical and Biological Informatics
7 
8  Licensed under the Apache License, Version 2.0 (the "License");
9  you may not use this file except in compliance with the License.
10  You may obtain a copy of the License at
11 
12  http://www.apache.org/licenses/LICENSE-2.0
13 
14  Unless required by applicable law or agreed to in writing, software
15  distributed under the License is distributed on an "AS IS" BASIS,
16  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  See the License for the specific language governing permissions and
18  limitations under the License.
19 
20 =============================================================================*/
21 
22 #ifndef CTKCMDLINEMODULEFRONTENDQTGUI_H
23 #define CTKCMDLINEMODULEFRONTENDQTGUI_H
24 
26 
27 #include "ctkCommandLineModulesFrontendQtGuiExport.h"
28 
31 
32 class QUiLoader;
33 class QWidget;
34 
35 struct ctkCmdLineModuleFrontendQtGuiPrivate;
36 
123 class CTK_CMDLINEMODULEQTGUI_EXPORT ctkCmdLineModuleFrontendQtGui : public ctkCmdLineModuleFrontend
124 {
125 
126 public:
127 
130 
131  // ctkCmdLineModuleFrontend overrides
132 
139  virtual QObject* guiHandle() const;
140 
153  virtual QVariant value(const QString& parameter, int role = LocalResourceRole) const;
154 
167  virtual void setValue(const QString& parameter, const QVariant& value, int role = DisplayRole);
168 
170 
178  virtual void setParameterContainerEnabled(const bool& enabled);
179 
180 protected:
181 
191  virtual QUiLoader* uiLoader() const;
192 
203 
215  QVariant customValue(const QString& parameter, const QString& propertyName = QString()) const;
216 
228  void setCustomValue(const QString& parameter, const QVariant& value, const QString& propertyName = QString()) ;
229 
230 private:
231 
232  QScopedPointer<ctkCmdLineModuleFrontendQtGuiPrivate> d;
233 
234 };
235 
236 #endif // CTKCMDLINEMODULEFRONTENDQTGUI_H
A Qt based implementation of the module front end.
virtual ctkCmdLineModuleXslTransform * xslTransform() const
Get XSL transform used to transfrom the module XML description to a Qt .ui file.
ctkCmdLineModuleFrontendQtGui(const ctkCmdLineModuleReference &moduleRef)
virtual QUiLoader * uiLoader() const
Get the QUiLoader for instantiating widgets.
virtual void setValue(const QString &parameter, const QVariant &value, int role=DisplayRole)
Sets the parameter value.
virtual void setParameterContainerEnabled(const bool &enabled)
There is a container QWidget within each group box, so you can set the container widget to enabled/di...
void setCustomValue(const QString &parameter, const QVariant &value, const QString &propertyName=QString())
Set the value of the given parameter to value using the given property name.
virtual QVariant value(const QString &parameter, int role=LocalResourceRole) const
Retrieves the current parameter value using the default QObject property for parameter values.
QVariant customValue(const QString &parameter, const QString &propertyName=QString()) const
Get the value of the given parameter using the given property name.
virtual QList< QString > parameterNames() const
Returns a list of all valid parameter names.
virtual QObject * guiHandle() const
Create the actual Qt GUI.
Abstract base class for all front-end command line module implementations.
Defines a reference or handle to a module, including location, XML, description and access to the ass...
Transforms a given XML input using an XML stylesheet.