BornAgain
1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
JobProgressAssistant.cpp
Go to the documentation of this file.
1
// ************************************************************************************************
2
//
3
// BornAgain: simulate and fit reflection and scattering
4
//
5
//! @file GUI/View/Job/JobProgressAssistant.cpp
6
//! @brief Implements class JobProgressAssistant
7
//!
8
//! @homepage http://www.bornagainproject.org
9
//! @license GNU General Public License v3 or higher (see COPYING)
10
//! @copyright Forschungszentrum Jülich GmbH 2018
11
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12
//
13
// ************************************************************************************************
14
15
#include "
GUI/View/Job/JobProgressAssistant.h
"
16
#include "
GUI/Model/Model/JobModel.h
"
17
#include "
GUI/View/Main/MainWindow.h
"
18
#include <QProgressBar>
19
20
JobProgressAssistant::JobProgressAssistant
(
MainWindow
*
mainWindow
,
JobModel
* jobModel)
21
: QObject(
mainWindow
)
22
, m_mainWindow(
mainWindow
)
23
{
24
connect(jobModel, &
JobModel::globalProgress
,
this
, &
JobProgressAssistant::onGlobalProgress
);
25
}
26
27
void
JobProgressAssistant::onGlobalProgress
(
int
progress)
28
{
29
ASSERT(
m_mainWindow
->
progressBar
());
30
if
(progress < 0 || progress >= 100)
31
m_mainWindow
->
progressBar
()->hide();
32
else
{
33
m_mainWindow
->
progressBar
()->show();
34
m_mainWindow
->
progressBar
()->setValue(progress);
35
}
36
}
JobModel.h
Defines class JobModel.
JobProgressAssistant.h
Defines class JobProgressAssistant.
MainWindow.h
Defines class MainWindow.
JobModel
Definition:
JobModel.h:27
JobModel::globalProgress
void globalProgress(int)
JobProgressAssistant::m_mainWindow
MainWindow * m_mainWindow
Definition:
JobProgressAssistant.h:34
JobProgressAssistant::JobProgressAssistant
JobProgressAssistant(MainWindow *mainWindow, JobModel *jobModel)
Definition:
JobProgressAssistant.cpp:20
JobProgressAssistant::onGlobalProgress
void onGlobalProgress(int progress)
Definition:
JobProgressAssistant.cpp:27
MainWindow
Definition:
MainWindow.h:39
MainWindow::progressBar
QProgressBar * progressBar()
Definition:
MainWindow.cpp:117
GUI::Global::mainWindow
static QMainWindow * mainWindow
Definition:
Globals.h:22
GUI
View
Job
JobProgressAssistant.cpp
Generated by
1.9.1