Skip to content

Commit

Permalink
Refs #10348 Delegate options column
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry Jeffery committed Oct 22, 2014
1 parent 153e096 commit e82ebfd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
@@ -0,0 +1,25 @@
#ifndef MANTID_CUSTOMINTERFACES_REFLOPTIONSDELEGATE_H
#define MANTID_CUSTOMINTERFACES_REFLOPTIONSDELEGATE_H

#include <QStyledItemDelegate>

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 */
4 changes: 4 additions & 0 deletions 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 <qinputdialog.h>
Expand Down Expand Up @@ -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<IReflPresenter>(new ReflMainViewPresenter(this));
}
Expand Down

0 comments on commit e82ebfd

Please sign in to comment.