2016-12-14 01:00:35 -08:00
|
|
|
#ifndef FIGUREDELEGATE_H
|
|
|
|
#define FIGUREDELEGATE_H
|
|
|
|
|
|
|
|
#include <QApplication>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QPainter>
|
|
|
|
#include <QSpinBox>
|
|
|
|
#include <QStyledItemDelegate>
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
#include "drawmapfigure.h"
|
|
|
|
|
|
|
|
class FigureDelegate : public QStyledItemDelegate
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2019-03-29 09:23:22 -07:00
|
|
|
FigureDelegate(QObject *parent = nullptr);
|
2016-12-14 01:00:35 -08:00
|
|
|
|
|
|
|
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
|
|
|
|
const QModelIndex &index) const Q_DECL_OVERRIDE;
|
|
|
|
|
|
|
|
void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE;
|
|
|
|
void setModelData(QWidget *editor, QAbstractItemModel *model,
|
|
|
|
const QModelIndex &index) const Q_DECL_OVERRIDE;
|
|
|
|
|
|
|
|
void updateEditorGeometry(QWidget *editor,
|
|
|
|
const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
|
|
|
|
|
|
|
|
//void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE ;
|
|
|
|
private:
|
|
|
|
QStringList list;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // FIGUREDELEGATE_H
|