显示item数据的tablemodel
更多...
#include <DAChartItemTableModel.h>
|
|
| DAChartItemTableModel (QObject *p=0) |
| |
|
void | setPlotItems (const QList< QwtPlotItem * > &items) |
| |
|
const QList< QwtPlotItem * > & | getPlotItems () const |
| |
|
void | clear () |
| |
|
void | enableBackgroundColor (bool enable, int alpha=30) |
| |
| QwtPlotItem * | getItemFromCol (int col, int *dataColumnDim=nullptr) const |
| | 通过列号获取item
|
| |
| QColor | getItemColor (QwtPlotItem *item) const |
| | 获取item的颜色
|
| |
|
int | getItemRowCount (QwtPlotItem *item) const |
| |
| int | getItemsColumnStartIndex (QwtPlotItem *item) const |
| | 数据开始的那一列列号
|
| |
| void | getItemColumnRange (QwtPlotItem *item, int *startCol=nullptr, int *endCol=nullptr) const |
| | 获取item对应的列范围
|
| |
| virtual QString | getItemDimDescribe (QwtPlotItem *item, int index) const |
| | 获取绘图数据维度的描述
|
| |
| QString | getItemNameFromCol (int col) const |
| | 通过列号获取item的名字
|
| |
|
int | rowCount (const QModelIndex &parent=QModelIndex()) const |
| |
|
int | columnCount (const QModelIndex &parent=QModelIndex()) const |
| |
|
QVariant | headerData (int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const |
| |
|
QVariant | data (const QModelIndex &index, int role) const |
| |
|
bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) |
| |
|
Qt::ItemFlags | flags (const QModelIndex &index) const |
| |
|
|
static double | nan () |
| |
| static int | calcPlotMultiBarChartDim (const QwtPlotMultiBarChart *p) |
| | 计算QwtPlotMultiBarChart的最大维度
|
| |
| static int | getItemColumnCount (QwtPlotItem *item) |
| | QwtPlotItemDataModel::getItemColumnCount
|
| |
|
static void | setSeriesPointFValue (QPointF &p, int col, double val) |
| |
|
static void | setSeriesPoint3dValue (QwtPoint3D &p, int col, double val) |
| |
|
static void | setSeriesIntervalValue (QwtIntervalSample &p, int col, double val) |
| |
|
static void | setSeriesSetsampleValue (QwtSetSample &p, int col, double val) |
| |
|
static void | setSeriesOHLCsampleValue (QwtOHLCSample &p, int col, double val) |
| |
|
| virtual int | calcItemDataRowCount (QwtPlotItem *item) const |
| | 获取最大的行数 重载此函数,可以让表格显示的行数
|
| |
| virtual int | calcItemDataColumnCount (QwtPlotItem *item) const |
| | 获取曲线的维度
|
| |
|
virtual double | getItemData (int row, int col, QwtPlotItem *item) const |
| |
| virtual bool | setPlotItemData (int row, int col, QwtPlotItem *item, const QVariant &var) |
| | 依据显示规则设置数据
|
| |
|
void | updateRowCount () |
| | 更新行数
|
| |
|
void | updateColumnCount () |
| | 更新列数
|
| |
|
void | updateItemColor () |
| | 更新颜色
|
| |
◆ calcItemDataColumnCount()
| int DA::DAChartItemTableModel::calcItemDataColumnCount |
( |
QwtPlotItem * |
item | ) |
const |
|
protectedvirtual |
◆ calcItemDataRowCount()
| int DA::DAChartItemTableModel::calcItemDataRowCount |
( |
QwtPlotItem * |
item | ) |
const |
|
protectedvirtual |
获取最大的行数 重载此函数,可以让表格显示的行数
- 参数
-
- 返回
◆ calcPlotMultiBarChartDim()
| int DA::DAChartItemTableModel::calcPlotMultiBarChartDim |
( |
const QwtPlotMultiBarChart * |
p | ) |
|
|
static |
计算QwtPlotMultiBarChart的最大维度
- 参数
-
- 返回
- QwtSetSample.set的最大尺寸+1,其中加1是对应QwtSetSample.value
◆ getItemColor()
| QColor DA::DAChartItemTableModel::getItemColor |
( |
QwtPlotItem * |
item | ) |
const |
◆ getItemColumnCount()
| int DA::DAChartItemTableModel::getItemColumnCount |
( |
QwtPlotItem * |
item | ) |
|
|
static |
QwtPlotItemDataModel::getItemColumnCount
- 参数
-
- 返回
◆ getItemColumnRange()
| void DA::DAChartItemTableModel::getItemColumnRange |
( |
QwtPlotItem * |
item, |
|
|
int * |
startCol = nullptr, |
|
|
int * |
endCol = nullptr |
|
) |
| const |
◆ getItemDimDescribe()
| QString DA::DAChartItemTableModel::getItemDimDescribe |
( |
QwtPlotItem * |
item, |
|
|
int |
index |
|
) |
| const |
|
virtual |
◆ getItemFromCol()
| QwtPlotItem * DA::DAChartItemTableModel::getItemFromCol |
( |
int |
col, |
|
|
int * |
dataColumnDim = nullptr |
|
) |
| const |
通过列号获取item
- 参数
-
- 返回
- 如果没有,返回nullptr
◆ getItemNameFromCol()
| QString DA::DAChartItemTableModel::getItemNameFromCol |
( |
int |
col | ) |
const |
通过列号获取item的名字
- 参数
-
- 返回
- item的名字
◆ getItemsColumnStartIndex()
| int DA::DAChartItemTableModel::getItemsColumnStartIndex |
( |
QwtPlotItem * |
item | ) |
const |
数据开始的那一列列号
- 参数
-
- 返回
- 如果没有对应的item返回-1
◆ setPlotItemData()
| bool DA::DAChartItemTableModel::setPlotItemData |
( |
int |
row, |
|
|
int |
col, |
|
|
QwtPlotItem * |
item, |
|
|
const QVariant & |
var |
|
) |
| |
|
protectedvirtual |
依据显示规则设置数据
- 参数
-
| row | 实际数据的行号 |
| col | 实际数据的列号,如果是表格列要减去这个数据的第一个维度的列数 |
| item | 数据指针 |
| var | 设置的值 |
- 返回
- 成功设置返回true
该类的文档由以下文件生成:
- /home/runner/work/data-workbench/data-workbench/src/DAFigure/Models/DAChartItemTableModel.h
- /home/runner/work/data-workbench/data-workbench/src/DAFigure/Models/DAChartItemTableModel.cpp