| 53 | #include <gsl/gsl_const_cgs.h> |
| 54 | |
| 55 | MatrixView::MatrixView(Matrix* matrix) |
| 56 | : QWidget() |
| 57 | , m_stackedWidget(new QStackedWidget(this)) |
| 58 | , m_tableView(new QTableView(this)) |
| 59 | , m_imageLabel(new QLabel(this)) |
| 60 | , m_matrix(matrix) |
| 61 | , m_model(new MatrixModel(matrix)) { |
| 62 | init(); |
| 63 | |
| 64 | // resize the view to show a 10x10 region of the matrix. |
| 65 | // no need to resize the view when the project is being opened, |
| 66 | // all views will be resized to the stored values at the end |
| 67 | if (!m_matrix->isLoading()) { |
| 68 | int w = m_tableView->horizontalHeader()->sectionSize(0) * 10 + m_tableView->verticalHeader()->width(); |
| 69 | int h = m_tableView->verticalHeader()->sectionSize(0) * 10 + m_tableView->horizontalHeader()->height(); |
| 70 | resize(w + 50, h + 50); |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | MatrixView::~MatrixView() { |
| 75 | delete m_model; |