Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

QxtCrumbView: don't render delegate for invalid indexes

  • Loading branch information...
commit f20410afab017aefcb636c915942a23ccdf898dd 1 parent bd5da17
ahigerd authored
Showing with 7 additions and 5 deletions.
  1. +7 −5 src/gui/qxtcrumbview.cpp
12 src/gui/qxtcrumbview.cpp
View
@@ -132,11 +132,13 @@ class QxtCrumbViewButton : public QAbstractButton {
}
int border = painter.style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
option.rect = option.rect.adjusted(border, border, -border, -border);
- QAbstractItemDelegate* delegate = static_cast<QxtCrumbView*>(parent())->crumbDelegate();
- QStyleOptionViewItem itemOption;
- itemOption.initFrom(this);
- itemOption.rect = option.rect;
- delegate->paint(&painter, itemOption, index);
+ if(index.isValid()) {
+ QAbstractItemDelegate* delegate = static_cast<QxtCrumbView*>(parent())->crumbDelegate();
+ QStyleOptionViewItem itemOption;
+ itemOption.initFrom(this);
+ itemOption.rect = option.rect;
+ delegate->paint(&painter, itemOption, index);
+ }
int arrow = 8;
int pad = (height() - (2 * border) - arrow) / 2;
QStyleOption arrowOption;
Please sign in to comment.
Something went wrong with that request. Please try again.