21 #ifndef VPROPERTYDELEGATE_H
22 #define VPROPERTYDELEGATE_H
24 #include <qcompilerdetection.h>
25 #include <QMetaObject>
29 #include <QStyleOptionViewItem>
30 #include <QStyledItemDelegate>
43 virtual QWidget*
createEditor (QWidget* parent,
const QStyleOptionViewItem& option,
44 const QModelIndex& index)
const Q_DECL_OVERRIDE;
47 virtual void setEditorData (QWidget * editor,
const QModelIndex & index)
const Q_DECL_OVERRIDE;
50 virtual void setModelData (QWidget * editor, QAbstractItemModel * model,
51 const QModelIndex & index)
const Q_DECL_OVERRIDE;
54 virtual QSize
sizeHint (
const QStyleOptionViewItem& option,
const QModelIndex& index)
const Q_DECL_OVERRIDE;
57 void setRowHeight(
int height = 0,
bool add_to_standard =
false);
60 virtual void paint (QPainter* painter,
const QStyleOptionViewItem& option,
61 const QModelIndex& index )
const Q_DECL_OVERRIDE;
virtual ~VPropertyDelegate() Q_DECL_OVERRIDE
void setRowHeight(int height=0, bool add_to_standard=false)
Sets the row height. Set this to 0 and the standard will be taken.
virtual void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE
Sets the index data to the editor.
VPropertyDelegate(QObject *parent=nullptr)
virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const Q_DECL_OVERRIDE
Updates the index data.
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE
Returns the size hint.
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE
Renders the delegate using the given painter and style option for the item specified by index.
virtual QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE
Creates the editor widget.