Browse Source

- little improvement in download list delegate

- Disabled editor in finished list
adaptive-webui-19844
Christophe Dumez 18 years ago
parent
commit
9b08b0ff8c
  1. 9
      src/DLListDelegate.h
  2. 5
      src/FinishedListDelegate.h

9
src/DLListDelegate.h

@ -104,15 +104,6 @@ class DLListDelegate: public QItemDelegate { @@ -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<QFont>(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;

5
src/FinishedListDelegate.h

@ -133,6 +133,11 @@ class FinishedListDelegate: public QItemDelegate { @@ -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

Loading…
Cancel
Save