BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
InstrumentSelectorWidget.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/InstrumentWidgets/InstrumentSelectorWidget.cpp
6 //! @brief Implements class InstrumentSelectorWidget
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 
17 #include <QAction>
18 #include <QListView>
19 #include <QMenu>
20 #include <QPushButton>
21 #include <QVBoxLayout>
22 
24  : ItemSelectorWidget(parent)
25 {
26  setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
27 
28  listView()->setViewMode(QListView::IconMode);
29  listView()->setIconSize(QSize(96, 84));
30  listView()->setMovement(QListView::Static);
31  listView()->setMaximumWidth(200);
32  listView()->setSpacing(12);
33 
34  listView()->setObjectName("listView");
35  listView()->setStyleSheet(
36  QString::fromUtf8("QListView#listView\n"
37  "{\n"
38  " selection-background-color : rgb(98,100,105); \n"
39  " selection-color: rgb(255,255,255);\n"
40  " border: 1px solid rgb(98,100,105);\n"
41  "}\n"));
42 
43  setModel(model);
44  layout()->setMargin(10);
45 }
46 
48 {
49  return QSize(170, 400);
50 }
51 
53 {
54  return QSize(96, 200);
55 }
Defines class InstrumentModel.
Defines class InstrumentSelectorWidget.
InstrumentSelectorWidget(InstrumentModel *model=nullptr, QWidget *parent=nullptr)
The ItemSelectorWidget class holds QListView to show top level items of SessionModel.
void setModel(SessionModel *model)