17 #ifndef TIANCHI_TCTREEEX_H
18 #define TIANCHI_TCTREEEX_H
20 #include <tianchi/tcglobal.h>
21 #include <tianchi/file/tcmsexcel.h>
23 #include <QTreeWidget>
25 #include <QDoubleSpinBox>
27 class TcTreeExPrivate;
45 void setWidget(QTreeWidget* widget);
49 void setExportType(
int type);
53 void setSelectedState(
int state);
57 void setTextFileName(
const QString& filename);
61 void setMSExcelObject(
TcMSExcel* excel,
bool hasHeader=
true,
int startRow=1,
int startCol=1);
69 TcTreeExPrivate* d_ptr;
72 static void createColumnMenu(QTreeWidget* widget, QWidget*
object,
const QString& methodName);
74 static void setColumnBolds(QTreeWidget* widget);
75 static void setColumnWidth(QTreeWidget* widget,
int column,
int width,
bool hide=
false);
76 static void setColumnStyle(QTreeWidget* widget,
int fontSize=8,
const QString &fontName=
"Tahoma");
78 static void CopyCellObject(QTreeWidget* view,
int copyMode);
84 void setCellFont(
int col,
bool bold=
false,
int alignment=Qt::AlignVCenter | Qt::AlignLeft);
85 void setCellStyle(
int startCol=-1,
int endCol=-1,
86 bool bold=
true,
int alignment=Qt::AlignVCenter | Qt::AlignRight,
88 void setCellColor(
int col, QColor color);
90 QLabel* createLabel(
int col,
const QString& htmlText,
const QVariant& data=QVariant());
91 QDoubleSpinBox* createDoubleSpinBox(
int col,
92 int decimals,
double min,
double max,
double step,
double value);
93 double readDoubleSpinBoxValue(
int col);
95 void showValue(
int column,
const char* text,
const QVariant& data=QVariant(),
int size=0);
96 void showValue(
int column,
const QString& text,
const QVariant& data=QVariant(),
int size=0);
97 void showValue(
int column,
const QByteArray& text,
const QVariant& data=QVariant(),
int size=0);
98 void showValue(
int column,
double value);
99 void showValue(
int column,
double value,
int digits);
100 void showPrice(
int column,
double value,
int digits=0);
101 void showPercent(
int column,
double value=0.0,
int digits=0);
104 #endif // TIANCHI_TCTREEEX_H