| 52 | #define ROLE_SIZE Qt::UserRole + 1 |
| 53 | |
| 54 | MainWindow::MainWindow(QWidget *parent) |
| 55 | : QWidget(parent) |
| 56 | { |
| 57 | setupUi(this); |
| 58 | |
| 59 | auto *chartLayout = new QHBoxLayout(chartFrame); |
| 60 | m_chart = new Chart(); |
| 61 | chartLayout->addWidget(m_chart); |
| 62 | // Set up the data |
| 63 | initializeDataModel(); |
| 64 | // Set up the diagram |
| 65 | m_plotter = new Plotter(); |
| 66 | // Register the data model at the diagram |
| 67 | m_plotter->setModel(m_model); |
| 68 | // Add axes to the diagram |
| 69 | auto *xAxis = new CartesianAxis(m_plotter); |
| 70 | auto *xAxis2 = new CartesianAxis(m_plotter); |
| 71 | auto *yAxis = new CartesianAxis(m_plotter); |
| 72 | auto *yAxis2 = new CartesianAxis(m_plotter); |
| 73 | xAxis->setPosition(KDChart::CartesianAxis::Bottom); |
| 74 | xAxis2->setPosition(KDChart::CartesianAxis::Top); |
| 75 | yAxis->setPosition(KDChart::CartesianAxis::Left); |
| 76 | yAxis2->setPosition(KDChart::CartesianAxis::Right); |
| 77 | m_plotter->addAxis(xAxis); |
| 78 | m_plotter->addAxis(xAxis2); |
| 79 | m_plotter->addAxis(yAxis); |
| 80 | m_plotter->addAxis(yAxis2); |
| 81 | connect(threeDEnabled, SIGNAL(toggled(bool)), this, SLOT(setMarkerAttributes())); |
| 82 | |
| 83 | m_chart->coordinatePlane()->replaceDiagram(m_plotter); |
| 84 | m_chart->setGlobalLeading(20, 20, 20, 20); |
| 85 | |
| 86 | setMarkerAttributes(); |
| 87 | } |
| 88 | |
| 89 | void MainWindow::initializeDataModel() |
| 90 | { |
nothing calls this directly
no test coverage detected