BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
dataviewmodel.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/importdataview/dataviewmodel.h
6 //! @brief Defines 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 
15 #ifndef BORNAGAIN_GUI2_IMPORTDATAVIEW_DATAVIEWMODEL_H
16 #define BORNAGAIN_GUI2_IMPORTDATAVIEW_DATAVIEWMODEL_H
17 
18 #include "darefl_export.h"
20 
21 namespace ModelView {
22 class SessionModel;
23 }
24 
25 namespace gui2 {
26 
27 class ExperimentalDataModel;
28 
29 //! View model for ExperimentalDataModel with drag-and-drop support.
30 
31 class DAREFLCORE_EXPORT DataViewModel : public ModelView::TopItemsViewModel {
32  Q_OBJECT
33 
34 public:
35  DataViewModel(ExperimentalDataModel* model, QObject* parent = nullptr);
36 
37  Qt::ItemFlags flags(const QModelIndex& index) const override;
38  QMimeData* mimeData(const QModelIndexList& index_list) const override;
39  Qt::DropActions supportedDragActions() const override;
40  Qt::DropActions supportedDropActions() const override;
41  bool canDropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column,
42  const QModelIndex& parent) const override;
43  bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column,
44  const QModelIndex& parent) override;
45 };
46 
47 } // namespace gui2
48 
49 #endif // BORNAGAIN_GUI2_IMPORTDATAVIEW_DATAVIEWMODEL_H
View model to show top level items of SessionModel in Qt trees and tables.
View model for ExperimentalDataModel with drag-and-drop support.
Definition: dataviewmodel.h:31
The model to store imported reflectometry data.
materialitems.h Collection of materials to populate MaterialModel.
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20
Defines class CLASS?