From d49a7412f55390e461773f4ffc36a82958d59b6d Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 3 Sep 2020 10:51:40 +0200 Subject: Derive some item delegates from QStyledItemDelegate Address a ### Qt6 comment from change 283008e123e5eacb83869682528b2024186634f8, and start using QStyledItemDelegate in more places, so those get proper look and feel. Change-Id: I39767ba99b7942faada1fba0ac241deb35563b63 Reviewed-by: Volker Hilsheimer Reviewed-by: Christian Ehrlicher --- examples/sql/books/bookdelegate.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'examples/sql/books/bookdelegate.cpp') diff --git a/examples/sql/books/bookdelegate.cpp b/examples/sql/books/bookdelegate.cpp index 00bdd1708a..56d9b1f414 100644 --- a/examples/sql/books/bookdelegate.cpp +++ b/examples/sql/books/bookdelegate.cpp @@ -61,10 +61,7 @@ void BookDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { if (index.column() != 5) { - QStyleOptionViewItem opt = option; - // Since we draw the grid ourselves: - opt.rect.adjust(0, 0, -1, -1); - QSqlRelationalDelegate::paint(painter, opt, index); + QSqlRelationalDelegate::paint(painter, option, index); } else { const QAbstractItemModel *model = index.model(); QPalette::ColorGroup cg = (option.state & QStyle::State_Enabled) ? @@ -87,8 +84,6 @@ void BookDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, painter->drawPixmap(x, y, star); x += width; } - // Since we draw the grid ourselves: - drawFocus(painter, option, option.rect.adjusted(0, 0, -1, -1)); } QPen pen = painter->pen(); -- cgit v1.2.3