BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
MainWindow.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Main/MainWindow.h
6 //! @brief Defines class MainWindow
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_MAIN_MAINWINDOW_H
16 #define BORNAGAIN_GUI_VIEW_MAIN_MAINWINDOW_H
17 
18 #include <QMainWindow>
19 
20 class ActionManager;
21 class ImportDataView;
22 class InstrumentView;
23 class JobView;
24 class ProjectManager;
26 class SampleView;
27 class SessionModelView;
28 class SimulationView;
29 class UpdateNotifier;
30 class WelcomeView;
31 
32 class QButtonGroup;
33 class QProgressBar;
34 class QStackedLayout;
35 class QStatusBar;
36 class QToolButton;
37 class QVBoxLayout;
38 
39 class MainWindow : public QMainWindow {
40  Q_OBJECT
41 
42 public:
44 
45  explicit MainWindow();
46  ~MainWindow() override;
47 
48  QProgressBar* progressBar();
49 
51  UpdateNotifier* updateNotifier();
52 
53  QWidget* currentView() const;
54  void setCurrentView(int viewId);
55 
56  void updateTitle();
57 
58 public slots:
59  void onFocusRequest(int index);
60  void openRecentProject();
62  void onSessionModelViewActive(bool isActive);
63 
64 signals:
65  void currentViewChanged(ViewId newView);
66 
67 protected:
68  void closeEvent(QCloseEvent* event) override;
69 
70 private:
71  void initApplication();
72  void initProgressBar();
73  void initViews();
74 
75  void readSettings();
76  void writeSettings();
77  void addView(ViewId id, const QIcon& icon, const QString& title, const QString& tooltip,
78  QWidget* view);
79  QToolButton* createViewSelectionButton() const;
80 
81  //! Recalculate the size of the view selection buttons to show complete button text
83  void onDocumentOpenedOrClosed(bool open);
84  void onDocumentModified();
86 
87  void raiseView(int viewId);
88 
89  QProgressBar* m_progressBar;
90  QButtonGroup* m_viewSelectionButtons;
91  QStackedLayout* m_viewsStack;
93 
96  UpdateNotifier* m_updateNotifier;
97 
106 };
107 
108 #endif // BORNAGAIN_GUI_VIEW_MAIN_MAINWINDOW_H
Class to handle MainWindow's menu and corresponding actions.
Definition: ActionManager.h:28
The ImportDataView class is a main view for importing experimental data.
The JobView class is a main view to show list of jobs, job results and widgets for real time and fitt...
Definition: JobView.h:37
void closeEvent(QCloseEvent *event) override
Definition: MainWindow.cpp:194
void readSettings()
Definition: MainWindow.cpp:279
SimulationView * m_simulationView
Definition: MainWindow.h:102
void raiseView(int viewId)
Definition: MainWindow.cpp:138
@ SESSIONMODEL
Definition: MainWindow.h:43
WelcomeView * m_welcomeView
Definition: MainWindow.h:98
SessionModelView * m_sessionModelView
Definition: MainWindow.h:105
void setCurrentView(int viewId)
Definition: MainWindow.cpp:132
~MainWindow() override
void onDocumentOpenedOrClosed(bool open)
Definition: MainWindow.cpp:356
QButtonGroup * m_viewSelectionButtons
Definition: MainWindow.h:90
InstrumentView * m_instrumentView
Definition: MainWindow.h:99
QWidget * currentView() const
Definition: MainWindow.cpp:127
void writeSettings()
Definition: MainWindow.cpp:291
void onSessionModelViewActive(bool isActive)
Inserts/removes developers SessionModelView on the left tabbar.
Definition: MainWindow.cpp:180
ProjectManager * m_projectManager
Definition: MainWindow.h:94
ActionManager * m_actionManager
Definition: MainWindow.h:95
ImportDataView * m_importDataView
Definition: MainWindow.h:101
void onFocusRequest(int index)
Definition: MainWindow.cpp:157
void addView(ViewId id, const QIcon &icon, const QString &title, const QString &tooltip, QWidget *view)
Definition: MainWindow.cpp:302
UpdateNotifier * m_updateNotifier
Definition: MainWindow.h:96
void onRunSimulationShortcut()
Definition: MainWindow.cpp:170
QStackedLayout * m_viewsStack
Definition: MainWindow.h:91
void openRecentProject()
Definition: MainWindow.cpp:162
void initViews()
Definition: MainWindow.cpp:230
void initProgressBar()
Definition: MainWindow.cpp:221
QProgressBar * progressBar()
Definition: MainWindow.cpp:117
QVBoxLayout * m_viewSelectionButtonsLayout
Definition: MainWindow.h:92
QProgressBar * m_progressBar
Definition: MainWindow.h:89
void updateTitle()
Definition: MainWindow.cpp:146
void currentViewChanged(ViewId newView)
void onAboutToCloseDocument()
Definition: MainWindow.cpp:369
void onDocumentModified()
Definition: MainWindow.cpp:364
ProjectManager * projectManager()
Definition: MainWindow.cpp:122
void initApplication()
Definition: MainWindow.cpp:212
ProjectSettingsView * m_projectSettingsView
Definition: MainWindow.h:103
QToolButton * createViewSelectionButton() const
Definition: MainWindow.cpp:397
UpdateNotifier * updateNotifier()
JobView * m_jobView
Definition: MainWindow.h:104
void updateViewSelectionButtonsGeometry() const
Recalculate the size of the view selection buttons to show complete button text.
Definition: MainWindow.cpp:318
SampleView * m_sampleView
Definition: MainWindow.h:100
Handles activity related to opening/save projects.
Widget to define project settings.
The SessionModelView is a technical view which shows the content all current application models....
Widget to define a simulation. Contains: