mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Print: update drawing of the profile table grid
The new table layout requires that we draw the vertical and horizontal lines differently. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
3b7500fd33
commit
f85b434ef1
1 changed files with 6 additions and 8 deletions
|
@ -329,15 +329,13 @@ void ProfilePrintDelegate::paint(QPainter *painter, const QStyleOptionViewItem &
|
||||||
|
|
||||||
// grid color
|
// grid color
|
||||||
painter->setPen(QPen(QColor(0xff999999)));
|
painter->setPen(QPen(QColor(0xff999999)));
|
||||||
// top line
|
// horizontal lines
|
||||||
if (row == 2 || row == 3 || row == 10 || col == 3 || col == 4)
|
if (row == 2 || row == 4 || row == 6)
|
||||||
painter->drawLine(rect.topLeft(), rect.topRight());
|
painter->drawLine(rect.topLeft(), rect.topRight());
|
||||||
if (row > 1 && row < 10) {
|
if (row == 7)
|
||||||
// left line - draw always for these rows
|
painter->drawLine(rect.bottomLeft(), rect.bottomRight());
|
||||||
|
// vertical lines
|
||||||
|
if (row > 1)
|
||||||
painter->drawLine(rect.topLeft(), rect.bottomLeft());
|
painter->drawLine(rect.topLeft(), rect.bottomLeft());
|
||||||
// "fix" for missing (?) right line after col 5
|
|
||||||
if (col > 5 || (col > 4 && row == 2))
|
|
||||||
painter->drawLine(rect.topRight(), rect.bottomRight());
|
|
||||||
}
|
|
||||||
QStyledItemDelegate::paint(painter, option, index);
|
QStyledItemDelegate::paint(painter, option, index);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue