diff options
-rw-r--r-- | src/gui/itemviews/qtableview.cpp | 3 | ||||
-rw-r--r-- | src/gui/styles/qcommonstyle.cpp | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp index 1d37b59..c676237 100644 --- a/src/gui/itemviews/qtableview.cpp +++ b/src/gui/itemviews/qtableview.cpp @@ -488,8 +488,7 @@ void QTableViewPrivate::drawCell(QPainter *painter, const QStyleOptionViewItemV4 opt.state |= QStyle::State_HasFocus; } - if (opt.features & QStyleOptionViewItemV2::Alternate) - painter->fillRect(opt.rect, opt.palette.brush(QPalette::AlternateBase)); + q->style()->drawPrimitive(QStyle::PE_PanelItemViewRow, &opt, painter, q); if (const QWidget *widget = editorForIndex(index).editor) { painter->save(); diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp index c5c6973..24ff792 100644 --- a/src/gui/styles/qcommonstyle.cpp +++ b/src/gui/styles/qcommonstyle.cpp @@ -770,6 +770,8 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q p->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::Highlight)); else if (vopt->features & QStyleOptionViewItemV2::Alternate) p->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::AlternateBase)); + else if (!(vopt->state & QStyle::State_Enabled)) + p->fillRect(vopt->rect, vopt->palette.brush(cg, QPalette::Base)); } break; case PE_PanelItemViewItem: |