实例介绍
QtXlsx是一个可以读写excel的跨平台库,他不需要你安装ms excel,支持Qt5支持的任何平台。 你可以: 创建一个新的Xlsx文件, 读取Xlsx文件, 编辑Xlsx文件。 注意:此库好像不支持xls文件。 示例代码: #include <QtXlsx> int main() { QXlsx::Document xlsx; xlsx.write("A1", "Hello Qt!"); xlsx.saveAs("Test.xlsx"); return 0; }
【实例截图】
【核心代码】
7bedd569-c1ca-445c-acc6-b734c931c13f
└── QtXlsxWriter-master
├── examples
│ ├── examples.pro
│ └── xlsx
│ ├── calendar
│ │ ├── calendar.pro
│ │ └── main.cpp
│ ├── chart
│ │ ├── chart.pro
│ │ └── main.cpp
│ ├── chartsheet
│ │ ├── chartsheet.pro
│ │ └── main.cpp
│ ├── conditionalformatting
│ │ ├── conditionalformatting.pro
│ │ ├── doc
│ │ │ └── src
│ │ │ └── conditionalformatting.qdoc
│ │ └── main.cpp
│ ├── datavalidation
│ │ ├── datavalidation.pro
│ │ └── main.cpp
│ ├── definename
│ │ ├── definename.pro
│ │ └── main.cpp
│ ├── demo
│ │ ├── demo.pro
│ │ ├── doc
│ │ │ ├── images
│ │ │ │ └── xlsx_demo.gif
│ │ │ └── src
│ │ │ └── demo.qdoc
│ │ └── main.cpp
│ ├── documentproperty
│ │ ├── doc
│ │ │ ├── images
│ │ │ │ └── doc_property.png
│ │ │ └── src
│ │ │ └── documentproperty.qdoc
│ │ ├── documentproperty.pro
│ │ └── main.cpp
│ ├── extractdata
│ │ ├── doc
│ │ │ └── src
│ │ │ └── extractdata.qdoc
│ │ ├── extractdata.pro
│ │ └── main.cpp
│ ├── formulas
│ │ ├── doc
│ │ │ └── src
│ │ │ └── formulas.qdoc
│ │ ├── formulas.pro
│ │ └── main.cpp
│ ├── hello
│ │ ├── doc
│ │ │ ├── images
│ │ │ │ └── hello.png
│ │ │ └── src
│ │ │ └── hello.qdoc
│ │ ├── hello.pro
│ │ └── main.cpp
│ ├── hyperlinks
│ │ ├── hyperlinks.pro
│ │ └── main.cpp
│ ├── image
│ │ ├── image.pro
│ │ └── main.cpp
│ ├── mergecells
│ │ ├── doc
│ │ │ ├── images
│ │ │ │ └── xlsx-mergecells.png
│ │ │ └── src
│ │ │ └── mergecells.qdoc
│ │ ├── main.cpp
│ │ └── mergecells.pro
│ ├── numberformat
│ │ ├── main.cpp
│ │ └── numberformat.pro
│ ├── richtext
│ │ ├── doc
│ │ │ ├── images
│ │ │ │ └── richtext.png
│ │ │ └── src
│ │ │ └── richtext.qdoc
│ │ ├── main.cpp
│ │ └── richtext.pro
│ ├── rowcolumn
│ │ ├── main.cpp
│ │ └── rowcolumn.pro
│ ├── style
│ │ ├── doc
│ │ │ └── src
│ │ │ └── style.qdoc
│ │ ├── main.cpp
│ │ └── style.pro
│ ├── worksheetoperations
│ │ ├── doc
│ │ │ └── src
│ │ │ └── worksheetoperations.qdoc
│ │ ├── main.cpp
│ │ └── worksheetoperations.pro
│ ├── xlsx.pro
│ └── xlsxwidget
│ ├── main.cpp
│ ├── xlsxsheetmodel.cpp
│ ├── xlsxsheetmodel.h
│ ├── xlsxsheetmodel_p.h
│ └── xlsxwidget.pro
├── qtxlsx.pro
├── README.md
├── src
│ ├── src.pro
│ └── xlsx
│ ├── doc
│ │ ├── qtxlsx.qdocconf
│ │ ├── snippets
│ │ │ ├── doc_src_qtxlsx.cpp
│ │ │ └── doc_src_qtxlsx.pro
│ │ └── src
│ │ ├── examples.qdoc
│ │ ├── qtxlsx-index.qdoc
│ │ ├── qtxlsx.qdoc
│ │ └── usage.qdoc
│ ├── qtxlsx.pri
│ ├── xlsxabstractooxmlfile.cpp
│ ├── xlsxabstractooxmlfile.h
│ ├── xlsxabstractooxmlfile_p.h
│ ├── xlsxabstractsheet.cpp
│ ├── xlsxabstractsheet.h
│ ├── xlsxabstractsheet_p.h
│ ├── xlsxcell.cpp
│ ├── xlsxcell.h
│ ├── xlsxcell_p.h
│ ├── xlsxcellrange.cpp
│ ├── xlsxcellrange.h
│ ├── xlsxcellreference.cpp
│ ├── xlsxcellreference.h
│ ├── xlsxchart.cpp
│ ├── xlsxchart.h
│ ├── xlsxchart_p.h
│ ├── xlsxchartsheet.cpp
│ ├── xlsxchartsheet.h
│ ├── xlsxchartsheet_p.h
│ ├── xlsxcolor.cpp
│ ├── xlsxcolor_p.h
│ ├── xlsxconditionalformatting.cpp
│ ├── xlsxconditionalformatting.h
│ ├── xlsxconditionalformatting_p.h
│ ├── xlsxcontenttypes.cpp
│ ├── xlsxcontenttypes_p.h
│ ├── xlsxdatavalidation.cpp
│ ├── xlsxdatavalidation.h
│ ├── xlsxdatavalidation_p.h
│ ├── xlsxdocpropsapp.cpp
│ ├── xlsxdocpropsapp_p.h
│ ├── xlsxdocpropscore.cpp
│ ├── xlsxdocpropscore_p.h
│ ├── xlsxdocument.cpp
│ ├── xlsxdocument.h
│ ├── xlsxdocument_p.h
│ ├── xlsxdrawinganchor.cpp
│ ├── xlsxdrawinganchor_p.h
│ ├── xlsxdrawing.cpp
│ ├── xlsxdrawing_p.h
│ ├── xlsxformat.cpp
│ ├── xlsxformat.h
│ ├── xlsxformat_p.h
│ ├── xlsxglobal.h
│ ├── xlsxmediafile.cpp
│ ├── xlsxmediafile_p.h
│ ├── xlsxnumformatparser.cpp
│ ├── xlsxnumformatparser_p.h
│ ├── xlsx.pro
│ ├── xlsxrelationships.cpp
│ ├── xlsxrelationships_p.h
│ ├── xlsxrichstring.cpp
│ ├── xlsxrichstring.h
│ ├── xlsxrichstring_p.h
│ ├── xlsxsharedstrings.cpp
│ ├── xlsxsharedstrings_p.h
│ ├── xlsxsimpleooxmlfile.cpp
│ ├── xlsxsimpleooxmlfile_p.h
│ ├── xlsxstyles.cpp
│ ├── xlsxstyles_p.h
│ ├── xlsxtheme.cpp
│ ├── xlsxtheme_p.h
│ ├── xlsxutility.cpp
│ ├── xlsxutility_p.h
│ ├── xlsxworkbook.cpp
│ ├── xlsxworkbook.h
│ ├── xlsxworkbook_p.h
│ ├── xlsxworksheet.cpp
│ ├── xlsxworksheet.h
│ ├── xlsxworksheet_p.h
│ ├── xlsxzipreader.cpp
│ ├── xlsxzipreader_p.h
│ ├── xlsxzipwriter.cpp
│ └── xlsxzipwriter_p.h
├── sync.profile
└── tests
├── auto
│ ├── auto.pro
│ ├── cellreference
│ │ ├── cellreference.pro
│ │ └── tst_cellreferencetest.cpp
│ ├── document
│ │ ├── document.pro
│ │ └── tst_documenttest.cpp
│ ├── format
│ │ ├── format.pro
│ │ └── tst_formattest.cpp
│ ├── propsapp
│ │ ├── propsapp.pro
│ │ └── tst_docpropsapptest.cpp
│ ├── propscore
│ │ ├── propscore.pro
│ │ └── tst_propscoretest.cpp
│ ├── relationships
│ │ ├── relationships.pro
│ │ └── tst_relationshipstest.cpp
│ ├── richstring
│ │ ├── richstring.pro
│ │ └── tst_richstringtest.cpp
│ ├── sharedstrings
│ │ ├── sharedstrings.pro
│ │ └── tst_sharedstringstest.cpp
│ ├── styles
│ │ ├── styles.pro
│ │ └── tst_stylestest.cpp
│ ├── utility
│ │ ├── tst_utilitytest.cpp
│ │ └── utility.pro
│ ├── worksheet
│ │ ├── tst_worksheet.cpp
│ │ └── worksheet.pro
│ ├── xlsxconditionalformatting
│ │ ├── tst_conditionalformattingtest.cpp
│ │ └── xlsxconditionalformatting.pro
│ └── zipreader
│ ├── tst_zipreadertest.cpp
│ └── zipreader.pro
├── benchmarks
│ ├── benchmarks.pro
│ └── xmlspace
│ ├── tst_xmlspacetest.cpp
│ └── xmlspace.pro
└── tests.pro
70 directories, 177 files
标签:
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论