C++代码移植到QT中,并实现数据输入和曲线输出功能
test.pro文件
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
main.cpp \
widget.cpp
HEADERS += \
widget.h
INCLUDEPATH += \
D:\QtFile\02\armadillo\include
D:\QtFile\02\gsl\include
FORMS += \
widget.ui
TRANSLATIONS += \
test_zh_CN.ts
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
include($$PWD/gsl/gsl.pri)
# 宏定义项,指明采用GSL,不使用的话可能会遇到未知错误
DEFINES += GSL_DLL
# 指明GSL库所对应的头文件所在目录
INCLUDEPATH += $$PWD/gsl/include
# 指明依赖库关系,及所依赖的库所在位置
LIBS += -L$$PWD/gsl/lib/libgsl.a
LIBS += -L$$PWD/gsl/lib/libgslcblas.a
在ui上设置12个textedit,用来将数据输入至num_a、num_c、step_a、min_a、max_a、step_c 、min_c、max_c、Pay, Paz 、Pcx 、Pcy,
在ui上实现绘制图像,总计18个·
效果如下
报错:D:\qt\PROJECT\t\test\main.cpp:9: error: armadillo: No such file or directory
[](链接:https://pan.baidu.com/s/1o0KDVMUVrZTtqI8aSJ1MRA
提取码:og8i
--来自百度网盘超级会员V4的分享)