| 112 | } |
| 113 | |
| 114 | QWidget* Matrix::view() const { |
| 115 | #ifndef SDK |
| 116 | if (!m_partView) { |
| 117 | m_view = new MatrixView(const_cast<Matrix*>(this)); |
| 118 | m_partView = m_view; |
| 119 | m_model = m_view->model(); |
| 120 | connect(this, &Matrix::viewAboutToBeDeleted, [this]() { |
| 121 | m_view = nullptr; |
| 122 | }); |
| 123 | |
| 124 | // navigate to the first cell and set the focus so the user can start directly entering new data |
| 125 | QTimer::singleShot(0, this, [=]() { |
| 126 | m_view->goToCell(0, 0); |
| 127 | m_view->setFocus(); |
| 128 | }); |
| 129 | } |
| 130 | return m_partView; |
| 131 | #else |
| 132 | return nullptr; |
| 133 | #endif |
| 134 | } |
| 135 | |
| 136 | bool Matrix::exportView() const { |
| 137 | #ifndef SDK |