src/RelpipeChartMainWindow.cpp
branchv_0
changeset 22 0f0344e1ba61
parent 20 b13e7ed9eea3
child 23 ff4a1c07a481
equal deleted inserted replaced
21:a05fa65d47de 22:0f0344e1ba61
     4 #include <QStatusBar>
     4 #include <QStatusBar>
     5 #include <QSplitter>
     5 #include <QSplitter>
     6 #include <QScrollArea>
     6 #include <QScrollArea>
     7 #include <QTableWidget>
     7 #include <QTableWidget>
     8 
     8 
       
     9 #include <QChart>
       
    10 #include <QChartView>
       
    11 #include <QStackedBarSeries>
       
    12 #include <QBarCategoryAxis>
       
    13 #include <QVBarModelMapper>
       
    14 
     9 #include "RelpipeChartMainWindow.h"
    15 #include "RelpipeChartMainWindow.h"
    10 
    16 
    11 using namespace relpipe::reader;
    17 using namespace relpipe::reader;
    12 using namespace relpipe::reader::handlers;
    18 using namespace relpipe::reader::handlers;
       
    19 QT_CHARTS_USE_NAMESPACE
    13 
    20 
    14 RelpipeChartMainWindow::RelpipeChartMainWindow() {
    21 RelpipeChartMainWindow::RelpipeChartMainWindow() {
    15 	widget.setupUi(this);
    22 	widget.setupUi(this);
    16 
    23 
    17 	int optionsIndex = tabs->addTab(new QPushButton("here will be options", tabs), "Options");
    24 	int optionsIndex = tabs->addTab(new QPushButton("here will be options", tabs), "Options");
    46 void RelpipeChartMainWindow::attribute(const string_t value) {
    53 void RelpipeChartMainWindow::attribute(const string_t value) {
    47 	// TODO: draw chart
    54 	// TODO: draw chart
    48 	integer_t column = attributeCounter % currentTable->columnCount();
    55 	integer_t column = attributeCounter % currentTable->columnCount();
    49 	integer_t row = attributeCounter / currentTable->columnCount();
    56 	integer_t row = attributeCounter / currentTable->columnCount();
    50 	if (row >= currentTable->rowCount()) currentTable->insertRow(currentTable->rowCount());
    57 	if (row >= currentTable->rowCount()) currentTable->insertRow(currentTable->rowCount());
    51 	currentTable->setItem(row, column, new QTableWidgetItem(QString::fromWCharArray(value.c_str())));
    58 	QString name = QString::fromWCharArray(value.c_str());
       
    59 	currentTable->setItem(row, column, new QTableWidgetItem(name));
    52 	attributeCounter++;
    60 	attributeCounter++;
    53 }
    61 }
    54 
    62 
    55 void RelpipeChartMainWindow::setStatusMessage(string_t message) {
    63 void RelpipeChartMainWindow::setStatusMessage(string_t message) {
    56 	status->setText(QString::fromWCharArray(message.c_str()));
    64 	status->setText(QString::fromWCharArray(message.c_str()));