|
|
|
@ -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; |
|
|
|
|