BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
StyleUtils.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/utils/StyleUtils.h
6 //! @brief DefinesStyleUtils namespace
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_COREGUI_UTILS_STYLEUTILS_H
16 #define BORNAGAIN_GUI_COREGUI_UTILS_STYLEUTILS_H
17 
18 #include <QFont>
19 #include <QString>
20 
21 class QTreeView;
22 class QWidget;
23 class QLayout;
24 class QWidget;
25 
26 namespace StyleUtils {
27 
28 //! Sets style for the tree to use in property editors.
29 void setPropertyStyle(QTreeView* tree);
30 
31 //! Returns string representing the style of QTreeView intended for property editor.
32 QString propertyTreeStyle();
33 
34 //! Returns font for sections.
35 QFont sectionFont(bool bold = false);
36 
37 //! Returns font for labels.
38 QFont labelFont(bool bold = false);
39 
40 //! Make modal dialog resizable.
41 void setResizable(QDialog* dialog);
42 
43 //! Creates details widget holding user content inside.
44 QWidget* createDetailsWidget(QWidget* content, const QString& name, bool expanded = true);
45 
46 //! Creates details widget holding user layout inside.
47 QWidget* createDetailsWidget(QLayout* content, const QString& name, bool expanded = true);
48 
49 //! Returns size of largest letter of default system font.
50 QSize SizeOfLetterM(const QWidget* widget = nullptr);
51 
52 //! Returns size in points of default system font.
53 int SystemPointSize();
54 
55 //! Returns typical width of the vertical property panel.
56 
57 int PropertyPanelWidth();
58 
59 } // namespace StyleUtils
60 
61 #endif // BORNAGAIN_GUI_COREGUI_UTILS_STYLEUTILS_H
QString const & name(EShape k)
Definition: particles.cpp:21
QSize SizeOfLetterM(const QWidget *widget=nullptr)
Returns size of largest letter of default system font.
Definition: StyleUtils.cpp:110
int SystemPointSize()
Returns size in points of default system font.
Definition: StyleUtils.cpp:116
QWidget * createDetailsWidget(QWidget *content, const QString &name, bool expanded=true)
Creates details widget holding user content inside.
Definition: StyleUtils.cpp:96
QFont labelFont(bool bold=false)
Returns font for labels.
Definition: StyleUtils.cpp:78
int PropertyPanelWidth()
Returns typical width of the vertical property panel.
Definition: StyleUtils.cpp:121
QString propertyTreeStyle()
Returns string representing the style of QTreeView intended for property editor.
Definition: StyleUtils.cpp:43
void setResizable(QDialog *dialog)
Make modal dialog resizable.
Definition: StyleUtils.cpp:87
void setPropertyStyle(QTreeView *tree)
Sets style for the tree to use in property editors.
Definition: StyleUtils.cpp:36
QFont sectionFont(bool bold=false)
Returns font for sections.
Definition: StyleUtils.cpp:69