diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/mainwindow.cpp | 8 | ||||
-rw-r--r-- | client/mainwindow.ui | 37 |
2 files changed, 17 insertions, 28 deletions
diff --git a/client/mainwindow.cpp b/client/mainwindow.cpp index 1e74ed0..d3da553 100644 --- a/client/mainwindow.cpp +++ b/client/mainwindow.cpp @@ -30,6 +30,7 @@ void MainWindow::on_actionRefresh_triggered() { QLineSeries *seriesTemperature = new QLineSeries(); QLineSeries *seriesHumidity = new QLineSeries(); + QLineSeries *seriesPressure = new QLineSeries(); _pChart = new QChart(); if(dbRef.open()){ @@ -41,11 +42,13 @@ void MainWindow::on_actionRefresh_triggered() // seriesTemp->append(queryGraphData.value(0).toInt(), queryGraphData.value(1).toInt()); seriesTemperature->append(i, queryGraphData.value(1).toFloat()); seriesHumidity->append(i, queryGraphData.value(2).toFloat()*100); + seriesPressure->append(i, queryGraphData.value(3).toFloat()); } _pChart->legend()->show(); _pChart->addSeries(seriesTemperature); _pChart->addSeries(seriesHumidity); + _pChart->addSeries(seriesPressure); _pChart->createDefaultAxes(); _pChart->setTitle("Weather data:"); _pChartView = new QChartView(_pChart); @@ -56,7 +59,8 @@ void MainWindow::on_actionRefresh_triggered() } else { QMessageBox::warning(this, "No connection", "Failed to connect"); } -// delete seriesTemperature; -// delete seriesHumidity; + delete seriesTemperature; + delete seriesHumidity; + delete seriesPressure; } diff --git a/client/mainwindow.ui b/client/mainwindow.ui index 4ced639..f08cb23 100644 --- a/client/mainwindow.ui +++ b/client/mainwindow.ui @@ -14,36 +14,18 @@ <string>MainWindow</string> </property> <widget class="QWidget" name="centralwidget"> - <widget class="QWidget" name="formLayoutWidget"> + <widget class="QLabel" name="label"> <property name="geometry"> <rect> - <x>90</x> - <y>80</y> - <width>621</width> - <height>301</height> + <x>300</x> + <y>210</y> + <width>181</width> + <height>51</height> </rect> </property> - <layout class="QFormLayout" name="centralFrom"> - <property name="sizeConstraint"> - <enum>QLayout::SetDefaultConstraint</enum> - </property> - <item row="0" column="0"> - <widget class="QWidget" name="widget" native="true"/> - </item> - <item row="1" column="0"> - <widget class="QWidget" name="widget_2" native="true"/> - </item> - <item row="2" column="0"> - <widget class="QWidget" name="widget_3" native="true"/> - </item> - <item row="3" column="0"> - <widget class="QPushButton" name="reLoad"> - <property name="text"> - <string>Reload</string> - </property> - </widget> - </item> - </layout> + <property name="text"> + <string>Please load data first</string> + </property> </widget> </widget> <widget class="QMenuBar" name="menubar"> @@ -83,6 +65,9 @@ <property name="text"> <string>Refresh</string> </property> + <property name="shortcut"> + <string>Ctrl+R</string> + </property> </action> <action name="actionLOAD"> <property name="text"> |