Skip to content

Commit

Permalink
simplify test
Browse files Browse the repository at this point in the history
  • Loading branch information
anton-danielsson committed Apr 18, 2024
1 parent 0a922dd commit 64370d3
Showing 1 changed file with 2 additions and 20 deletions.
22 changes: 2 additions & 20 deletions recipes/qcustomplot/all/test_package/test_package.cpp
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
#include <qcustomplot.h>
// Checks that qcustomplot can be included but not much more.

#include <QApplication>
#include <QMainWindow>
#include <QVector>
#include <qcustomplot.h>

int main(int argc, char *argv[]) {
QApplication app(argc, argv);
QMainWindow window;

QCustomPlot customPlot;
window.setCentralWidget(&customPlot);

QVector<double> x(101), y(101);
for (int i = 0; i < 101; ++i) {
x[i] = i / 50.0 - 1;
y[i] = x[i] * x[i];
}
customPlot.addGraph();
customPlot.graph(0)->setData(x, y);
customPlot.xAxis->setLabel("x");
customPlot.yAxis->setLabel("y");
customPlot.rescaleAxes();

window.setGeometry(100, 100, 500, 400);
return 0;
}

0 comments on commit 64370d3

Please sign in to comment.