From 9b08b0ff8cc6981519e32fac0423f09bf0967692 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 31 Jul 2007 10:42:45 +0000 Subject: [PATCH] - little improvement in download list delegate - Disabled editor in finished list --- src/DLListDelegate.h | 9 --------- src/FinishedListDelegate.h | 5 +++++ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/DLListDelegate.h b/src/DLListDelegate.h index d21a32b6e..969295643 100644 --- a/src/DLListDelegate.h +++ b/src/DLListDelegate.h @@ -104,15 +104,6 @@ class DLListDelegate: public QItemDelegate { } } - QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const{ - QVariant value = index.data(Qt::FontRole); - QFont fnt = value.isValid() ? qvariant_cast(value) : option.font; - QFontMetrics fontMetrics(fnt); - const QString text = index.data(Qt::DisplayRole).toString(); - QRect textRect = QRect(0, 0, 0, fontMetrics.lineSpacing() * (text.count(QLatin1Char('\n')) + 1)); - return textRect.size(); - } - QWidget* createEditor(QWidget*, const QStyleOptionViewItem &, const QModelIndex &) const { // No editor here return 0; diff --git a/src/FinishedListDelegate.h b/src/FinishedListDelegate.h index 13ed7d50b..b4a7e03f8 100644 --- a/src/FinishedListDelegate.h +++ b/src/FinishedListDelegate.h @@ -133,6 +133,11 @@ class FinishedListDelegate: public QItemDelegate { return textRect.size(); } + QWidget* createEditor(QWidget*, const QStyleOptionViewItem &, const QModelIndex &) const { + // No editor here + return 0; + } + }; #endif