-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexcel.h
67 lines (59 loc) · 1.96 KB
/
excel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#ifndef EXCEL_H
#define EXCEL_H
#include <QtGui>
#if defined(Q_OS_WIN32)
#include <QAxObject>
#include <QStringList>
class Excel : public QObject
{
public:
Excel(QString strXlsFile = QString(), QObject *parent = 0);
~Excel();
QAxObject *getWorkBooks();
QAxObject *getWorkBook();
QAxObject *getWorkSheets();
QAxObject *getWorkSheet();
QAxObject *selectSheet(const QString& strSheetName);
QAxObject *selectSheet(int nSheetIndex);
QAxObject *setFileName(const QString& strFilename);
bool deletesheet(const QString& strSheetName);
bool deleteSheetExclude(const QString& strSheetName);
bool lockUpdate();
bool unlockUpdate();
bool setHeader(QStringList headerList);
bool insertRow(const QString& cell);
bool deleteRow(const QString& cell);
bool setValue(const QString& cell, const QString& strValue, int nType);
bool setValue(int row, int col, const QString& strValue);
bool setValue(int row, int col, const QString& strValue, int nType);
bool setCalce(const QString& cell, const QString& szCal);
bool setFormula(const QString& cell, const QString& szCal);
bool setFontBold(const QString& cell, bool blBold);
bool setMergeCells(const QString& cell);
QVariant value(int row, int col);
QVariantList getAll(int *rows, int *cols);
QVariantList selectAll();
bool clearAllContents();
bool writeRow(int row, QVariantList &list);
void setStringColumn(int col, int rows);
bool save();
bool save(const QString& szFileName);
bool showExcel(bool bShow);
void closeAll();
void autoColumnWidth(const QString& strColumns);
int sheetCount();
QString sheetName(int index);
void getRowsCols(int *rows, int *cols);
QString maxColumn();
protected:
QAxObject *excelApplication;
QAxObject *excelWorkBooks;
QAxObject *excelWorkBook;
QAxObject *excelSheets;
QAxObject *excelSheet;
QString fileName;
QString columnName;
private:
};
#endif
#endif