diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/percent_bar_delegate.cpp | 2 | ||||
-rw-r--r-- | ui/qt/percent_bar_delegate.h | 4 | ||||
-rw-r--r-- | ui/qt/timeline_delegate.cpp | 3 | ||||
-rw-r--r-- | ui/qt/timeline_delegate.h | 4 |
4 files changed, 10 insertions, 3 deletions
diff --git a/ui/qt/percent_bar_delegate.cpp b/ui/qt/percent_bar_delegate.cpp index 2a8ea0b2f2..358650ee5d 100644 --- a/ui/qt/percent_bar_delegate.cpp +++ b/ui/qt/percent_bar_delegate.cpp @@ -37,7 +37,7 @@ void PercentBarDelegate::paint(QPainter *painter, const QStyleOptionViewItem &op // Paint our rect with no text using the current style, then draw our // bar and text over it. - QStyledItemDelegate::paint(painter, option, QModelIndex()); + QStyledItemDelegate::paint(painter, option, index); bool ok = false; double value = index.data(Qt::UserRole).toDouble(&ok); diff --git a/ui/qt/percent_bar_delegate.h b/ui/qt/percent_bar_delegate.h index 0a3ac9af67..2c8d47288f 100644 --- a/ui/qt/percent_bar_delegate.h +++ b/ui/qt/percent_bar_delegate.h @@ -51,6 +51,10 @@ class PercentBarDelegate : public QStyledItemDelegate public: PercentBarDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent) { } + + // Make sure QStyledItemDelegate::paint doesn't draw any text. + virtual QString displayText(const QVariant &, const QLocale &) const { return QString(); } + protected: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; diff --git a/ui/qt/timeline_delegate.cpp b/ui/qt/timeline_delegate.cpp index 0cfdd73147..2162da1030 100644 --- a/ui/qt/timeline_delegate.cpp +++ b/ui/qt/timeline_delegate.cpp @@ -43,12 +43,11 @@ void TimelineDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opti QStyleOptionViewItem option_vi = option; QStyledItemDelegate::initStyleOption(&option_vi, index); - struct timeline_span span_px = index.data(Qt::UserRole).value<struct timeline_span>(); // Paint our rect with no text using the current style, then draw our // bar and text over it. - QStyledItemDelegate::paint(painter, option, QModelIndex()); + QStyledItemDelegate::paint(painter, option, index); if (QApplication::style()->objectName().contains("vista")) { // QWindowsVistaStyle::drawControl does this internally. Unfortunately there diff --git a/ui/qt/timeline_delegate.h b/ui/qt/timeline_delegate.h index face6da320..bc64c24877 100644 --- a/ui/qt/timeline_delegate.h +++ b/ui/qt/timeline_delegate.h @@ -58,6 +58,10 @@ class TimelineDelegate : public QStyledItemDelegate public: TimelineDelegate(QWidget *parent = 0); + + // Make sure QStyledItemDelegate::paint doesn't draw any text. + virtual QString displayText(const QVariant &, const QLocale &) const { return QString(); } + protected: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const; |