Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
John Tourtellott
ACE3P Extensions
Commits
2c4144b3
Commit
2c4144b3
authored
Jan 16, 2020
by
John Tourtellott
Browse files
Add code to launch the executable using QProcess
parent
89e2ccf3
Changes
2
Hide whitespace changes
Inline
Side-by-side
plugin/pqCubitToolBar.cxx
View file @
2c4144b3
...
...
@@ -109,9 +109,13 @@ void pqCubitToolBar::onLaunch()
cubitStringProp
->
SetElement
(
0
,
cubitPath
.
c_str
());
proxy
->
UpdateVTKObjects
();
//QMessageBox::information(mainWidget, "CUBIT PATH FOUND", path);
// Run the process
// return this->runCubit(cubit_path);
QMessageBox
::
information
(
mainWidget
,
"CUBIT PATH FOUND"
,
path
);
bool
success
=
this
->
runCubit
(
path
);
if
(
!
success
)
{
QMessageBox
::
warning
(
mainWidget
,
"CUBIT LAUNCH FAILED"
,
"The system was unable to launch CUBIT."
);
}
}
void
pqCubitToolBar
::
askUserForPath
(
const
QString
&
headline
,
const
QString
&
details
,
QString
&
result
)
const
...
...
@@ -168,3 +172,18 @@ bool pqCubitToolBar::checkPath(const QString& path, QString& reason) const
return
true
;
}
bool
pqCubitToolBar
::
runCubit
(
const
QString
&
path
)
const
{
QProcess
process
;
process
.
setProgram
(
path
);
// process.setArguments();
// process.setWorkingDirectory();
qint64
pid
;
bool
success
=
process
.
startDetached
(
&
pid
);
if
(
success
)
{
qInfo
()
<<
"Started process"
<<
pid
;
}
return
success
;
}
plugin/pqCubitToolBar.h
View file @
2c4144b3
...
...
@@ -12,11 +12,9 @@
#include
"smtk/PublicPointerDefs.h"
#include
<QString>
#include
<QToolBar>
// class pqServer;
// class QAction;
// class vtkSMSMTKResourceManagerProxy;
class
pqCubitToolBar
:
public
QToolBar
{
...
...
@@ -30,6 +28,8 @@ public:
protected:
void
askUserForPath
(
const
QString
&
headline
,
const
QString
&
details
,
QString
&
result
)
const
;
bool
checkPath
(
const
QString
&
path
,
QString
&
reason
)
const
;
bool
runCubit
(
const
QString
&
path
)
const
;
protected
slots
:
void
onLaunch
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment