.xlsx file reader and writer for Qt5 
C++QMakeOther
 branch: master 

README.md

Documentation: http://qtxlsx.debao.me

QtXlsx is a library that can read and write Excel files. It doesn't require Microsoft Excel and can be used in any platform that Qt5 supported. The library can be used to

  • Generate a new .xlsx file from scratch
  • Extract data from an existing .xlsx file
  • Edit an existing .xlsx file

Getting Started

  • For linux user, if your Qt is installed through package manager tools such "apt-get", make sure that you have installed the Qt5 develop package qtbase5-private-dev

Usage(1): Use Xlsx as Qt5's addon module

Building the module

Note: Perl is needed in this step.

  • Download the source code.

  • Put the source code in any directory you like

  • Go to top directory of the project in a terminal and run

    qmake
make
make install

The library, the header files, and others will be installed to your system.

make html_docs can be used to generate documentations of the library, and make check can be used to run unit tests of the library.

Using the module

  • Add following line to your qmake's project file:
    QT += xlsx
  • Then, using Qt Xlsx in your code
    #include <QtXlsx>
int main()
{
QXlsx::Document xlsx;
xlsx.write("A1", "Hello Qt!");
xlsx.saveAs("Test.xlsx");
return 0;
}

Usage(2): Use source code directly

The package contains a qtxlsx.pri file that allows you to integrate the component into applications that use qmake for the build step.

  • Download the source code.

  • Put the source code in any directory you like. For example, 3rdparty:

    |-- project.pro
|-- ....
|-- 3rdparty\
| |-- qtxlsx\
| |
  • Add following line to your qmake project file:
    include(3rdparty/qtxlsx/src/xlsx/qtxlsx.pri)

Note: If you like, you can copy all files from src/xlsx to your application's source path. Then add following line to your project file:

    include(qtxlsx.pri)

Note: If you do not use qmake, you need to define the following macro manually

    XLSX_NO_LIB
  • Then, using Qt Xlsx in your code
    #include "xlsxdocument.h"
int main()
{
QXlsx::Document xlsx;
xlsx.write("A1", "Hello Qt!");
xlsx.saveAs("Test.xlsx");
return 0;
}

References

General

Number formats

Formula

QtXlsxWriter的更多相关文章

  1. qt5之使用QtXlsxWriter库

    note Qt version: 5.12 platform: os x 10.15 本文将介绍直接使用QtXlsxWriter源码 准备 下载QtXlsxWriter 使用Qt Creator 创建 ...

  2. Excel文件操作方式比较

    C++读取Excel的XLS文件的方法有很多,但是也许就是因为方法太多,大家在选择的时候会很疑惑. 由于前两天要做导表工具,比较了常用的方法,总结一下写个短文, 1.OLE的方式 这个大约是最常用的方 ...

  3. C++读写EXCEL文件OLE,java读写excel文件POI 对比

    C++读写EXCEL文件方式比较 有些朋友问代码的问题,将OLE读写的代码分享在这个地方,大家请自己看.http://www.cnblogs.com/destim/p/5476915.html C++ ...

  4. 39.QT-Qtxlsx库使用

    之前参考博客https://blog.csdn.net/c3060911030/article/details/51560239下载Qtxlsx库,然后编译的时候,显示: error: invalid ...

  5. 收藏的博客 -- Qt/C++学习

    Qt Creator环境: 使用Qt Creator作为Linux IDE,代替Vim:实现两台Linux电脑远程部署和调试(一台电脑有桌面系统,一台电脑无桌面系统) 使用Qt Creator作为Li ...

  6. C/C++读写excel文件 的几种方式

    因为有些朋友问代码的问题,将OLE读写的代码分享在这个地方,大家请自己看. http://blog.csdn.net/fullsail/article/details/8449448 C++读取Exc ...

  7. qt 使用qtxlsx 读写excel

    https://github.com/dbzhang800/QtXlsxWriter 下载qtxlsx地址 QtXlsx is a library that can read and write Ex ...

  8. Unknown module(s) in QT: xlsx解决方法

    解决方法在此: https://github.com/dbzhang800/QtXlsxWriter Documentation: http://qtxlsx.debao.me QtXlsx is a ...

  9. 使用QtXlsx来读写excel文件

    概述:QtXlsx是功能非常强大和使用非常方便的操作excel类库.包括对excel数据读写.excel数据格式设置及在excel里面根据数据生成各种图表. 下面重点介绍如何安装和使用QtXlsx. ...

随机推荐

  1. UIWindow in iOS

    这篇文章,我将分享对UIWindow我所知道的东西. keyWindow 一个应用能够有许多UIWindow,“The key window”是其中一个,被设计用来接受键盘和其他与点击无关的事件.一个 ...

  2. My way on Linux - [虚拟化&云计算] - 云计算概述&KVM虚拟化基础

    思维导图

  3. First 5 minutes of SQLite

    What is SQLite? SQLite is light-weight RDBMS, it is use the file system rather than the C/S client, ...

  4. IOS网络开发实战(二)

      1 飞机航班查询软件 1.1 问题 NSURLConnection是IOS提供的用于处理Http协议的网络请求的类,可以实现同步请求也可以实现异步请求,本案例使用NSURLConnection类实 ...

  5. 移动web前端的一些硬技能(一)关于移动设备

    移动端web其实也就是小尺寸触摸屏设备的web,其中包含了两个词——1.小尺寸设备:2.触摸屏.能把这两个问题给解决掉,就已经是一个基本合格的移动web前端开发工程师了.对于前端工程师来说,前路漫漫, ...

  6. C语言多维数组的地址

    设有整型二维数组a[3][4]如下: 0   1   2   3 4   5   6   7 8   9  10  11  它的定义为:     int a[3][4]={{0,1,2,3},{4,5 ...

  7. Hdu1092

    #include <stdio.h> int main() { ; while(scanf("%d",&n)){ ) {;} else{ int i,a; ;i ...

  8. DataTables选择多行

    $(document).ready(function() { var table = $('#example').DataTable(); $('#example tbody').on( 'click ...

  9. GetSystemTime API可以得到毫秒级时间

    用Now返回的日期格式中年只有2位,即2000年显示为00, 这似乎不太令人满意. 此外Now和Time都只能获得精确到秒的时间,为了得到更精确的毫秒级时间,可以使用API函数GetSystemTim ...

  10. 《Programming WPF》翻译 第6章 3.二进制资源

    原文:<Programming WPF>翻译 第6章 3.二进制资源 尽管ResourceDictionary和系统级别的资源适合于作为数据存在于对象中,然而,并不是所有的资源都能很好的满 ...