diff --git a/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflOptionsDelegate.h b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflOptionsDelegate.h new file mode 100644 index 000000000000..b0be6536fdd6 --- /dev/null +++ b/Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ReflOptionsDelegate.h @@ -0,0 +1,25 @@ +#ifndef MANTID_CUSTOMINTERFACES_REFLOPTIONSDELEGATE_H +#define MANTID_CUSTOMINTERFACES_REFLOPTIONSDELEGATE_H + +#include + +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); + return new QLineEdit(parent); + } + }; + } +} + +#endif /* MANTID_CUSTOMINTERFACES_REFLOPTIONSDELEGATE_H */ diff --git a/Code/Mantid/MantidQt/CustomInterfaces/src/QtReflMainView.cpp b/Code/Mantid/MantidQt/CustomInterfaces/src/QtReflMainView.cpp index 9d16ea5a4f21..a882bf64c978 100644 --- a/Code/Mantid/MantidQt/CustomInterfaces/src/QtReflMainView.cpp +++ b/Code/Mantid/MantidQt/CustomInterfaces/src/QtReflMainView.cpp @@ -1,6 +1,7 @@ #include "MantidQtCustomInterfaces/QtReflMainView.h" #include "MantidQtCustomInterfaces/QReflTableModel.h" #include "MantidQtCustomInterfaces/ReflMainViewPresenter.h" +#include "MantidQtCustomInterfaces/ReflOptionsDelegate.h" #include "MantidAPI/ITableWorkspace.h" #include "MantidKernel/ConfigService.h" #include @@ -56,6 +57,9 @@ namespace MantidQt connect(ui.actionProcess, SIGNAL(triggered()), this, SLOT(actionProcess())); connect(ui.actionGroupRows, SIGNAL(triggered()), this, SLOT(actionGroupRows())); + QAbstractItemDelegate* delegate = new ReflOptionsDelegate(); + ui.viewTable->setItemDelegateForColumn(ReflMainViewPresenter::COL_OPTIONS, delegate); + //Finally, create a presenter to do the thinking for us m_presenter = boost::shared_ptr(new ReflMainViewPresenter(this)); }