This repository has been archived on 2023-08-11. You can view files and clone it, but cannot push or open issues or pull requests.
verticallite/propeditordelegate.h
2015-10-17 01:04:34 +03:00

39 lines
1.4 KiB
C++

#ifndef PROPEDITORDELEGATE_H
#define PROPEDITORDELEGATE_H
#include <QItemDelegate>
#include "attrloodsmanmodel.h"
class PropEditorDelegate : public QItemDelegate
{
Q_OBJECT
public:
explicit PropEditorDelegate(QObject *parent = 0);
virtual QWidget * createEditor ( QWidget * parent,
const QStyleOptionViewItem & option,
const QModelIndex & index ) const;
virtual void setEditorData( QWidget * editor,
const QModelIndex & index ) const;
virtual void setModelData( QWidget * editor, QAbstractItemModel * model,
const QModelIndex & index ) const;
virtual void updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex & index) const;
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option,
const QModelIndex &index) const;
QColor calcBgColor(const QModelIndex &index) const;
virtual QSize sizeHint(const QStyleOptionViewItem &option,
const QModelIndex &index) const;
void setAttrModel(AttrLoodsmanModel* model);
signals:
public slots:
private:
QVector<QColor> m_colors;
AttrLoodsmanModel* m_attrModel;
};
#endif // PROPEDITORDELEGATE_H