当前位置:网站首页>QT (35) - operate excel qxlsx qaxobject
QT (35) - operate excel qxlsx qaxobject
2022-06-25 00:59:00 【Cloudy summer】
Reading and writing EXCEL It's a routine operation .QT5 Previous versions use QAxObject operation EXCEL, The disadvantage is that the system must be equipped with OFFICE perhaps WPS.QT5 You can use it Qxlsx 了 , The advantage is that the system does not need to be installed OFFICE perhaps WPS.
Use Qxlsx There are two ways :
1. hold bin,lib,include Join the system environment
2. Directly into the project . I prefer to join the project directly . The second method is given in this paper .
1. Download library files
2. Create project
3. Copy the library file to the project
4. Modify the configuration .pro file + Add header reference
1. Download library files :
my demo Examples and library files , For download .
QT,EXCEL,QXLSX-C++ Document resources -CSDN download
2. Create project 

3. Copy the library file to the project 
4. Modify the configuration .pro file + Add header reference 
DEFINES += QT_DEPRECATED_WARNINGS
QXLSX_PARENTPATH=./ # current QXlsx path is . (. means curret directory)
QXLSX_HEADERPATH=./header/ # current QXlsx header path is ./header/
QXLSX_SOURCEPATH=./source/ # current QXlsx source path is ./source/
include(./QXlsx.pri) 
#include "xlsxdocument.h"
#include "xlsxchartsheet.h"
#include "xlsxcellrange.h"
#include "xlsxchart.h"
#include "xlsxrichstring.h"
#include "xlsxworkbook.h"
using namespace QXlsx;
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QXlsx::Document xlsx;
xlsx.write("A1", "Hello Qt!"); // write "Hello Qt!" to cell(A,1). it's shared string.
xlsx.saveAs("helloqxlsx.xlsx"); // save the document as 'Test.xlsx'
return 0;
// return a.exec();
}
边栏推荐
- 【Redis实现秒杀业务③】超卖问题之乐观锁具体实现
- QT(35)-操作EXCEL-QXlsx-QAxObject
- Thermodynamic diagram display correlation matrix
- 腾讯云国际云服务器网络访问丢包问题解决办法
- A small program written this week
- Databinding quick start (still using findviewbyid?)
- Hot fix sophix multi-channel patch solution
- ros(25):rqt_ image_ View reports an error unable to load plugin for transport 'compressed', error string
- Tiktok wallpaper applet source code
- JS dynamically generates variable names and assigns values
猜你喜欢

移动安全工具-jar

ros(25):rqt_image_view报错Unable to load plugin for transport ‘compressed‘, error string

2021-11-07
Outer screen and widescreen wasted? Harmonyos folding screen design specification teaches you to use it

How to quickly open traffic master for wechat applet

ros(25):rqt_ image_ View reports an error unable to load plugin for transport 'compressed', error string

2022R1快开门式压力容器操作考题及答案

Tiktok wallpaper applet source code

Working principle analysis of kubernetes architecture core components

Apk decompiled method (not confused)
随机推荐
Binder mechanism and Aidl communication example
传输层 以字节为单位的滑动窗口技术
Network request -volley
Decoupling pages and components using lifecycle
QT(35)-操作EXCEL-QXlsx-QAxObject
In the process of enterprise development, I found that a colleague used the select * from where condition for update
JSON file of China's provincial boundaries
C#和C 的CAN通信实验
D does not require opapply() as a domain
2022r1 quick opening pressure vessel operation test questions and answers
Use and click of multitypeadapter in recycleview
The acceleration of 100 km is only 5.92 seconds, and the willanda high-performance version leads with the strength of high-energy products
Domain Driven Design and coding
JS dynamically generates variable names and assigns values
Tiktok wallpaper applet source code
A website for programmers with a monthly salary of 30K
断言(assert)的用法
redis + lua实现分布式接口限流实现方案
iNFTnews | 国内NFT发展仅限于数字藏品吗?
Mobile security tool apktool