14 QWidget( parent ), m_matrix( matrix ) {
16 QGridLayout* layout =
new QGridLayout;
17 layout->setContentsMargins( {} );
18 layout->setSpacing( 0 );
20 for (
long i = 0; i < m_matrix.rows(); ++i ) {
21 for (
int j = 0; j < m_matrix.cols(); ++j ) {
22 auto& elem = m_matrix( i, j );
23 auto spinbox =
new QDoubleSpinBox();
24 spinbox->setDecimals( dec );
25 spinbox->setValue( elem );
29 layout->addWidget( spinbox, i, j );
30 auto updateMatrixOnChange = [
this, &elem](
double value ) {
32 emit valueChanged( m_matrix );
35 QOverload<double>::of( &QDoubleSpinBox::valueChanged ),
36 updateMatrixOnChange );