Example #1
0
QWidget * PropertyDelegate::createEditor(QWidget * parent,
    const QStyleOptionViewItem & option, const QModelIndex & index) const
{
    AbstractProperty * property = retrieveProperty(index);

    if (property->isCollection())
        return QStyledItemDelegate::createEditor(parent, option, index);

    return m_editorFactory->createEditor(*property, parent);
}
Example #2
0
void PropertyDelegate::paint(QPainter * painter,
   const QStyleOptionViewItem & option,
   const QModelIndex & index) const
{
    QStyledItemDelegate::paint(painter, option, index);

	AbstractProperty * property = retrieveProperty(index);

	if (property->isCollection())
		return;

	QStyleOptionViewItem opt = option;
	initStyleOption(&opt, index);

	m_propertyPainter->drawValue(painter, opt, *property);
}