BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
layertreeview.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/layereditor/layertreeview.cpp
6 //! @brief Implements class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
16 #include <QHeaderView>
17 #include <QMouseEvent>
18 
19 namespace gui2 {
20 
22 
23 LayerTreeView::LayerTreeView(QWidget* parent) : QTreeView(parent)
24 {
25  setAlternatingRowColors(true);
26  setSelectionBehavior(QAbstractItemView::SelectRows);
27  setSelectionMode(QAbstractItemView::ExtendedSelection);
28  // setTabKeyNavigation(true);
29  header()->setSectionResizeMode(QHeaderView::Stretch);
30 }
31 
32 void LayerTreeView::setModel(QAbstractItemModel* model)
33 {
34  QTreeView::setModel(model);
35  expandAll();
36 }
37 
38 } // namespace gui2
void setModel(QAbstractItemModel *model) override
LayerTreeView(QWidget *parent=nullptr)
~LayerTreeView() override
Defines class CLASS?
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20