summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Zander <thomas.zander@trolltech.com>2009-05-28 17:05:20 +0200
committerThomas Zander <thomas.zander@trolltech.com>2009-05-28 17:05:20 +0200
commit527cf63e98fac923b50628f561062659053c5c47 (patch)
treea736a28496ac845e615a778f0ef67db9eda57479
parent6b250321ff821f477b2f13aa8988a7412933fef8 (diff)
Grid lines don't show up properly in some cases, or do when they should not. Some comments on
how we want to do that properly
-rw-r--r--src/qgraphicstableview.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/qgraphicstableview.cpp b/src/qgraphicstableview.cpp
index 794b39a..1460fef 100644
--- a/src/qgraphicstableview.cpp
+++ b/src/qgraphicstableview.cpp
@@ -142,8 +142,15 @@ void QtGraphicsTableViewItem::paint(QPainter *painter, const QStyleOptionGraphic
style()->drawControl(QStyle::CE_ItemViewItem, &d->option, painter, widget);
// draw grid
const QColor gridColor = static_cast<QRgb>(style()->styleHint(QStyle::SH_Table_GridLineColor, &d->option, widget));
- painter->fillRect(option->rect.left(), option->rect.bottom(), option->rect.width(), 1, gridColor);
- painter->fillRect(option->rect.right(), option->rect.top(), 1, option->rect.height(), gridColor);
+// TODO check for option and make the left+top painting ones actually work
+ // left
+ //painter->fillRect(d->option.rect.left(), d->option.rect.bottom(), d->option.rect.width(), 1, gridColor);
+ // top
+ //painter->fillRect(d->option.rect.right(), d->option.rect.top(), 1, d->option.rect.height(), gridColor);
+ // right
+ painter->fillRect(d->option.rect.left(), d->option.rect.bottom(), d->option.rect.width(), 1, gridColor);
+ // bottom
+ painter->fillRect(d->option.rect.right(), d->option.rect.top(), 1, d->option.rect.height(), gridColor);
}
/*!
\class QtGraphicsTableViewItemCreatorBase
@@ -1166,6 +1173,10 @@ void QtGraphicsTableView::initStyleOption(QStyleOptionViewItemV4 *option, int ro
} else {
option->text = QString();
}
+
+ if (d->showGrid) {
+ // TODO create and set a flag for each of the sides of the cell to paint the grid lines.
+ }
}
/*!