Need a central piece to manage the catalogue data per database to prevent loading this multiple times. MasterController is now also used to enable reopening the connection manager from a query window after the connection manager has been closed.
29 lines
667 B
C++
29 lines
667 B
C++
#include "paramtypedelegate.h"
|
|
|
|
#include <QComboBox>
|
|
#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<StarRating>()) {
|
|
QComboBox *cmbbx = new QComboBox(parent);
|
|
cmbbx->setModel(m_typeSelectionModel);
|
|
w = cmbbx;
|
|
// } else {
|
|
// w = QStyledItemDelegate::createEditor(parent, option, index);
|
|
// }
|
|
return w;
|
|
}
|