From 4341713e92b57d0f2e4ce110adf91d2709abcb96 Mon Sep 17 00:00:00 2001 From: rxy2 <50692621+rxy2@users.noreply.github.com> Date: Wed, 9 Dec 2020 16:46:35 +0800 Subject: [PATCH] add painterpath head file and delete the not unused variable --- src/newresource/cpuhistorychart.cpp | 2 ++ src/newresource/cpuhistorychart.h | 2 -- src/newresource/networkchart.cpp | 1 + src/newresource/sigcheck.cpp | 1 + src/newresource/sigcheck.h | 1 + src/newresource/swapandmemorychart.cpp | 1 + src/newresource/swapandmemorychart.h | 4 +--- 7 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/newresource/cpuhistorychart.cpp b/src/newresource/cpuhistorychart.cpp index 122b4b6..eabdd89 100644 --- a/src/newresource/cpuhistorychart.cpp +++ b/src/newresource/cpuhistorychart.cpp @@ -85,6 +85,8 @@ void CpuHistoryChart::paintEvent(QPaintEvent *event) painter.drawPath(m_cpuHistoryPath);//绘制前面创建的path:m_downloadPath painter.restore(); update(); + QWidget::paintEvent(event); + // **********************************现在的折线图写法********************************/ /* QPainter painter(this); diff --git a/src/newresource/cpuhistorychart.h b/src/newresource/cpuhistorychart.h index 0852877..2f385cc 100644 --- a/src/newresource/cpuhistorychart.h +++ b/src/newresource/cpuhistorychart.h @@ -26,8 +26,6 @@ #include #include -static int i =1; - class CpuHistoryChart : public QWidget { Q_OBJECT diff --git a/src/newresource/networkchart.cpp b/src/newresource/networkchart.cpp index 60c0036..3c9765e 100644 --- a/src/newresource/networkchart.cpp +++ b/src/newresource/networkchart.cpp @@ -97,6 +97,7 @@ void NetWorkChart::paintEvent(QPaintEvent *event) painter.setRenderHint(QPainter::Antialiasing, true); painter.drawPath(m_upLoadPath);//绘制前面创建的path:m_downloadPath painter.restore(); + QWidget::paintEvent(event); } void NetWorkChart::onUpdateDownloadAndUploadData(long recvTotalBytes, long sentTotalBytes, long recvRateBytes, long sentRateBytes) diff --git a/src/newresource/sigcheck.cpp b/src/newresource/sigcheck.cpp index 1b23a73..d361658 100644 --- a/src/newresource/sigcheck.cpp +++ b/src/newresource/sigcheck.cpp @@ -71,4 +71,5 @@ void sigCheck::paintEvent(QPaintEvent *event) p.drawRoundedRect(opt.rect,2,2); setProperty("blurRegion",QRegion(path.toFillPolygon().toPolygon())); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); + QWidget::paintEvent(event); } diff --git a/src/newresource/sigcheck.h b/src/newresource/sigcheck.h index dd9b3aa..42da5c3 100644 --- a/src/newresource/sigcheck.h +++ b/src/newresource/sigcheck.h @@ -24,6 +24,7 @@ #include #include #include +#include #include "../shell/macro.h" class sigCheck : public QWidget{ diff --git a/src/newresource/swapandmemorychart.cpp b/src/newresource/swapandmemorychart.cpp index 17a7606..519b1ca 100644 --- a/src/newresource/swapandmemorychart.cpp +++ b/src/newresource/swapandmemorychart.cpp @@ -248,4 +248,5 @@ void SwapAndMemoryChart::paintEvent(QPaintEvent *event) painter.setRenderHint(QPainter::Antialiasing, true); painter.drawPath(m_swapPath);//绘制前面创建的path:m_downloadPath painter.restore(); + QWidget::paintEvent(event); } diff --git a/src/newresource/swapandmemorychart.h b/src/newresource/swapandmemorychart.h index fffb360..68b20c7 100644 --- a/src/newresource/swapandmemorychart.h +++ b/src/newresource/swapandmemorychart.h @@ -27,11 +27,9 @@ #include #include #include - +#include #include "smoothlinegenerator.h" -static int i1 =1; - class SwapAndMemoryChart : public QWidget { Q_OBJECT