資源簡介
本例中右側的圖表是基于Echarts將分布在全國各地的系統用戶數量統計出來,以地圖的形式展示出每個地域的用戶數量,用戶點擊全國地圖中的各個省區域時,能夠打開各省地圖,在各省地圖上的地市區域上以不同的顏色著色,顯示地域的用戶量情況,當鼠標移到相應的地市上面還會顯示相應的數據。業務邏輯的處理由QT C++實現。

代碼片段和文件信息
/****************************************************************************
**
**?Copyright?(C)?2015?The?Qt?Company?Ltd.
**?Contact:?http://www.qt.io/licensing/
**
**?This?file?is?part?of?the?demonstration?applications?of?the?Qt?Toolkit.
**
**?$QT_BEGIN_LICENSE:LGPL$
**?Commercial?License?Usage
**?Licensees?holding?valid?commercial?Qt?licenses?may?use?this?file?in
**?accordance?with?the?commercial?license?agreement?provided?with?the
**?Software?or?alternatively?in?accordance?with?the?terms?contained?in
**?a?written?agreement?between?you?and?The?Qt?Company.?For?licensing?terms
**?and?conditions?see?http://www.qt.io/terms-conditions.?For?further
**?information?use?the?contact?form?at?http://www.qt.io/contact-us.
**
**?GNU?Lesser?General?Public?License?Usage
**?Alternatively?this?file?may?be?used?under?the?terms?of?the?GNU?Lesser
**?General?Public?License?version?2.1?as?published?by?the?Free?Software
**?Foundation?and?appearing?in?the?file?LICENSE.LGPL?included?in?the
**?packaging?of?this?file.?Please?review?the?following?information?to
**?ensure?the?GNU?Lesser?General?Public?License?version?2.1?requirements
**?will?be?met:?http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
**?As?a?special?exception?The?Qt?Company?gives?you?certain?additional
**?rights.?These?rights?are?described?in?The?Qt?Company?LGPL?Exception
**?version?1.1?included?in?the?file?LGPL_EXCEPTION.txt?in?this?package.
**
**?GNU?General?Public?License?Usage
**?Alternatively?this?file?may?be?used?under?the?terms?of?the?GNU
**?General?Public?License?version?3.0?as?published?by?the?Free?Software
**?Foundation?and?appearing?in?the?file?LICENSE.GPL?included?in?the
**?packaging?of?this?file.?Please?review?the?following?information?to
**?ensure?the?GNU?General?Public?License?version?3.0?requirements?will?be
**?met:?http://www.gnu.org/copyleft/gpl.html.
**
**
**?$QT_END_LICENSE$
**
****************************************************************************/
#include?“document.h“
#include?
#include?
#include?
#include?
#include?
Document::Document(Qobject?*parent)?:?Qobject(parent)
{
?????QFile?proJsonFile(“:/provinces.json“)?;
?????if?(!proJsonFile.open(QIODevice::ReadOnly))?{
?????????????qWarning(“Couldn‘t?open?proinces?json?file.“);
?????????????return;
?????}
?????QTextStream?inProData(&proJsonFile);
?????//?將文本流讀取到字符串中:
?????QString?provinceDat?=?inProData.readAll();
?????//?關閉文本流:
?????proJsonFile.close();
?????QJsonDocument?loadDoc(QJsonDocument::fromJson(provinceDat.toUtf8()));
?????provinceJsonObj?=?loadDoc.object();
?????QFile?cityJsonFile(“:/citygeo.json“)?;
?????cityJsonFile.open(QIODevice::ReadOnly);
?????QTextStream?inData(&cityJsonFile);
?????//?將文本流讀取到字符串中:
?????QString?dat?=?inData.readAll();
?????//?關閉文本流:
?????cityJsonFile.close();
?????QJsonDocument?doc?=?QJsonDocument::fromJson(dat.toUtf8());
?????cityJsonData?=?doc.array();
}
void?Document::setSendTextText(const?QString?&text)
{
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????12723??2016-01-15?02:10??webcharttest\citygeo.json
?????文件???????3914??2016-01-17?01:52??webcharttest\document.cpp
?????文件???????2553??2016-01-17?01:52??webcharttest\document.h
?????文件???????9993??2015-07-22?03:35??webcharttest\echarts\chart\bar.js
?????文件??????19913??2015-07-22?03:35??webcharttest\echarts\chart\chord.js
?????文件???????5806??2015-07-22?03:35??webcharttest\echarts\chart\eventRiver.js
?????文件??????29726??2015-07-22?03:35??webcharttest\echarts\chart\force.js
?????文件???????8755??2015-07-22?03:35??webcharttest\echarts\chart\funnel.js
?????文件???????9230??2015-07-22?03:35??webcharttest\echarts\chart\gauge.js
?????文件???????4667??2015-07-22?03:35??webcharttest\echarts\chart\heatmap.js
?????文件???????5344??2015-07-22?03:35??webcharttest\echarts\chart\k.js
?????文件??????12928??2015-07-22?03:35??webcharttest\echarts\chart\line.js
?????文件?????452052??2015-07-22?03:35??webcharttest\echarts\chart\map.js
?????文件??????12159??2015-07-22?03:35??webcharttest\echarts\chart\pie.js
?????文件??????14075??2015-07-22?03:35??webcharttest\echarts\chart\radar.js
?????文件??????29997??2015-07-22?03:35??webcharttest\echarts\chart\scatter.js
?????文件??????10912??2015-07-22?03:35??webcharttest\echarts\chart\tree.js
?????文件???????9616??2015-07-22?03:35??webcharttest\echarts\chart\treemap.js
?????文件???????9208??2015-07-22?03:35??webcharttest\echarts\chart\venn.js
?????文件??????35348??2015-07-22?03:35??webcharttest\echarts\chart\wordCloud.js
?????文件?????363230??2015-07-22?03:35??webcharttest\echarts\echarts.js
?????文件?????452052??2015-07-22?03:35??webcharttest\echarts\map.js
?????文件???????8668??2016-01-16?02:55??webcharttest\index.html
?????文件????????206??2016-01-12?03:13??webcharttest\main.cpp
?????文件????????621??2016-01-17?01:50??webcharttest\mainwidget.cpp
?????文件????????379??2016-01-16?03:36??webcharttest\mainwidget.h
?????文件???????2673??2016-01-17?00:48??webcharttest\mainwidget.ui
?????文件??????24471??2016-01-17?00:44??webcharttest\Makefile
?????文件?????107917??2016-01-17?00:44??webcharttest\Makefile.Release
?????文件???????2377??2015-12-14?10:27??webcharttest\previewpage.cpp
............此處省略50個文件信息
- 上一篇:MFC做的電影訂票小系統
- 下一篇:VC++ 串口通信modbus協議源代碼
評論
共有 條評論