Public Member Functions | |
| QxtCrumbViewDelegate (QAbstractItemDelegate *other, QObject *parent) | |
| void | paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const |
| QSize | sizeHint (const QStyleOptionViewItem &option, const QModelIndex &index) const |
| QWidget * | createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) |
| void | setEditorData (QWidget *editor, const QModelIndex &index) const |
| void | setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const |
| void | updateEditorGeometry (QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const |
| bool | editorEvent (QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) |
Public Attributes | |
| QAbstractItemDelegate * | delegate |
Definition at line 49 of file qxtcrumbview.cpp.
| QxtCrumbViewDelegate::QxtCrumbViewDelegate | ( | QAbstractItemDelegate * | other, |
| QObject * | parent | ||
| ) | [inline] |
Definition at line 51 of file qxtcrumbview.cpp.
: QAbstractItemDelegate(parent), delegate(other) { QObject::connect(other, SIGNAL(closeEditor(QWidget*, QAbstractItemDelegate::EndEditHint)), this, SIGNAL(closeEditor(QWidget*, QAbstractItemDelegate::EndEditHint))); QObject::connect(other, SIGNAL(commitData(QWidget*)), this, SIGNAL(commitData(QWidget*))); QObject::connect(other, SIGNAL(sizeHintChanged(QModelIndex)), this, SIGNAL(sizeHintChanged(QModelIndex))); }
| QWidget* QxtCrumbViewDelegate::createEditor | ( | QWidget * | parent, |
| const QStyleOptionViewItem & | option, | ||
| const QModelIndex & | index | ||
| ) | [inline] |
Definition at line 77 of file qxtcrumbview.cpp.
References delegate.
{
return delegate->createEditor(parent, option, index);
}
| bool QxtCrumbViewDelegate::editorEvent | ( | QEvent * | event, |
| QAbstractItemModel * | model, | ||
| const QStyleOptionViewItem & | option, | ||
| const QModelIndex & | index | ||
| ) | [inline] |
Definition at line 93 of file qxtcrumbview.cpp.
References delegate.
{
return delegate->editorEvent(event, model, option, index);
}
| void QxtCrumbViewDelegate::paint | ( | QPainter * | painter, |
| const QStyleOptionViewItem & | option, | ||
| const QModelIndex & | index | ||
| ) | const [inline] |
Definition at line 60 of file qxtcrumbview.cpp.
References delegate.
{
delegate->paint(painter, option, index);
if(!index.model()->hasChildren(index)) return;
int arrow = 8;
int pad = (option.rect.height() - arrow) / 2;
QStyleOption arrowOption;
arrowOption = option;
arrowOption.rect = QRect(option.rect.right() - arrow, option.rect.top() + pad, arrow, arrow);
QApplication::style()->drawPrimitive(QStyle::PE_IndicatorArrowRight, &arrowOption, painter);
}
| void QxtCrumbViewDelegate::setEditorData | ( | QWidget * | editor, |
| const QModelIndex & | index | ||
| ) | const [inline] |
Definition at line 81 of file qxtcrumbview.cpp.
References delegate.
{
delegate->setEditorData(editor, index);
}
| void QxtCrumbViewDelegate::setModelData | ( | QWidget * | editor, |
| QAbstractItemModel * | model, | ||
| const QModelIndex & | index | ||
| ) | const [inline] |
Definition at line 85 of file qxtcrumbview.cpp.
References delegate.
{
delegate->setModelData(editor, model, index);
}
| QSize QxtCrumbViewDelegate::sizeHint | ( | const QStyleOptionViewItem & | option, |
| const QModelIndex & | index | ||
| ) | const [inline] |
Definition at line 73 of file qxtcrumbview.cpp.
References delegate.
{
return delegate->sizeHint(option, index) + QSize(8, 0);
}
| void QxtCrumbViewDelegate::updateEditorGeometry | ( | QWidget * | editor, |
| const QStyleOptionViewItem & | option, | ||
| const QModelIndex & | index | ||
| ) | const [inline] |
Definition at line 89 of file qxtcrumbview.cpp.
References delegate.
{
delegate->updateEditorGeometry(editor, option, index);
}
| QAbstractItemDelegate* QxtCrumbViewDelegate::delegate |
Definition at line 58 of file qxtcrumbview.cpp.
Referenced by createEditor(), editorEvent(), paint(), setEditorData(), setModelData(), sizeHint(), and updateEditorGeometry().
1.7.2