30 qDebug() <<
"ModelToVtkTableConverter::run : null model.";
36 m_table->Initialize();
42 for (
int col = 0; col < cols; ++col) {
43 columnName = m_labels.size() > col ? m_labels.at(col)
44 : QString(
"column#%1").arg(col + 1);
46 arr->SetName(columnName.toUtf8().data());
47 m_table->AddColumn(arr);
51 m_table->SetNumberOfRows(rows);
53 for (
int r = 0; r < rows; ++r)
54 for (
int c = 0; c < cols; ++c)
55 m_table->SetValue(r, c, m_model->
data(r, c));
ModelToVtkTableConverter(TableModel *model)
void setLabels(const QStringList &labels)
QStringList labels() const
int columnCount(const QModelIndex &parent=QModelIndex()) const
int rowCount(const QModelIndex &parent=QModelIndex()) const
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
void vtkInitOnce(T **obj)