qwt之简单应用

qwt作为qt一个界面方面库,有好多比较经典的界面扩展。项目在sf上。

在msys2上有已经编译好的,比较方便。

安装之后在,designer上就可以看到qwt各功能,有plot,clock, dial, knob等等。

有pro中添加需要的内容,如下 :

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

CONFIG += c++11

INCLUDEPATH += C:/msys64/mingw64/include/opencv4 \
C:/msys64/mingw64/include/qwt
LIBS += -lopencv_core.dll -lopencv_imgcodecs.dll -lopencv_imgproc.dll -lopencv_highgui.dll -lopencv_aruco.dll -lqwt.dll

# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
    main.cpp \
    mainwindow.cpp \
    opencv001.cpp

HEADERS += \
    mainwindow.h \
    opencv001.h

FORMS += \
    mainwindow.ui

TRANSLATIONS += \
    gcc10_opencv_test001_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

其中:

INCLUDINGPATH += c:/msys64/mingw64/include/qwt

LIBS += -lqwt.dll

就是qwt需要的头文件和库文件引用。

添加如下控件:

也添加了二个信号,就是看各个之间的关系。

代码 如下:

主要为Dial设置一下needle。

效果如下:

多谢,亲爱的美美。

猜你喜欢

转载自blog.csdn.net/islinyoubiao/article/details/113620340
qwt
今日推荐