summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarius Bugge Monsen <mmonsen@trolltech.com>2009-06-24 12:01:28 (GMT)
committerMarius Bugge Monsen <mmonsen@trolltech.com>2009-06-24 12:12:43 (GMT)
commit127e68d3dc4ff83293d7e364af870e019fe7cd17 (patch)
tree17d534e7f8feb78ddb5326ec6ec985cf27c03153 /src
parent353dcfd307853da289fdd245410e2e07358624a0 (diff)
downloadQt-127e68d3dc4ff83293d7e364af870e019fe7cd17.zip
Qt-127e68d3dc4ff83293d7e364af870e019fe7cd17.tar.gz
Qt-127e68d3dc4ff83293d7e364af870e019fe7cd17.tar.bz2
Fix the painting of item view background when items are disabled.
Change QTableView to use the style to draw the background. Change QCommonStyle to draw the background correctly when the item is disabled. Task-number: 250682 Reviewed-by: Jens Bache-Wiig
Diffstat (limited to 'src')
-rw-r--r--src/gui/itemviews/qtableview.cpp3
-rw-r--r--src/gui/styles/qcommonstyle.cpp2
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: