Give the items a bit more spacing / enable the delegate

Enable the new delegate on the view, and give the items a bit more
spacing, so we can draw things around them.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-01-07 15:09:29 -02:00 committed by Dirk Hohndel
parent 8531cec100
commit ce9d972ffa

View file

@ -329,7 +329,7 @@ DiveLogImportDialog::DiveLogImportDialog(QStringList fn, QWidget *parent) : QDia
ColumnNameProvider *provider = new ColumnNameProvider(this);
ui->avaliableColumns->setModel(provider);
ui->avaliableColumns->setItemDelegate(new TagDragDelegate(ui->avaliableColumns));
resultModel = new ColumnNameResult(this);
ui->tableView->setModel(resultModel);
@ -487,7 +487,8 @@ TagDragDelegate::TagDragDelegate(QObject *parent) : QStyledItemDelegate(parent)
QSize TagDragDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const
{
return QStyledItemDelegate::sizeHint(option, index);
QSize originalSize = QStyledItemDelegate::sizeHint(option, index);
return originalSize + QSize(5,5);
}
void TagDragDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const