From 2d5ddfb04077c3d556a76e902ab72dde3ab7f0b9 Mon Sep 17 00:00:00 2001 From: rekols Date: Mon, 22 Jan 2018 17:05:44 +0800 Subject: [PATCH] fix(listitem): do not draw the last line. Change-Id: I3d65740d2519c053056ddc530a162a427906a80a --- deepin-font-installer/listitem.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/deepin-font-installer/listitem.cpp b/deepin-font-installer/listitem.cpp index 13435df..60b5d3a 100644 --- a/deepin-font-installer/listitem.cpp +++ b/deepin-font-installer/listitem.cpp @@ -106,12 +106,16 @@ void ListItem::paintEvent(QPaintEvent *e) { Q_UNUSED(e); + if (m_item->listWidget()->count() >= 1 && + m_item == m_item->listWidget()->item(m_item->listWidget()->count() - 1)) { + return; + } + QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing, true); - - painter.setPen(Qt::NoPen); - painter.setBrush(QColor(151, 151, 151, 255 * 0.1)); - painter.drawRect(QRect(60, rect().height() - 1, rect().width() - 70, 1)); + painter.setPen(QColor(151, 151, 151, 255 * 0.1)); + painter.drawLine(QPoint(60, rect().height() - 1), + QPoint(rect().width() - 5, rect().height() - 1)); } void ListItem::enterEvent(QEvent *e)