Qt Charts: includes and namespace v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Mon, 08 Oct 2018 14:08:21 +0200
branchv_0
changeset 22 0f0344e1ba61
parent 21 a05fa65d47de
child 23 ff4a1c07a481
Qt Charts: includes and namespace
src/RelpipeChartMainWindow.cpp
--- a/src/RelpipeChartMainWindow.cpp	Sun Sep 30 21:49:02 2018 +0200
+++ b/src/RelpipeChartMainWindow.cpp	Mon Oct 08 14:08:21 2018 +0200
@@ -6,10 +6,17 @@
 #include <QScrollArea>
 #include <QTableWidget>
 
+#include <QChart>
+#include <QChartView>
+#include <QStackedBarSeries>
+#include <QBarCategoryAxis>
+#include <QVBarModelMapper>
+
 #include "RelpipeChartMainWindow.h"
 
 using namespace relpipe::reader;
 using namespace relpipe::reader::handlers;
+QT_CHARTS_USE_NAMESPACE
 
 RelpipeChartMainWindow::RelpipeChartMainWindow() {
 	widget.setupUi(this);
@@ -48,7 +55,8 @@
 	integer_t column = attributeCounter % currentTable->columnCount();
 	integer_t row = attributeCounter / currentTable->columnCount();
 	if (row >= currentTable->rowCount()) currentTable->insertRow(currentTable->rowCount());
-	currentTable->setItem(row, column, new QTableWidgetItem(QString::fromWCharArray(value.c_str())));
+	QString name = QString::fromWCharArray(value.c_str());
+	currentTable->setItem(row, column, new QTableWidgetItem(name));
 	attributeCounter++;
 }