BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
JobListView.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Job/JobListView.h
6 //! @brief Defines class JobListView
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 #ifndef BORNAGAIN_GUI_VIEW_JOB_JOBLISTVIEW_H
16 #define BORNAGAIN_GUI_VIEW_JOB_JOBLISTVIEW_H
17 
18 #include <QWidget>
19 
20 class JobModel;
21 class QAction;
22 class QListView;
23 class QMenu;
24 class JobItem;
25 class JobListModel;
27 
28 //! List of jobs on the top left side of JobView.
29 
30 class JobListView : public QWidget {
31  Q_OBJECT
32 
33 public:
34  JobListView(JobModel* jobs, QWidget* parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
35  QVector<JobItem*> selectedJobs() const;
36  void selectJob(JobItem* job);
37 
38 signals:
39  void selectedJobsChanged(const QVector<JobItem*>& jobs);
40 
41 private slots:
43  void onJobListModelDataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
44  void onRun();
45  void onCancel();
46  void onRemove();
47  void equalizeSelectedToJob(JobItem* job);
48  void showContextMenu(const QPoint& pos);
49 
50 private:
51  void updateActions();
52  void ensureItemSelected();
53 
54 private:
55  QListView* m_listView;
58  QAction* m_runAction;
59  QAction* m_cancelAction;
60  QAction* m_removeAction;
62 };
63 
64 #endif // BORNAGAIN_GUI_VIEW_JOB_JOBLISTVIEW_H
ViewDelegate to show progress bar JobQueuListView.
List of jobs on the top left side of JobView.
Definition: JobListView.h:30
void equalizeSelectedToJob(JobItem *job)
QAction * m_cancelAction
Definition: JobListView.h:59
void onRemove()
JobListModel * m_model
Definition: JobListView.h:57
QListView * m_listView
Definition: JobListView.h:55
void onJobListModelDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
void onItemSelectionChanged()
QVector< JobItem * > selectedJobs() const
QAction * m_runAction
Definition: JobListView.h:58
JobListViewDelegate * m_listViewDelegate
Definition: JobListView.h:56
QMenu * m_equalizeMenu
Definition: JobListView.h:61
void ensureItemSelected()
JobListView(JobModel *jobs, QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
Definition: JobListView.cpp:51
void selectedJobsChanged(const QVector< JobItem * > &jobs)
QAction * m_removeAction
Definition: JobListView.h:60
void showContextMenu(const QPoint &pos)
void onCancel()
void selectJob(JobItem *job)
void updateActions()