BornAgain  1.19.79
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/View/Tool/StyleUtils.h
6 //! @brief Defines GUI::StyleUtils 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_VIEW_TOOL_STYLEUTILS_H
16 #define BORNAGAIN_GUI_VIEW_TOOL_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 GUI::Util::Style {
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 //! Returns size of largest letter of default system font.
44 QSize SizeOfLetterM(const QWidget* widget = nullptr);
45 
46 //! Returns size in points of default system font.
47 int SystemPointSize();
48 
49 //! Returns typical width of the vertical property panel.
50 
51 int PropertyPanelWidth();
52 
53 } // namespace GUI::Util::Style
54 
55 #endif // BORNAGAIN_GUI_VIEW_TOOL_STYLEUTILS_H
int SystemPointSize()
Returns size in points of default system font.
Definition: StyleUtils.cpp:119
QSize SizeOfLetterM(const QWidget *widget=nullptr)
Returns size of largest letter of default system font.
Definition: StyleUtils.cpp:113
QFont sectionFont(bool bold=false)
Returns font for sections.
Definition: StyleUtils.cpp:82
QFont labelFont(bool bold=false)
Returns font for labels.
Definition: StyleUtils.cpp:91
void setPropertyStyle(QTreeView *tree)
Sets style for the tree to use in property editors.
Definition: StyleUtils.cpp:49
int PropertyPanelWidth()
Returns typical width of the vertical property panel.
Definition: StyleUtils.cpp:124
QString propertyTreeStyle()
Returns string representing the style of QTreeView intended for property editor.
Definition: StyleUtils.cpp:56
void setResizable(QDialog *dialog)
Make modal dialog resizable.
Definition: StyleUtils.cpp:100