Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CamiTK
CamiTK Community Edition
Commits
1ffd0383
Commit
1ffd0383
authored
May 13, 2016
by
Emmanuel Promayon
Browse files
Merge branch 'feature-fix-nomainwindow-app-crash' into develop
parents
9e396dd6
49c4d89c
Changes
1
Hide whitespace changes
Inline
Side-by-side
sdk/libraries/core/application/Application.cpp
View file @
1ffd0383
...
...
@@ -266,42 +266,57 @@ void Application::refresh() {
// ----------------- showStatusBarMessage --------------------
void
Application
::
showStatusBarMessage
(
QString
msg
,
int
timeout
)
{
QStatusBar
*
statusBar
=
mainWindow
->
statusBar
();
// if this application has no main window (no GUI)
// there is no status bar, therefore nothing to do
if
(
mainWindow
)
{
QStatusBar
*
statusBar
=
mainWindow
->
statusBar
();
if
(
statusBar
)
{
statusBar
->
showMessage
(
msg
,
timeout
);
}
else
{
CAMITK_INFO
(
"Application"
,
"showStatusBarMessage"
,
msg
.
toStdString
()
<<
std
::
endl
);
if
(
statusBar
)
{
statusBar
->
showMessage
(
msg
,
timeout
);
}
else
{
CAMITK_INFO
(
"Application"
,
"showStatusBarMessage"
,
msg
.
toStdString
()
<<
std
::
endl
);
}
}
}
// ----------------- resetProgressBar --------------------
void
Application
::
resetProgressBar
()
{
QProgressBar
*
progress
=
mainWindow
->
getProgressBar
();
// if this application has no main window (no GUI)
// there is no status bar, therefore nothing to do
if
(
mainWindow
)
{
QProgressBar
*
progress
=
mainWindow
->
getProgressBar
();
if
(
progress
)
{
progress
->
setValue
(
0
);
if
(
progress
)
{
progress
->
setValue
(
0
);
}
}
}
// ----------------- setProgressBarValue --------------------
void
Application
::
setProgressBarValue
(
int
value
)
{
QProgressBar
*
progress
=
mainWindow
->
getProgressBar
();
// if this application has no main window (no GUI)
// there is no status bar, therefore nothing to do
if
(
mainWindow
)
{
QProgressBar
*
progress
=
mainWindow
->
getProgressBar
();
if
(
progress
)
{
progress
->
setValue
(
value
);
if
(
progress
)
{
progress
->
setValue
(
value
);
}
}
}
// ----------------- vtkProgressFunction --------------------
void
Application
::
vtkProgressFunction
(
vtkObject
*
caller
,
long
unsigned
int
eventId
,
void
*
clientData
,
void
*
callData
)
{
QProgressBar
*
progress
=
mainWindow
->
getProgressBar
();
vtkAlgorithm
*
filter
=
static_cast
<
vtkAlgorithm
*>
(
caller
);
int
progressVal
=
filter
->
GetProgress
()
*
100
;
if
(
progress
)
{
progress
->
setValue
(
progressVal
);
// if this application has no main window (no GUI)
// there is no status bar, therefore nothing to do
if
(
mainWindow
)
{
QProgressBar
*
progress
=
mainWindow
->
getProgressBar
();
vtkAlgorithm
*
filter
=
static_cast
<
vtkAlgorithm
*>
(
caller
);
int
progressVal
=
filter
->
GetProgress
()
*
100
;
if
(
progress
)
{
progress
->
setValue
(
progressVal
);
}
}
}
...
...
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