BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
DesignerMimeData.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/SampleDesigner/DesignerMimeData.h
6 //! @brief Defines class DesignerMimeData
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_COREGUI_VIEWS_SAMPLEDESIGNER_DESIGNERMIMEDATA_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_SAMPLEDESIGNER_DESIGNERMIMEDATA_H
17 
18 #include <QMimeData>
19 
20 class QDrag;
21 class QXmlStreamReader;
22 
23 //! Mime data for use with SampleDesigner drag and drop operations
24 class DesignerMimeData : public QMimeData {
25  Q_OBJECT
26 public:
27  DesignerMimeData(const QString& name, const QString& xmldescr, QDrag* drag);
28  virtual ~DesignerMimeData() {}
29 
30  //! Execute a drag and drop operation.
31  static Qt::DropAction execDrag(const QString& name, const QString& xmldescr,
32  QWidget* dragSource);
33 
34  QString getClassName() const { return m_classname; }
35 
36 private:
37  void read_xmldescr(const QString& xmldescr);
38  void read_widget(QXmlStreamReader& reader);
39 
40  QPixmap getPixmap(const QString& name);
41 
42  QString m_entryname;
43  QString m_xmldescr;
44  QString m_classname;
45 };
46 
47 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_SAMPLEDESIGNER_DESIGNERMIMEDATA_H
Mime data for use with SampleDesigner drag and drop operations.
void read_xmldescr(const QString &xmldescr)
QPixmap getPixmap(const QString &name)
void read_widget(QXmlStreamReader &reader)
virtual ~DesignerMimeData()
QString getClassName() const
DesignerMimeData(const QString &name, const QString &xmldescr, QDrag *drag)
static Qt::DropAction execDrag(const QString &name, const QString &xmldescr, QWidget *dragSource)
Execute a drag and drop operation.
QString const & name(EShape k)
Definition: particles.cpp:21