-
Notifications
You must be signed in to change notification settings - Fork 122
/
ReflOptionsDelegate.h
44 lines (35 loc) · 1.26 KB
/
ReflOptionsDelegate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef MANTID_CUSTOMINTERFACES_REFLOPTIONSDELEGATE_H
#define MANTID_CUSTOMINTERFACES_REFLOPTIONSDELEGATE_H
#include <QStyledItemDelegate>
#include "MantidAPI/AlgorithmManager.h"
#include "MantidQtMantidWidgets/HintingLineEdit.h"
using namespace Mantid::API;
using namespace Mantid::Kernel;
using namespace MantidQt::MantidWidgets;
namespace MantidQt
{
namespace CustomInterfaces
{
class ReflOptionsDelegate : public QStyledItemDelegate
{
public:
ReflOptionsDelegate() {};
virtual ~ReflOptionsDelegate() {};
virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const
{
Q_UNUSED(option);
Q_UNUSED(index);
std::map<std::string,std::string> hints;
//Create hints
IAlgorithm_sptr algReflOne = AlgorithmManager::Instance().create("ReflectometryReductionOneAuto");
auto properties = algReflOne->getProperties();
for(auto it = properties.begin(); it != properties.end(); ++it)
hints[(*it)->name()] = (*it)->briefDocumentation();
auto editor = new HintingLineEdit(parent, hints);
editor->setFrame(false);
return editor;
}
};
}
}
#endif /* MANTID_CUSTOMINTERFACES_REFLOPTIONSDELEGATE_H */