Tianchi  v0.0.2 build 20130701
C++ library for Qt with VC & mingW
tcexcelreader.h
1 // **************************************************************************
2 // Tianchi C++ library for Qt (open source)
3 // 天池共享源码库
4 // 版权所有 (C) 天池共享源码库开发组
5 // 授权协议:请阅读天池共享源码库附带的授权协议
6 // **************************************************************************
7 // 文档说明:通过 OLE 方式操作 Microsoft Excel(仅限 Windows 下使用,要求已
8 // 安装 Excel)
9 // ==========================================================================
10 // 开发日志:
11 // 日期 人员 说明
12 // --------------------------------------------------------------------------
13 // 2013.05.02 XChinux 建立
14 //
15 // ==========================================================================
17 // 要求已安装 Excel或WPSOffice)
18 // ==========================================================================
19 #ifndef TIANCHI_TCEXCELREADER_H
20 #define TIANCHI_TCEXCELREADER_H
21 
22 #include <tianchi/tcglobal.h>
23 
24 #include <QVariant>
25 #include <QStringList>
26 
27 class TcExcelReaderPrivate;
28 
32 class TIANCHI_API TcExcelReader
33 {
34 public:
35  TcExcelReader();
36  ~TcExcelReader();
38  bool isNull() const;
40  bool open(const QString &file);
44  QVariant cell(int row, int col);
45 
47  int sheetCount();
49  QStringList sheetNames();
51  bool setCurrentSheet(int index);
53  bool setCurrentSheet(const QString &sheetName);
55  int currentSheetIndex();
57  QString currentSheetName();
58 private:
59  Q_DISABLE_COPY(TcExcelReader)
60  Q_DECLARE_PRIVATE(TcExcelReader)
61  TcExcelReaderPrivate* const d_ptr;
62 };
63 
64 #endif