| 40 | } |
| 41 | |
| 42 | void MatioOptionsWidget::updateContent(MatioFilter* filter, const QString& fileName) { |
| 43 | // update variable info |
| 44 | filter->parse(fileName); |
| 45 | |
| 46 | const auto n = filter->varCount(); |
| 47 | const QVector<QStringList> varsInfo = filter->varsInfo(); |
| 48 | ui.twContent->setRowCount(n); |
| 49 | const int nrCols = 7; |
| 50 | for (int j = 0; j < nrCols; j++) { |
| 51 | for (size_t i = 0; i < n; i++) { |
| 52 | auto* item = new QTableWidgetItem(varsInfo.at(i).at(j)); |
| 53 | item->setFlags(item->flags() ^ Qt::ItemIsEditable); // readonly |
| 54 | ui.twContent->setItem(i, j, item); |
| 55 | } |
| 56 | ui.twContent->resizeColumnToContents(j); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | /*! |
| 61 | updates the selected var name of a Matio file when the table widget item is selected |
nothing calls this directly
no test coverage detected