scidavis
2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot). Fossies Dox: scidavis-2.3.0.tar.gz ("unofficial" and yet experimental doxygen-generated source code documentation) 
|
Go to the documentation of this file.
39 : QAbstractItemModel(0), d_table(table), d_formula_mode(false)
40 #ifdef LEGACY_CODE_0_2_x
44 connect(
d_table, SIGNAL(columnsAboutToBeInserted(
int, QList<Column *>)),
46 connect(
d_table, SIGNAL(columnsInserted(
int,
int)),
48 connect(
d_table, SIGNAL(columnsAboutToBeRemoved(
int,
int)),
50 connect(
d_table, SIGNAL(columnsRemoved(
int,
int)),
52 connect(
d_table, SIGNAL(rowsAboutToBeInserted(
int,
int)),
54 connect(
d_table, SIGNAL(rowsInserted(
int,
int)),
56 connect(
d_table, SIGNAL(rowsAboutToBeRemoved(
int,
int)),
58 connect(
d_table, SIGNAL(rowsRemoved(
int,
int)),
60 connect(
d_table, SIGNAL(dataChanged(
int,
int,
int,
int)),
62 connect(
d_table, SIGNAL(headerDataChanged(Qt::Orientation,
int,
int)),
63 this, SIGNAL(headerDataChanged(Qt::Orientation,
int,
int)));
72 #ifdef LEGACY_CODE_0_2_x
73 Qt::ItemFlags result = Qt::ItemIsEnabled | Qt::ItemIsSelectable;
74 if (!isReadOnly()) result |= Qt::ItemIsEditable;
79 return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable;
82 return Qt::ItemIsEnabled;
90 int row =
index.row();
91 int col =
index.column();
101 postfix =
" " + tr(
"(masked)");
103 return QVariant(tr(
"invalid cell (ignored in all operations)",
"tooltip string for invalid rows") + postfix);
109 case Qt::DisplayRole:
112 return QVariant(col_ptr->
formula(row));
114 return QVariant(tr(
"-",
"string for invalid rows"));
118 case Qt::ForegroundRole:
121 return QVariant(QBrush(QColor(0xff,0,0)));
123 return QVariant(QBrush(QColor(0,0,0)));
126 return QVariant(col_ptr->
isMasked(row));
128 return QVariant(col_ptr->
formula(row));
129 case Qt::DecorationRole:
131 return QIcon(QPixmap(
":/equals.png"));
140 return d_table?
d_table->headerData(section, orientation, role): QVariant();
158 int row =
index.row();
174 d_table->column(
index.column())->setMasked(row, value.toBool());
179 d_table->column(
index.column())->setFormula(row, value.toString());
189 return createIndex(row,
column);
195 return QModelIndex();
200 int count = cols.count();
202 beginInsertColumns(QModelIndex(), before, before+count-1);
214 beginRemoveColumns(QModelIndex(), first, first+count-1);
226 beginInsertRows(QModelIndex(), before, before+count-1);
238 beginRemoveRows(QModelIndex(), first, first+count-1);
250 emit dataChanged(
index(top, left),
index(bottom, right));
void handleColumnsAboutToBeInserted(int, QList< Column * >)
ColumnStringIO * asStringColumn() const
Return a wrapper column object used for String I/O.
QVariant data(const QModelIndex &index, int role) const
QPointer< future::Table > d_table
TableModel(future::Table *table)
Constructor.
int rowCount(const QModelIndex &parent=QModelIndex()) const
void handleColumnsRemoved(int first, int count)
bool d_formula_mode
Toggle flag for formula mode.
Aspect providing a spreadsheet table with column logic.
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Aspect that manages a column.
void handleRowsAboutToBeInserted(int before, int count)
Qt::ItemFlags flags(const QModelIndex &index) const
void handleColumnsAboutToBeRemoved(int first, int count)
void setFormula(Interval< int > i, QString formula)
Set a formula string for an interval of rows.
void handleDataChanged(int top, int left, int bottom, int right)
void handleRowsAboutToBeRemoved(int first, int count)
QVariant headerData(int section, Qt::Orientation orientation, int role) const
bool isInvalid(int row) const override
Return whether a certain row contains an invalid value
int columnCount(const QModelIndex &parent=QModelIndex()) const
virtual QString textAt(int row) const
Return the content of row 'row'.
void handleColumnsInserted(int first, int count)
QModelIndex parent(const QModelIndex &child) const
bool isMasked(int row) const override
Return whether a certain row is masked
@ FormulaRole
the cells formula
QString formula(int row) const override
Return the formula associated with row 'row'
void handleRowsInserted(int first, int count)
@ MaskingRole
bool determining whether the cell is masked
void handleRowsRemoved(int first, int count)
virtual void setTextAt(int row, const QString &value)
bool setData(const QModelIndex &index, const QVariant &value, int role)
Column * column(int index)