|
|
| DARowTable (int rows, int columns) |
| |
| void | resize (int r, int c) |
| | 改变table 的大小
|
| |
|
void | reserve (int size) |
| |
| bool | haveFieldid (const QString &field) const |
| | 判断是否存在field
|
| |
| void | fill (const T &v) |
| | 填充元素
|
| |
|
const T & | at (int r, int c) const |
| |
|
T & | at (int r, int c) |
| |
| T | cell (int r, int c) const |
| | 获取单元格
|
| |
|
SeriesPtr | appendRow (const QString &name) |
| |
|
SeriesPtr | appendRow (const QString &name, int size) |
| |
|
void | appendRow (SeriesPtr row) |
| |
|
void | appendRow (std::initializer_list< T > args, const QString &n) |
| |
|
template<typename Ite1 , typename Ite2 > |
| void | appendColumn (Ite1 b, Ite2 e) |
| |
|
void | appendColumn (std::initializer_list< T > args) |
| |
|
int | nameToIndex (const QString &n) const |
| |
| SeriesPtr & | row (int r) |
| | 获取行引用
|
| |
| const SeriesPtr & | row (int r) const |
| | 获取行引用
|
| |
|
SeriesPtr & | row (const QString &n) |
| |
|
const SeriesPtr & | row (const QString &n) const |
| |
|
SeriesPtr | colunm (int c) const |
| |
|
SeriesType & | operator[] (int r) |
| |
|
const SeriesType & | operator[] (int r) const |
| |
|
SeriesType & | operator[] (const QString &rowname) |
| |
|
const SeriesType & | operator[] (const QString &rowname) const |
| |
|
void | fixSize () |
| | 以最大列数进行列数修正,保证所有行同列
|
| |
| int | rowCount () const |
| | 表的行数
|
| |
| int | columnCount () const |
| | 表的列数
|
| |
| void | setMode (Mode m) |
| | 设置表格的模式
|
| |
| Mode | getMode () const |
| | 获取模式
|
| |
|
void | clear () |
| | 清空
|
| |
|
void | setName (const QString &n) |
| |
|
QString | getName () const |
| |
| QStringList | rowNames () const |
| | rowNames
|
| |
| void | setRowNames (const QStringList &ns) |
| | 设置行名,如果是个空的表会生成一个默认行
|
| |
| TablePtr | takeByValue (const QString &field, T value) const |
| | 提取某个值等于value作为新表
|
| |
| QPair< QList< TablePtr >, QList< T > > | groupBy (const QString &field) const |
| | groupby
|
| |
| void | orderBy (const QString &sn) |
| | orderBy
|
| |
|
void | orderBy (int rindex) |
| |
| QPair< T, int > | lowerBound (const T &v, const QString &sortedfield) const |
| | 查找第一个大于或等于某个元素的位置
|
| |
|
QPair< T, int > | lowerBound (const T &v, int r) const |
| |
|
QPair< T, int > | upperBound (const T &v, const QString &sortedfield) const |
| |
|
QPair< T, int > | upperBound (const T &v, int r) const |
| |
| void | setCaseSensitivity (CaseSensitivity cs) |
| | 设置名字查询时是否对大小写敏感
|
| |
| bool | isCaseSensitivity () const |
| | 判断是否大小写敏感
|
| |
|
void | remove (const QString &name) |
| |
|
void | remove (int rindex) |
| |
template<typename T>
class DA::DARowTable< T >
以行为基础的数据表
表格形如:
|name| 0 | 1 | 2 | 3 | …… | n | 行名字 -> 列索引
表内容:
|row1| 1 | 2 | 1 | 0 | …… | 6 | |row2| 4 | 5 | 6 | 7 | …… | 8 | ………………
|rown| 9 | 8 | 7 | 6 | …… | 0 |
table.appendColumn({1,4,……,9});
table.appendColumn({2,5,……,8});
table.appendColumn({1,6,……,7});
table.appendColumn({0,7,……,6});
……
table.appendColumn({6,8,……,0});
以行为基础的数据表
Definition DARowTable.hpp:54
void setRowNames(const QStringList &ns)
设置行名,如果是个空的表会生成一个默认行
Definition DARowTable.hpp:750
可以通过行序号进行索引 table[1] //row2 可以索引到单元格 table.cell(1,2) //row2[2]:6 等同table[1][2] 可以通过行名索引到单元格 table["row2"][2] //row2[2]:6 等同table[1][2]
- 参见
- DAColumnTable