基于QtQuick的QCustomPlot实现
生活随笔
收集整理的這篇文章主要介紹了
基于QtQuick的QCustomPlot实现
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
文章目錄
-
- 前言
- 效果圖
- QML方面實(shí)現(xiàn)
- 注意事項(xiàng)
- 應(yīng)用場(chǎng)景
- 源文件下載
前言
QtQuick開(kāi)發(fā)需要C++基礎(chǔ)和JS基礎(chǔ)
掌握必要的C++基礎(chǔ)是學(xué)習(xí)和使用QtQuick框架的重要基石
QCustomPlot能做什么
可以在QWidget大放異彩,繪制各種圖表和曲線
也可以在QtQuick大展拳腳
- 基于QtQuick的QCustomPlot實(shí)現(xiàn)
- 繼承QQuickPaintedItem類 實(shí)現(xiàn)繪制
效果圖
QML方面實(shí)現(xiàn)
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.0
import QtQuick.XmlListModel 2.0ApplicationWindow {visible: truewidth: 640height: 480title: qsTr("QCustomPlot在QML中使用")SwipeView {id: swipeViewanchors.fill: parentcurrentIndex: tabBar.currentIndexinteractive: falseDDRubberband{}PlotView {}CustomPlotBar{}CustomKLine{}CustomColorMap{}CustomBarCharts{}Page {Label {text: qsTr("This is implementation of http://www.qcustomplot.com/index.php/support/forum/172\n" +"Adding random data on 500 ms tick to plot")anchors.centerIn: parent}XmlListModel {id: xmlModelsource: "qrc:/combox.xml"query: "/rss/item"XmlRole { name: "title"; query: "title/string()" }XmlRole { name: "pubDate"; query: "pubDate/string()" }}ComboBox {textRole: "title"model: xmlModel}}}footer: TabBar {id: tabBarcurrentIndex: swipeView.currentIndexTabButton {text: qsTr("RubberBand")}TabButton {text: qsTr("Plot")}TabButton {text: qsTr("Bar")}TabButton {text: qsTr("KLine")}TabButton {text: qsTr("ColorMap")}TabButton {text: qsTr("BarChart")}TabButton {text: qsTr("Info")}}
}
注意事項(xiàng)
* 需要QCustomPlot源碼
* 需要自己繼續(xù)基于例子進(jìn)行開(kāi)發(fā)自己需要的圖表
應(yīng)用場(chǎng)景
- 方便QCustomPlot業(yè)務(wù)移植到QtQuick應(yīng)用程序上面
源文件下載
源碼下載鏈接源碼
總結(jié)
以上是生活随笔為你收集整理的基于QtQuick的QCustomPlot实现的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 谷歌浏览器中a:link设置字体颜色不生
- 下一篇: Okhttp3 链接池复用机制源码探索