BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
GroupItemController.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/BaseItem/GroupItemController.h
6 //! @brief Defines class GroupItemController
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_MODEL_BASEITEM_GROUPITEMCONTROLLER_H
16 #define BORNAGAIN_GUI_MODEL_BASEITEM_GROUPITEMCONTROLLER_H
17 
19 #include <QStringList>
20 #include <QVariant>
21 
22 class SessionItem;
23 
24 //! Provides logic for manipulating items belonging to GroupItem parent.
25 
27 public:
28  GroupItemController(SessionItem* groupItem, GroupInfo groupInfo);
29 
31 
32  QString currentType() const;
33  void setCurrentType(const QString& type);
34 
35  SessionItem* getItemOfType(const QString& type);
36 
37  int currentIndex() const;
38  void setCurrentIndex(int index);
39 
40  QVariant createCombo() const;
41 
42 private:
43  QStringList itemTypes() const;
44  QStringList itemLabels() const;
45  SessionItem* addItem(const QString& item_type);
47  int toIndex(const QString& type) const;
48  QString toString(int currentIndex) const;
49 
51  QString m_current_type;
53 };
54 
55 #endif // BORNAGAIN_GUI_MODEL_BASEITEM_GROUPITEMCONTROLLER_H
Defines class GroupInfo.
Defines info for GroupProperty, i.e. collection of model types, their labels and the name of default ...
Definition: GroupInfo.h:25
Provides logic for manipulating items belonging to GroupItem parent.
int toIndex(const QString &type) const
void setCurrentType(const QString &type)
QString currentType() const
void setCurrentIndex(int index)
QVariant createCombo() const
SessionItem * getItemOfType(const QString &type)
Returns item of give type. If it doesn't exist, it will be created. Method do not change current item...
SessionItem * currentItem()
SessionItem * createCorrespondingItem()
SessionItem * addItem(const QString &item_type)
QStringList itemTypes() const
QStringList itemLabels() const
QString toString(int currentIndex) const
GroupItemController(SessionItem *groupItem, GroupInfo groupInfo)
Base class for a GUI data item.
Definition: SessionItem.h:204