Use environment:
VS2017+QT5.12.3+QCustomPlo2.01。
QCustomPlot is a Qt C++ control for drawing and data visualization, which is easy to use and concise. QCustomPlot provides convenience for displaying real-time data and generating high-quality charts in the application. The download address is as follows:
https://www.qcustomplot.com/index.php/download
After the download is successful, unzip the compressed package. What we need are the two files qcustomplot.h and qcustomplot.cpp, which can be placed in the header folder and source folder of the QT project respectively.
Ideally, it can be used normally without configuration, but it is often not so smooth. So what problems will you encounter?
1. Compiler error E2512 The parameter of the function test macro must be a simple identifier.
When encountering this problem, locate the specific location through the error list of VS. Generally, there is a problem with this piece of code in qcompilerdetection.h
We can modify it into the following form and recompile to solve the exception
2. The solution to an exception occurs in the compilation
The reason for the exception is the lack of dependencies. Right-click the project and select "Properties"-"Property Configuration"-"Connector"-"Input", and add Qt5PrintSupportd.lib in the "Additional Dependencies".
The above are the most common problems when using QCustomPlo. After solving the exception, you can use QCustomPlo like a Widget .