BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
detailswidget.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2016 The Qt Company Ltd.
4 ** Contact: https://www.qt.io/licensing/
5 **
6 ** This file is part of Qt Creator.
7 **
8 ** Commercial License Usage
9 ** Licensees holding valid commercial Qt licenses may use this file in
10 ** accordance with the commercial license agreement provided with the
11 ** Software or, alternatively, in accordance with the terms contained in
12 ** a written agreement between you and The Qt Company. For licensing terms
13 ** and conditions see https://www.qt.io/terms-conditions. For further
14 ** information use the contact form at https://www.qt.io/contact-us.
15 **
16 ** GNU General Public License Usage
17 ** Alternatively, this file may be used under the terms of the GNU
18 ** General Public License version 3 as published by the Free Software
19 ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
20 ** included in the packaging of this file. Please review the following
21 ** information to ensure the GNU General Public License requirements will
22 ** be met: https://www.gnu.org/licenses/gpl-3.0.html.
23 **
24 ****************************************************************************/
25 
26 #ifndef BORNAGAIN_GUI_COREGUI_VIEWS_COMMONWIDGETS_DETAILSWIDGET_H
27 #define BORNAGAIN_GUI_COREGUI_VIEWS_COMMONWIDGETS_DETAILSWIDGET_H
28 
29 #include <QWidget>
30 
31 namespace Utils {
32 
34 class FadingPanel;
35 
36 class DetailsWidget : public QWidget {
37  Q_OBJECT
38  Q_PROPERTY(QString summaryText READ summaryText WRITE setSummaryText DESIGNABLE true)
39  Q_PROPERTY(QString additionalSummaryText READ additionalSummaryText WRITE
40  setAdditionalSummaryText DESIGNABLE true)
41  Q_PROPERTY(bool useCheckBox READ useCheckBox WRITE setUseCheckBox DESIGNABLE true)
42  Q_PROPERTY(bool checked READ isChecked WRITE setChecked DESIGNABLE true)
43  Q_PROPERTY(State state READ state WRITE setState)
44  Q_ENUMS(State)
45 
46 public:
48 
49  explicit DetailsWidget(QWidget* parent = 0);
50  virtual ~DetailsWidget();
51 
52  void setSummaryText(const QString& text);
53  QString summaryText() const;
54 
55  void setAdditionalSummaryText(const QString& text);
56  QString additionalSummaryText() const;
57 
58  void setState(State state);
59  State state() const;
60 
61  void setWidget(QWidget* widget);
62  QWidget* widget() const;
63  QWidget* takeWidget();
64 
66  QWidget* toolWidget() const;
67 
68  void setSummaryFontBold(bool b);
69 
70  bool isChecked() const;
71  void setChecked(bool b);
72 
73  bool useCheckBox();
74  void setUseCheckBox(bool b);
75  void setIcon(const QIcon& icon);
76 
77  static QPixmap createBackground(const QSize& size, int topHeight, QWidget* widget);
78 
79 signals:
80  void checked(bool);
81  void linkActivated(const QString& link);
82  void expanded(bool);
83 
84 private:
85  void setExpanded(bool);
86 
87 protected:
88  virtual void paintEvent(QPaintEvent* paintEvent);
89  virtual void enterEvent(QEvent* event);
90  virtual void leaveEvent(QEvent* event);
91 
92 private:
94 };
95 
96 } // namespace Utils
97 
98 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_COMMONWIDGETS_DETAILSWIDGET_H
void setIcon(const QIcon &icon)
void setState(State state)
DetailsWidget(QWidget *parent=0)
void setSummaryFontBold(bool b)
void setAdditionalSummaryText(const QString &text)
void setWidget(QWidget *widget)
QWidget * toolWidget() const
QString additionalSummaryText
Definition: detailswidget.h:40
void linkActivated(const QString &link)
virtual void enterEvent(QEvent *event)
static QPixmap createBackground(const QSize &size, int topHeight, QWidget *widget)
void setToolWidget(FadingPanel *widget)
virtual void leaveEvent(QEvent *event)
void setUseCheckBox(bool b)
DetailsWidgetPrivate * d
Definition: detailswidget.h:93
virtual void paintEvent(QPaintEvent *paintEvent)
void setSummaryText(const QString &text)
QWidget * widget() const