4 #include <QStatusBar> |
4 #include <QStatusBar> |
5 #include <QSplitter> |
5 #include <QSplitter> |
6 |
6 |
7 #include "RelpipeChartMainWindow.h" |
7 #include "RelpipeChartMainWindow.h" |
8 |
8 |
|
9 using namespace relpipe::reader; |
|
10 using namespace relpipe::reader::handlers; |
|
11 |
9 RelpipeChartMainWindow::RelpipeChartMainWindow() { |
12 RelpipeChartMainWindow::RelpipeChartMainWindow() { |
10 widget.setupUi(this); |
13 widget.setupUi(this); |
11 |
14 |
12 QTabWidget* tabs = new QTabWidget(this); |
15 tabs->addTab(new QPushButton("here will be options", tabs), "Options"); |
13 |
16 |
14 for (int i = 0; i < 5; i++) { |
17 statusBar()->addWidget(new QLabel("Loading relations...", widget.statusbar)); |
15 QSplitter* splitter = new QSplitter(Qt::Orientation::Vertical, tabs); |
|
16 splitter->addWidget(new QPushButton("here will be the chart", splitter)); |
|
17 splitter->addWidget(new QPushButton("here will be the table", splitter)); |
|
18 tabs->addTab(splitter, "relation_name"); |
|
19 } |
|
20 |
18 |
21 //statusBar()->addWidget(new QPushButton("xxx", widget.statusbar)); |
19 |
22 statusBar()->addWidget(new QLabel("Loading relations...", widget.statusbar)); |
20 // TODO: remove; just demo |
|
21 QPushButton* emitButton = new QPushButton("emit", widget.statusbar); |
|
22 statusBar()->addWidget(emitButton); |
|
23 QObject::connect( |
|
24 emitButton, &QPushButton::pressed, |
|
25 this, &RelpipeChartMainWindow::slot123 |
|
26 ); |
|
27 // --- |
23 |
28 |
24 setCentralWidget(tabs); |
29 setCentralWidget(tabs); |
25 |
30 |
26 } |
31 } |
27 |
32 |
28 RelpipeChartMainWindow::~RelpipeChartMainWindow() { |
33 RelpipeChartMainWindow::~RelpipeChartMainWindow() { |
29 } |
34 } |
|
35 |
|
36 void RelpipeChartMainWindow::slot123() { |
|
37 // TODO: remove; just demo |
|
38 statusBar()->addWidget(new QPushButton("slot123", widget.statusbar)); |
|
39 } |
|
40 |
|
41 void RelpipeChartMainWindow::startRelation(string_t name, std::vector<AttributeMetadata> attributes) { |
|
42 // TODO: chart and table |
|
43 QSplitter* splitter = new QSplitter(Qt::Orientation::Vertical, tabs); |
|
44 splitter->addWidget(new QPushButton("here will be the chart", splitter)); |
|
45 splitter->addWidget(new QPushButton("here will be the table", splitter)); |
|
46 tabs->addTab(splitter, QString::fromWCharArray(name.c_str())); |
|
47 } |
|
48 |
|
49 void RelpipeChartMainWindow::attribute(const string_t& value) { |
|
50 // TODO: fill table and draw chart |
|
51 } |
|
52 |
|
53 void RelpipeChartMainWindow::endOfPipe() { |
|
54 // TODO: just display a message |
|
55 statusBar()->addWidget(new QPushButton("endOfPipe", widget.statusbar)); |
|
56 } |