qwtpolar 是 qwt 的扩展,主要用来绘制极坐标下的函数图形,如下图所示。qwtpolar具体的安装配置过程和qwt的类似,qwt的安装配置请参照这篇博客:https://blog.csdn.net/qq_37996632/article/details/105740933
1.下载并解压
下载地址:https://sourceforge.net/projects/qwtpolar/
2.用Qt Creator编译
在qwtpolarbuild.pri中加入下面的几行配置代码,这是之前qwt的库的路径,并且修改下图红框中的配置。
LIBS += -L "C:\Qt\Qt5.12.0\5.12.0\mingw73_64\lib" -lqwtd
INCLUDEPATH += "C:\Qt\Qt5.12.0\5.12.0\mingw73_64\include\qwt"
在qwt_polar_designer_plugin.h中注释掉下图中红框中的那行,加上下面的代码
#include <QtUiPlugin/QDesignerCustomWidgetInterface>
然后点击执行qmake,再点击构建项目qwtpolar
3.用编译出的库去配置Qt
1.复制qwtpolar的静态库
2.复制qwtpolar的动态库
3.复制qwtpolar的designer的库
4.复制qwtpolar的头文件
4.测试是否能正常运行
新键个test项目,修改.pro文件,如下图所示:
写一个最简单的代码测试一下
#include "widget.h"
#include "ui_widget.h"
#include <qwt_polar_plot.h>
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
ui->setupUi(this);
QwtPolarPlot *plot = new QwtPolarPlot();
plot->resize( 600, 600 );
plot->setVisible(true);
}
Widget::~Widget()
{
delete ui;
}
效果如下: