Ubuntu16.04使用Qt Xlsx
2018-02-06 15:35
417 查看
Usage(1): Use Xlsx as Qt5’s addon module
1. Download the source code from github.com.
https://github.com/dbzhang800/QtXlsxWriter/archive/master.zip
Put the source code in any directory you like. At the toplevel directory run
Note: Perl is needed in this step.
qmake
make
make install
The library, the header files, and others will be installed to your system.
注:编译时会出现如下错误:
xlsxzipreader.cpp: In member function ‘void QXlsx::ZipReader::init()’:
xlsxzipreader.cpp:51:66: error: conversion from ‘QVector’ to non-scalar type ‘QList’ requested
QList allFiles = m_reader->fileInfoList();
解决方法:
1.打开出错的源文件
vim src/xlsx/xlsxzipreader.cpp
2.添加头文件#include ,然后把出错的地方的”QList” 用”QVector” 替换掉重新make就可以了。
Add following line to your qmake’s project file:
QT += xlsx
4. Then, using Qt Xlsx in your code
{
QXlsx::Document xlsx;
xlsx.write(“A1”, “Hello Qt!”);
xlsx.saveAs(“Test.xlsx”);
return 0;
}
1. Download the source code from github.com.
https://github.com/dbzhang800/QtXlsxWriter/archive/master.zip
Put the source code in any directory you like. At the toplevel directory run
Note: Perl is needed in this step.
qmake
make
make install
The library, the header files, and others will be installed to your system.
注:编译时会出现如下错误:
xlsxzipreader.cpp: In member function ‘void QXlsx::ZipReader::init()’:
xlsxzipreader.cpp:51:66: error: conversion from ‘QVector’ to non-scalar type ‘QList’ requested
QList allFiles = m_reader->fileInfoList();
解决方法:
1.打开出错的源文件
vim src/xlsx/xlsxzipreader.cpp
2.添加头文件#include ,然后把出错的地方的”QList” 用”QVector” 替换掉重新make就可以了。
Add following line to your qmake’s project file:
QT += xlsx
4. 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;
}
相关文章推荐
- Ubuntu 16.04 + ROS Kinetic 机器人操作系统学习镜像分享与使用安装说明
- PIX学习路径-4-使用Ubuntu 16.04 LTS搭建PIXHAWK二次开发环境
- 使用ubuntu16.04中的注意点
- ubuntu16.04上如何使用svn创建新的仓库
- Ubuntu 16.04 安装和使用QQ最简洁的方式
- Ubuntu LTS 系统学习使用体会和实用工具软件汇总 6.04 8.04 10.04 12.04 14.04 16.04
- Ubuntu 16.04 使用docker资料汇总与应用docker安装caffe并使用Classifier(ros kinetic+usb_cam+caffe)
- python3 使用pyaudio OSError: [Errno -9996] Invalid input device (no default output device)-ubuntu16.04
- 如何在 Ubuntu 16.04 上安装和使用 Encryptpad | Linux 中国
- 有关于ubuntu16.04使用VirtualBox的问题
- Ubuntu16.04安装配置Eclipse 以及opencv的使用
- git ubuntu 16.04 服务器搭建及 git(windows使用)注意
- synergy1.6(windows7+ubuntu16.04)安装使用
- ubuntu16.04使用git
- 详解VMware12使用三台虚拟机Ubuntu16.04系统搭建hadoop-2.7.1+hbase-1.2.4(完全分布式)
- ubuntu16.04安装vim及vim的命令使用方法
- ubuntu16.04 gnome环境,怎么样下载使用monaco字体
- Ubuntu 16.04 下使用Xampp
- Ubuntu使用dpkg安装软件依赖问题解决 ubuntu-tweak ubuntu 16.04 LTS 系统清理