21 #include "ui_datawidget.h" 28 table_model_ = table_model;
29 ui->tableView->setModel(table_model);
30 ui->tableView->resizeColumnsToContents();
32 subviews_ = std::ceil(matrix_columns_/15);
33 current_start_column_ = 1;
35 ui->backPushButton->setEnabled(
false);
36 ui->forwardPushButton->setEnabled(subviews_ > 1);
37 uint last_column = (matrix_columns_ > 15 ? 15 : matrix_columns_);
38 QString label =
"Showing columns 1–" + QString::number(last_column);
39 ui->columnLabel->setText(label);
44 ui->tableView->setModel(table_model);
45 table_model_ = table_model;
46 ui->tableView->resizeColumnsToContents();
59 void DataWidget::on_forwardPushButton_clicked()
62 uint next_start_column = current_start_column_ + 15;
63 uint next_end_column = next_start_column + 15;
64 next_end_column = (next_end_column < matrix_columns_ ? next_end_column : matrix_columns_);
65 ui->backPushButton->setEnabled(
true);
66 ui->forwardPushButton->setEnabled(next_end_column - 1 < matrix_columns_);
67 current_start_column_ = next_start_column;
70 next_start_column - 1,
72 ui->tableView->setModel(table_model_);
73 QString label =
"Showing columns " + QString::number(current_start_column_)
74 +
"–" + QString::number(next_end_column);
75 ui->columnLabel->setText(label);
76 ui->tableView->resizeColumnsToContents();
79 void DataWidget::on_backPushButton_clicked()
81 uint next_start_column = current_start_column_ - 15;
85 ui->backPushButton->setEnabled(next_start_column);
86 ui->forwardPushButton->setEnabled(
true);
89 current_start_column_ = next_start_column;
90 uint next_end_column = current_start_column_ - 15;
95 ui->tableView->setModel(table_model_);
96 QString label =
"Showing columns " + QString::number(current_start_column_)
97 +
"–" + QString::number(next_end_column);
98 ui->columnLabel->setText(label);
99 ui->tableView->resizeColumnsToContents();
The VespucciTableModel class The QAbstractTableModel that handles armadillo objects for the DataViewe...
uword MatrixColumns()
VespucciTableModel::MatrixColumns.
const mat & GetMatrix() const
VespucciTableModel::GetMatrix.