30 #include <QAbstractItemView> 44 const QStyleOptionViewItem& option,
45 const QModelIndex& index)
const 48 if (!prop || !prop->
paint(painter, option))
50 QStyledItemDelegate::paint(painter, option, index);
55 const QStyleOptionViewItem& option,
56 const QModelIndex& index)
const 64 if (QWidget* editor = prop->
createEditor(parent, option))
68 return QStyledItemDelegate::createEditor(parent, option, index);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
A single element of a property tree, with a name, value, description, and possibly children...
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
virtual bool paint(QPainter *painter, const QStyleOptionViewItem &option) const
Hook to provide custom painting of the value data (right-hand column) in a subclass.
virtual QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option)
Create an editor widget to edit the value of this property.
PropertyTreeDelegate(QObject *parent_object=nullptr)
virtual bool getReadOnly()
Return the read-only-ness of this property.