BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
projectpanewidget.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/welcomeview/projectpanewidget.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_PROJECTPANEWIDGET_H
16 #define BORNAGAIN_GUI2_WELCOMEVIEW_PROJECTPANEWIDGET_H
17 
18 #include "darefl_export.h"
19 #include <QWidget>
20 
21 class QLabel;
22 
23 namespace gui2 {
24 
25 //! Panel with labels to hold project name and project dir. When user clicks on it,
26 //! sends the request to open corresponding project. Part of RecentProjectsWidget.
27 
28 class DAREFLCORE_EXPORT ProjectPaneWidget : public QWidget {
29  Q_OBJECT
30 
31 public:
32  explicit ProjectPaneWidget(QWidget* parent = nullptr);
33 
34  void setCurrentProject(const QString& project_dir, bool is_modified = false);
35 
36  void clear();
37 
38  void setActive(bool value);
39 
40 signals:
41  void projectSelected(const QString& project_dir);
42 
43 protected:
44  void paintEvent(QPaintEvent*) override;
45  void enterEvent(QEvent*) override;
46  void leaveEvent(QEvent*) override;
47  void mousePressEvent(QMouseEvent* event) override;
48 
49 private:
50  QLabel* m_currentProjectTitle{nullptr};
51  QLabel* m_currentProjectDir{nullptr};
52  QColor m_widgetColor;
53  bool m_active{false};
54  QString m_projectDir;
55 };
56 
57 } // namespace gui2
58 
59 #endif // BORNAGAIN_GUI2_WELCOMEVIEW_PROJECTPANEWIDGET_H
Panel with labels to hold project name and project dir.
void projectSelected(const QString &project_dir)
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20