Changeset View
Changeset View
Standalone View
Standalone View
src/widgets/plotwidget.cpp
Show All 38 Lines | 31 | { | |||
---|---|---|---|---|---|
39 | _chart->chart()->addAxis(_axisX, Qt::AlignBottom); | 39 | _chart->chart()->addAxis(_axisX, Qt::AlignBottom); | ||
40 | _chart->chart()->axisY()->setRange(0, 3e2); | 40 | _chart->chart()->axisY()->setRange(0, 3e2); | ||
41 | _chart->chart()->axisX()->setRange(QDateTime::currentDateTime().addSecs(-120), QDateTime::currentDateTime()); | 41 | _chart->chart()->axisX()->setRange(QDateTime::currentDateTime().addSecs(-120), QDateTime::currentDateTime()); | ||
42 | _chart->setRenderHint(QPainter::Antialiasing); | 42 | _chart->setRenderHint(QPainter::Antialiasing); | ||
43 | if (palette().text().color().value() >= QColor(Qt::lightGray).value()) { | 43 | if (palette().text().color().value() >= QColor(Qt::lightGray).value()) { | ||
44 | _chart->chart()->setTheme(QChart::ChartThemeDark); | 44 | _chart->chart()->setTheme(QChart::ChartThemeDark); | ||
45 | } | 45 | } | ||
46 | 46 | | |||
47 | QHBoxLayout *mainLayout = new QHBoxLayout; | 47 | auto mainLayout = new QHBoxLayout; | ||
48 | mainLayout->addWidget(_chart); | 48 | mainLayout->addWidget(_chart); | ||
49 | setLayout(mainLayout); | 49 | setLayout(mainLayout); | ||
50 | } | 50 | } | ||
51 | 51 | | |||
52 | void PlotWidget::addPlot(const QString &name) | 52 | void PlotWidget::addPlot(const QString &name) | ||
53 | { | 53 | { | ||
54 | plot _newPlot; | 54 | plot _newPlot; | ||
55 | _newPlot.setName(name); | 55 | _newPlot.setName(name); | ||
Show All 32 Lines | |||||
88 | { | 88 | { | ||
89 | m_maximumPoints = std::max(newMax, 0); | 89 | m_maximumPoints = std::max(newMax, 0); | ||
90 | } | 90 | } | ||
91 | 91 | | |||
92 | void PlotWidget::setMaximumTemperature(const uint maxTemp) | 92 | void PlotWidget::setMaximumTemperature(const uint maxTemp) | ||
93 | { | 93 | { | ||
94 | _chart->chart()->axisY()->setRange(0, maxTemp); | 94 | _chart->chart()->axisY()->setRange(0, maxTemp); | ||
95 | } | 95 | } | ||
96 | | ||||
97 | PlotWidget::~PlotWidget() | | |||
98 | { | | |||
99 | } | |