Files
Obsidian/QT/补充内容.md
2025-08-23 15:15:57 +08:00

52 lines
2.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

![[kafka_2_消息队列通信的模式.pptx]]![[kafka_1_概念.pptx]]
![[kafka_4_消息格式.pptx]]
![[kafka_3_架构原理.pptx]]
![[RocketMq_1_原理.pptx]]
![[RocketMq_2_消息格式.pptx]]
qcustomplot是一个第三方库用来绘制图表的很有名。以后如果遇到绘制图表的需求就会用到它。
官网。https://www.qcustomplot.com/index.php/introduction
1、 下载后将qcustomplot.cpp和qcustomplot.h加入到工程中。
2、 在.pro文件添加打印支持。greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport。否则编译会报错。c++11支持在工程中已经自动添加了。
3、 example是例子程序里面有各种图表。
![[qcustomplot.zip]]
![[016cf2ec99554101094703fbf2d0c6ee_.png]]
![[aaa800e142788cf565ac37315721a8a0_.png]]
![[9880bbadba9f47a4f5ea039bf6a5c589_.png]]
![[298e44ff81e6f5da424ed5794b746193_.png]]
还有另一个第三方库也是用来制作图表的qwt。
官网https://sourceforge.net/projects/qwt/
这个库的使用不是把代码添加进来,而是把动态库添加进来。
步骤:
1、先把qwt-6.1.4.zip解压
进入目录下面用Qt Creator打开qwt.pro文件即打开了Qwt工程。
编译生成的库文件都在build-qwt-Desktop_Qt_5_12_3_MinGW_32_bit-Debug下面。
2、
将build-qwt-Desktop_Qt_5_12_3_MinGW_32_bit-Debug\lib下的libqwt.a和libqwtd.a复制到D:\Qt\Qt5.12.3\5.12.3\mingw73_32\lib下。
将build-qwt-Desktop_Qt_5_12_3_MinGW_32_bit-Debug\lib下的qwt.dll和qwtd.dll复制到D:\Qt\Qt5.12.3\5.12.3\mingw73_32\bin下。
将build-qwt-Desktop_Qt_5_12_3_MinGW_32_bit-Debug\plugins\designer下的qwt_designer_plugin.dll复制到D:\Qt\Qt5.12.3\5.12.3\mingw73_32\plugins\designer下。
在D:\Qt\Qt5.12.3\5.12.3\mingw73_32\include下新建一个Qwt的文件夹将D:\Qwt-6.1.4\src下的所有.h头文件复制到新建的Qwt文件夹下。
3、新建Qt工程在.pro文件加入
1. DEFINES += QT_DLL QWT_DLL
2.
3. LIBS += -lqwtd
4.
5. LIBS += -lqwt
6.
7. INCLUDEPATH +=D:\Qt\Qt5.12.3\5.12.3\mingw73_32\include\Qwt
4、使用qt designerqt creator里面的设计界面会看不到组件只能看到位置打开ui界面文件可以拖拽qwt组件到界面上。
![[qwt-6.1.4.zip]]