#include "paramtypedelegate.h" #include #include "TypeSelectionItemModel.h" ParamTypeDelegate::ParamTypeDelegate() : m_typeSelectionModel(new TypeSelectionItemModel) {} ParamTypeDelegate::~ParamTypeDelegate() { delete m_typeSelectionModel; } QWidget *ParamTypeDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const { QWidget *w = nullptr; // if (index.data().canConvert()) { QComboBox *cmbbx = new QComboBox(parent); cmbbx->setModel(m_typeSelectionModel); w = cmbbx; // } else { // w = QStyledItemDelegate::createEditor(parent, option, index); // } return w; }