summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-09-03 10:51:40 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-09-10 03:15:49 +0200
commitd49a7412f55390e461773f4ffc36a82958d59b6d (patch)
tree20e860fa351f8e52ad8bb332793248a735d7e3bc /examples
parentae7442a4e93d4a63f28c1c2692be80a3d87f54a9 (diff)
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 <volker.hilsheimer@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Diffstat (limited to 'examples')
-rw-r--r--examples/sql/books/bookdelegate.cpp7
1 files changed, 1 insertions, 6 deletions
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();