qt如何读写excel
pro 配置文件:
QT += core axcontainer
QT -= gui
CONFIG += c++11
TARGET = QtExcel
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp \
ExcelManger.cpp
HEADERS += \
ExcelManger.h
main.cpp///
main.cpp:
#include <QCoreApplication>
#include <QFile>
#include <QDebug>
#include <QDir>
#include "ExcelManger.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QString strPath = QDir::currentPath() + "/test.xlsx";
QFile file(strPath);
if(!file.exists())
{
qDebug() << "文件不存在";
return a.exec();
}
else
{
//文件类型粗略检查