Qwt介绍
QWT, Qt Widgets for Technical Applications,是一个基于LGPL版权协议的开源项目,可生成各种统计图。它为具有技术专业背景的程序提供GUI组件和一组实用类,其目标是以基于2D方式的窗体部件来显示数据,数据源以数值,数组或一组浮点数等方式提供, 输出方式可以是Curves(曲线),Slider(滚动条),Dials(圆盘),Compasses(仪表盘)等等。该工具库基于Qt开发,所以也继承了Qt的跨平台特性。
下载地址
稳定版下载地址:http://sourceforge.net/projects/qwt/files/qwt/
配置方法
下载后解压如下
designer文件夹: qwt插件的源码,用于生成Qt Designer插件,插件可以在Qt Designer中直接拖拽使用
doc文件夹:帮助文档
examples文件夹: qwt的示例(源码、可执行程序), 这些工程的生成需要src或designer目录下工程生成的qwt.lib/qwt.dll
src文件夹: qwt的源码
textengines目录:存放数学指标语言的文本驱动引擎代码
pro等工程文件等。
打开项目编译
配置
qt designer
将D:\QT_project\build\build-qwt-Desktop_Qt_5_12_7_MinGW_64_bit-Release\designer\plugins\designer下的qwt_designer_plugin.dll复制到D:\Qt\Qt5.12.3\5.12.3\mingw73_32\plugins\designer下。
打开 qt designer,可编辑控件:
新建项目
- 项目路径下建Qwt 文件夹:
include 中为 D:\QT_project\qwt-6.1.4\src 目录下的所有.h文件;
.a .dll 文件为 D:\QT_project\build\build-qwt-Desktop_Qt_5_12_7_MinGW_64_bit-Release\lib 编译出的文件;
.pri 文件为 D:\QT_project\qwt-6.1.4 目录下文件;
- 配置项目
QT += core gui opengl
#QT += opengl
#include ( ${PWD}/../Qwt/qwt.prf )
DESTDIR = $$PWD/Qwt
#一次性引入自定义控件的所有头文件 懒得一个个拷贝
INCLUDEPATH += $$PWD/Qwt/include
#不同的构建套件 debug release 依赖不同的链接库
CONFIG(debug, debug|release){
LIBS += -L$$PWD/Qwt/ -l qwtd
} else {
LIBS += -L$$PWD/Qwt/ -l qwt
}
#DISTFILES += \
# Qwt/libqwt.a \
# Qwt/libqwtd.a \
# Qwt/qwt.dll \
# Qwt/qwtd.dll
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 \
mainwindow.cpp
HEADERS += \
Qwt/include/qwt_widget_overlay.h \
Qwt/include/qwt.h \
Qwt/include/qwt_abstract_legend.h \
Qwt/include/qwt_abstract_scale.h \
Qwt/include/qwt_abstract_scale_draw.h \
Qwt/include/qwt_abstract_slider.h \
Qwt/include/qwt_analog_clock.h \
Qwt/include/qwt_arrow_button.h \
Qwt/include/qwt_clipper.h \
Qwt/include/qwt_color_map.h \
Qwt/include/qwt_column_symbol.h \
Qwt/include/qwt_compass.h \
Qwt/include/qwt_compass_rose.h \
Qwt/include/qwt_compat.h \
Qwt/include/qwt_counter.h \
Qwt/include/qwt_curve_fitter.h \
Qwt/include/qwt_date.h \
Qwt/include/qwt_date_scale_draw.h \
Qwt/include/qwt_date_scale_engine.h \
Qwt/include/qwt_dial.h \
Qwt/include/qwt_dial_needle.h \
Qwt/include/qwt_dyngrid_layout.h \
Qwt/include/qwt_event_pattern.h \
Qwt/include/qwt_global.h \
Qwt/include/qwt_graphic.h \
Qwt/include/qwt_interval.h \
Qwt/include/qwt_interval_symbol.h \
Qwt/include/qwt_knob.h \
Qwt/include/qwt_legend.h \
Qwt/include/qwt_legend_data.h \
Qwt/include/qwt_legend_label.h \
Qwt/include/qwt_magnifier.h \
Qwt/include/qwt_math.h \
Qwt/include/qwt_matrix_raster_data.h \
Qwt/include/qwt_null_paintdevice.h \
Qwt/include/qwt_painter.h \
Qwt/include/qwt_painter_command.h \
Qwt/include/qwt_panner.h \
Qwt/include/qwt_picker.h \
Qwt/include/qwt_picker_machine.h \
Qwt/include/qwt_pixel_matrix.h \
Qwt/include/qwt_plot.h \
Qwt/include/qwt_plot_abstract_barchart.h \
Qwt/include/qwt_plot_barchart.h \
Qwt/include/qwt_plot_canvas.h \
Qwt/include/qwt_plot_curve.h \
Qwt/include/qwt_plot_dict.h \
Qwt/include/qwt_plot_directpainter.h \
Qwt/include/qwt_plot_glcanvas.h \
Qwt/include/qwt_plot_grid.h \
Qwt/include/qwt_plot_histogram.h \
Qwt/include/qwt_plot_intervalcurve.h \
Qwt/include/qwt_plot_item.h \
Qwt/include/qwt_plot_layout.h \
Qwt/include/qwt_plot_legenditem.h \
Qwt/include/qwt_plot_magnifier.h \
Qwt/include/qwt_plot_marker.h \
Qwt/include/qwt_plot_multi_barchart.h \
Qwt/include/qwt_plot_panner.h \
Qwt/include/qwt_plot_picker.h \
Qwt/include/qwt_plot_rasteritem.h \
Qwt/include/qwt_plot_renderer.h \
Qwt/include/qwt_plot_rescaler.h \
Qwt/include/qwt_plot_scaleitem.h \
Qwt/include/qwt_plot_seriesitem.h \
Qwt/include/qwt_plot_shapeitem.h \
Qwt/include/qwt_plot_spectrocurve.h \
Qwt/include/qwt_plot_spectrogram.h \
Qwt/include/qwt_plot_svgitem.h \
Qwt/include/qwt_plot_textlabel.h \
Qwt/include/qwt_plot_tradingcurve.h \
Qwt/include/qwt_plot_zoneitem.h \
Qwt/include/qwt_plot_zoomer.h \
Qwt/include/qwt_point_3d.h \
Qwt/include/qwt_point_data.h \
Qwt/include/qwt_point_mapper.h \
Qwt/include/qwt_point_polar.h \
Qwt/include/qwt_raster_data.h \
Qwt/include/qwt_round_scale_draw.h \
Qwt/include/qwt_samples.h \
Qwt/include/qwt_sampling_thread.h \
Qwt/include/qwt_scale_div.h \
Qwt/include/qwt_scale_draw.h \
Qwt/include/qwt_scale_engine.h \
Qwt/include/qwt_scale_map.h \
Qwt/include/qwt_scale_widget.h \
Qwt/include/qwt_series_data.h \
Qwt/include/qwt_series_store.h \
Qwt/include/qwt_slider.h \
Qwt/include/qwt_spline.h \
Qwt/include/qwt_symbol.h \
Qwt/include/qwt_system_clock.h \
Qwt/include/qwt_text.h \
Qwt/include/qwt_text_engine.h \
Qwt/include/qwt_text_label.h \
Qwt/include/qwt_thermo.h \
Qwt/include/qwt_transform.h \
Qwt/include/qwt_wheel.h \
mainwindow.h \
FORMS += \
mainwindow.ui
TRANSLATIONS += \
oscilloscope_en_AI.ts
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
- 编译结果