2017-02-01 18:01:02 +01:00
|
|
|
|
#ifndef PARAMTYPEDELEGATE_H
|
|
|
|
|
|
#define PARAMTYPEDELEGATE_H
|
|
|
|
|
|
|
2018-12-15 20:27:40 +01:00
|
|
|
|
//#include <QStyledItemDelegate>
|
|
|
|
|
|
#include "PgLabItemDelegate.h"
|
2017-02-01 18:01:02 +01:00
|
|
|
|
|
|
|
|
|
|
class TypeSelectionItemModel;
|
|
|
|
|
|
|
|
|
|
|
|
/** Item delegate for supplying a combobox for selected the parameter type in
|
|
|
|
|
|
* the parameter list.
|
|
|
|
|
|
*/
|
2018-12-15 20:27:40 +01:00
|
|
|
|
class ParamTypeDelegate : public PgLabItemDelegate {
|
2017-02-01 18:01:02 +01:00
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
|
|
|
|
|
ParamTypeDelegate();
|
2018-12-15 20:27:40 +01:00
|
|
|
|
~ParamTypeDelegate() override;
|
2017-02-01 18:01:02 +01:00
|
|
|
|
|
|
|
|
|
|
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
|
|
|
|
|
|
const QModelIndex &index) const override;
|
2017-02-19 11:12:43 +01:00
|
|
|
|
void setEditorData(QWidget *editor, const QModelIndex &index) const override;
|
|
|
|
|
|
void setModelData(QWidget *editor, QAbstractItemModel *model,
|
|
|
|
|
|
const QModelIndex &index) const override;
|
2018-12-15 20:27:40 +01:00
|
|
|
|
|
|
|
|
|
|
void setTypeSelectionModel(TypeSelectionItemModel* model);
|
2017-02-01 18:01:02 +01:00
|
|
|
|
private:
|
|
|
|
|
|
TypeSelectionItemModel* m_typeSelectionModel = nullptr;
|
2017-02-19 11:12:43 +01:00
|
|
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
void commitAndCloseEditor();
|
2017-02-01 18:01:02 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // PARAMTYPEDELEGATE_H
|