BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
JobSelectorWidget Class Reference

Description

The JobSelectorWidget class represents left panel of JobView. Contains a tree to select jobs on the top and job property editor at the bottom.

Definition at line 28 of file JobSelectorWidget.h.

Inheritance diagram for JobSelectorWidget:
[legend]
Collaboration diagram for JobSelectorWidget:
[legend]

Public Slots

void makeJobItemSelected (JobItem *)
 

Signals

void selectedJobsChanged (const QVector< JobItem * > &jobs)
 

Public Member Functions

 JobSelectorWidget (JobModel *jobModel, QWidget *parent=nullptr)
 
QVector< JobItem * > selectedJobs () const
 

Private Slots

void onSelectedJobsChanged (const QVector< JobItem * > &jobs)
 

Private Attributes

JobListViewm_jobListView
 
JobModelm_jobModel
 
JobPropertiesWidgetm_jobProperties
 

Constructor & Destructor Documentation

◆ JobSelectorWidget()

JobSelectorWidget::JobSelectorWidget ( JobModel jobModel,
QWidget *  parent = nullptr 
)
explicit

Definition at line 24 of file JobSelectorWidget.cpp.

25  : QWidget(parent)
26  , m_jobModel(jobModel)
27 {
29  setObjectName("JobSelectorWidget");
30 
31  setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
32 
33  auto* layout = new QVBoxLayout(this);
34  layout->setMargin(0);
35  layout->setSpacing(0);
36  layout->setContentsMargins(0, 0, 0, 0);
37 
38  auto* splitter = new QSplitter(Qt::Vertical, this);
39  splitter->setChildrenCollapsible(true);
40  layout->addWidget(splitter);
41 
42  m_jobListView = new JobListView(m_jobModel, splitter);
43  splitter->addWidget(m_jobListView);
44 
46  splitter->addWidget(m_jobProperties);
47 
52 
54 }
List of jobs on the top left side of JobView.
Definition: JobListView.h:30
void selectedJobsChanged(const QVector< JobItem * > &jobs)
The JobPropertiesWidget class holds component editor for JobItem. Part of JobSelectorWidget,...
void onSelectedJobsChanged(const QVector< JobItem * > &jobs)
JobListView * m_jobListView
JobPropertiesWidget * m_jobProperties
void selectedJobsChanged(const QVector< JobItem * > &jobs)
QVector< JobItem * > selectedJobs() const
const QString JobSelectorWidgetName

References GUI::Constants::JobSelectorWidgetName, m_jobListView, m_jobModel, m_jobProperties, onSelectedJobsChanged(), selectedJobs(), JobListView::selectedJobsChanged(), and selectedJobsChanged().

Here is the call graph for this function:

Member Function Documentation

◆ makeJobItemSelected

void JobSelectorWidget::makeJobItemSelected ( JobItem item)
slot

Definition at line 61 of file JobSelectorWidget.cpp.

62 {
63  ASSERT(item);
64  m_jobListView->selectJob(item);
65 }
void selectJob(JobItem *job)

References m_jobListView, and JobListView::selectJob().

Referenced by JobView::onFocusRequest().

Here is the call graph for this function:

◆ onSelectedJobsChanged

void JobSelectorWidget::onSelectedJobsChanged ( const QVector< JobItem * > &  jobs)
privateslot

Definition at line 68 of file JobSelectorWidget.cpp.

69 {
70  if (jobs.size() == 1)
71  m_jobProperties->setItem(jobs.front());
72  else
73  m_jobProperties->setItem(nullptr);
74 }
void setItem(JobItem *item)

References m_jobProperties, and JobPropertiesWidget::setItem().

Referenced by JobSelectorWidget().

Here is the call graph for this function:

◆ selectedJobs()

QVector< JobItem * > JobSelectorWidget::selectedJobs ( ) const

Definition at line 56 of file JobSelectorWidget.cpp.

57 {
58  return m_jobListView->selectedJobs();
59 }
QVector< JobItem * > selectedJobs() const

References m_jobListView, and JobListView::selectedJobs().

Referenced by JobSelectorWidget(), JobView::connectJobRelated(), and JobView::onFocusRequest().

Here is the call graph for this function:

◆ selectedJobsChanged

void JobSelectorWidget::selectedJobsChanged ( const QVector< JobItem * > &  jobs)
signal

Member Data Documentation

◆ m_jobListView

JobListView* JobSelectorWidget::m_jobListView
private

Definition at line 45 of file JobSelectorWidget.h.

Referenced by JobSelectorWidget(), makeJobItemSelected(), and selectedJobs().

◆ m_jobModel

JobModel* JobSelectorWidget::m_jobModel
private

Definition at line 47 of file JobSelectorWidget.h.

Referenced by JobSelectorWidget().

◆ m_jobProperties

JobPropertiesWidget* JobSelectorWidget::m_jobProperties
private

Definition at line 46 of file JobSelectorWidget.h.

Referenced by JobSelectorWidget(), and onSelectedJobsChanged().


The documentation for this class was generated from the following files: