-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainwindow.cpp
39 lines (27 loc) · 971 Bytes
/
mainwindow.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "mainwindow.h"
#include "nodegraph.h"
namespace En
{
MainWindow::MainWindow(NodeGroup* group, QWidget* parent)
: QMainWindow(parent)
, m_group(group)
{
setWindowTitle("Evilnote");
QWidget* widget = new QWidget();
QVBoxLayout* mainLayout = new QVBoxLayout(widget);
setCentralWidget(widget);
//m_utilisationMeter = new QProgressBar();
//m_utilisationMeter->show();
//m_utilisationMeter->setRange(0, INT_MAX);
//mainLayout->addWidget(m_utilisationMeter);
//setCentralWidget(m_utilisationMeter);
NodeGraphEditor* graph = new NodeGraphEditor(group);
mainLayout->addWidget(graph);
m_utilisationText = new QLabel();
statusBar()->addPermanentWidget(m_utilisationText);
}
void MainWindow::utilisation(float utilisationAmount) {
//m_utilisationMeter->setValue(utilisationAmount * INT_MAX);
m_utilisationText->setText(tr("CPU: %1%").arg(QString::number(utilisationAmount * 100, 'f', 0)));
}
}