1
#include "memorywidget.h"
2
#include "memorycircle.h"
7
MemoryWidget::MemoryWidget(QWidget *parent)
10
mainLayout = new QHBoxLayout(this);
11
mainLayout->setContentsMargins(0, 0, 0, 0);
13
QWidget *w = new QWidget;
14
m_widgetLayout = new QVBoxLayout(w);
15
m_widgetLayout->setContentsMargins(0, 0, 0, 0);
16
m_widgetLayout->setSpacing(0);
18
m_title = new QLabel(tr("Memory"));
19
m_title->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
20
m_title->setStyleSheet("background:transparent;font-size:24px;color:#000000");
21
/*QFont font = m_title->font();
22
font.setPointSize(24);
23
font.setWeight(QFont::Light);
24
m_title->setFont(font);*/
26
m_memoryCircle = new MemoryCircle;
27
connect(m_memoryCircle, SIGNAL(rebackMemoryInfo(QString,double)), this, SIGNAL(rebackMemoryInfo(QString,double)));
29
m_widgetLayout->addWidget(m_title);
30
m_widgetLayout->addWidget(m_memoryCircle);
32
mainLayout->addWidget(w, 0, Qt::AlignCenter);
35
MemoryWidget::~MemoryWidget()
38
delete m_memoryCircle;
40
while ((child = m_widgetLayout->takeAt(0)) != 0) {
42
child->widget()->deleteLater();
48
void MemoryWidget::onUpdateMemoryStatus()
50
m_memoryCircle->onUpdateMemoryStatus();