41 #include <QApplication>
52 std::string appName =
"Optika";
53 args[0] = &appName[0];
54 QApplication a(argNum,args);
55 MetaWindow theWindow(validParameters, dependencySheet, customFunc);
62 const std::string& nameOfXmlFile,
69 userInput = getParametersFromXmlFile(nameOfXmlFile, depSheet);
72 std::string appName =
"Optika";
73 args[0] = &appName[0];
74 QApplication a(argNum,args);
75 MetaWindow theWindow(userInput, depSheet, customFunc);
84 std::string styleSheetFilePath,
85 std::string iconFilePath,
91 std::string appName =
"Optika";
92 args[0] = &appName[0];
93 QApplication a(argNum,args);
94 std::string submitText =
"Submit and save XML";
95 std::string submitNoSaveText =
"Submit";
96 MetaWindow theWindow(validParameters, dependencySheet, customFunc,
"", submitText, submitNoSaveText);
97 if(iconFilePath !=
""){
98 QIcon windowIcon(QString::fromStdString(iconFilePath));
99 a.setWindowIcon(windowIcon);
101 if(styleSheetFilePath !=
""){
103 QFile file(QString::fromStdString(styleSheetFilePath));
104 if (file.open(QIODevice::ReadOnly | QIODevice::Text)){
105 QTextStream in(&file);
106 while (!in.atEnd()) {
107 str += in.readLine();
109 a.setStyleSheet(str);
119 const std::string& nameOfXmlFile,
121 std::string styleSheetFilePath,
122 std::string iconFilePath,
128 userInput = getParametersFromXmlFile(nameOfXmlFile, depSheet);
131 std::string appName =
"Optika";
132 args[0] = &appName[0];
133 QApplication a(argNum,args);
134 std::string submitText =
"Submit and save XML";
135 std::string submitNoSaveText =
"Submit";
136 MetaWindow theWindow(userInput, depSheet, customFunc,
"", submitText, submitNoSaveText);
137 if(iconFilePath !=
""){
138 QIcon windowIcon(QString::fromStdString(iconFilePath));
139 a.setWindowIcon(windowIcon);
141 if(styleSheetFilePath !=
""){
143 QFile file(QString::fromStdString(styleSheetFilePath));
144 if (file.open(QIODevice::ReadOnly | QIODevice::Text)){
145 QTextStream in(&file);
146 while (!in.atEnd()) {
147 str += in.readLine();
149 a.setStyleSheet(str);
163 validParameters(validParameters),
164 dependencySheet(dependencySheet),
165 customFunc(customFunc)
169 const std::string& xmlFileName,
171 customFunc(customFunc)
174 validParameters = getParametersFromXmlFile(xmlFileName, dependencySheet);
182 std::string appName =
"Optika";
183 args[0] = &appName[0];
184 QApplication a(argNum,args);
188 theWindow->setWindowTitle(QString::fromStdString(
title));
190 if(iconFilePath !=
""){
191 QIcon windowIcon(QString::fromStdString(iconFilePath));
192 QApplication::setWindowIcon(windowIcon);
194 if(styleSheetFilePath !=
""){
196 QFile file(QString::fromStdString(styleSheetFilePath));
197 if (file.open(QIODevice::ReadOnly | QIODevice::Text)){
198 QTextStream in(&file);
199 while (!in.atEnd()) {
200 str += in.readLine();
202 a.setStyleSheet(str);
206 theWindow->setAboutInfo(QString::fromStdString(
aboutInfo));
210 theWindow->activateWindow();
222 this->iconFilePath = filePath;
226 this->styleSheetFilePath = filePath;
void setActionButtonText(const std::string &text)
Sets the text in the "action" button".
std::string styleSheetFilePath
File path to the QT style sheet to be used for the GUI.
std::string getAboutInfo()
Gets the information to be added to the about dialog of the GUI.
A collection of functions and an Object that serve as the primary interface to the Optika package all...
std::string aboutInfo
Information to be added to the about dialog of the GUI.
void(* customFunc)(RCP< const ParameterList >)
The custom function to be run whenever the user clicks the action button.
std::string getStyleSheet()
Gets the file path describing the location of the file being used as the QT Style Sheet...
void setCustomFunction(void(*customFunc)(RCP< const ParameterList >))
Sets the custom function to be used in the GUI. When ever the user clicks the action button...
void getInput(RCP< ParameterList > validParameters, RCP< DependencySheet > dependencySheet, void(*customFunc)(RCP< const ParameterList >))
Retreives the input for a Teuchos Parameter List using a GUI. Note the Parameter List will be edited...
void setWindowIcon(const std::string &filePath)
Sets the window icon to the image specified in the filePath.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
std::string getWindowTitle()
Gets the window title.
std::string actionButtonText
Text to display in the action button.
std::string title
A string containing the window title.
void setStyleSheet(const std::string &filePath)
Sets the QT style sheet that should be used for the GUI.
void getInputExtraOptions(RCP< ParameterList > validParameters, RCP< DependencySheet > dependencySheet, std::string styleSheetFilePath, std::string iconFilePath, void(*customFunc)(RCP< const ParameterList >))
Retreives the input for a Teuchos Parameter List using a GUI. Note the Parameter List will be edited...
void setWindowTitle(const std::string &title)
Sets the title of the GUI window that is displayed to the user.
OptikaGUI(RCP< ParameterList > validParameters, RCP< DependencySheet > dependencySheet=null, void(*customFunc)(RCP< const ParameterList >)=NULL)
Constructs an OptikaGUI object.
void exec()
Runs the GUI and gets the user input.
void setAboutInfo(const std::string &aboutInfo)
Adds the information specified to the about dialog of the GUI.
std::string getWindowIcon()
Gets the file path describing the location of the file being used for the window icon.
std::string iconFilePath
File path to the image that should be used as the window icon.