BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
recentprojectwidget.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/welcomeview/recentprojectwidget.h
6 //! @brief Defines class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI2_WELCOMEVIEW_RECENTPROJECTWIDGET_H
16 #define BORNAGAIN_GUI2_WELCOMEVIEW_RECENTPROJECTWIDGET_H
17 
18 #include "darefl_export.h"
19 #include <QWidget>
20 #include <memory>
21 #include <vector>
22 
23 class QBoxLayout;
24 
25 namespace gui2 {
26 
27 class ProjectPaneWidget;
28 
29 //! Widget with the name of current project and collection of recent projects.
30 //! Occupies left part of WelcomeView.
31 
32 class DAREFLCORE_EXPORT RecentProjectWidget : public QWidget {
33  Q_OBJECT
34 
35 public:
36  explicit RecentProjectWidget(QWidget* parent = nullptr);
37 
38  QSize sizeHint() const override;
39  QSize minimumSizeHint() const override;
40 
41  void setCurrentProject(const QString& project_dir, bool is_modified);
42 
43  void setRecentProjectsList(const QStringList& projects);
44 
45 signals:
46  void projectSelected(const QString& project_dir);
47 
48 private:
49  QBoxLayout* createCurrentProjectLayout() const;
50  QBoxLayout* createRecentProjectLayout();
51  QWidget* createRecentProjectScrollArea();
52 
54  std::vector<ProjectPaneWidget*> m_recentProjectPanes;
55 };
56 
57 } // namespace gui2
58 
59 #endif // BORNAGAIN_GUI2_WELCOMEVIEW_RECENTPROJECTWIDGET_H
Panel with labels to hold project name and project dir.
Widget with the name of current project and collection of recent projects.
ProjectPaneWidget * m_currentProjectPane
std::vector< ProjectPaneWidget * > m_recentProjectPanes
void projectSelected(const QString &project_dir)
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20