src/widgets/matrixeditor.cpp

changeset 112
5760cbb32bc0
parent 85
40e2940605a3
child 206
654661eab7f3
equal deleted inserted replaced
111:1f42c03fafca 112:5760cbb32bc0
17 const QString name = "cell"_q + QString::number(column) + QString::number(row); 17 const QString name = "cell"_q + QString::number(column) + QString::number(row);
18 QDoubleSpinBox** spinbox = &this->spinboxes[column][row]; 18 QDoubleSpinBox** spinbox = &this->spinboxes[column][row];
19 *spinbox = this->findChild<QDoubleSpinBox*>(name); 19 *spinbox = this->findChild<QDoubleSpinBox*>(name);
20 connect(*spinbox, qOverload<double>(&QDoubleSpinBox::valueChanged), [&]() 20 connect(*spinbox, qOverload<double>(&QDoubleSpinBox::valueChanged), [&]()
21 { 21 {
22 emit this->valueChanged(this->value()); 22 Q_EMIT this->valueChanged(this->value());
23 }); 23 });
24 Q_ASSERT(*spinbox != nullptr); 24 Q_ASSERT(*spinbox != nullptr);
25 } 25 }
26 QAbstractButton* button = this->findChild<QAbstractButton*>("multiply"_q + QString::number(column)); 26 QAbstractButton* button = this->findChild<QAbstractButton*>("multiply"_q + QString::number(column));
27 button->setProperty(BUTTON_COLUMN_PROPERTY, column); 27 button->setProperty(BUTTON_COLUMN_PROPERTY, column);
80 const int result = dialog.exec(); 80 const int result = dialog.exec();
81 if (result == QDialog::Accepted) 81 if (result == QDialog::Accepted)
82 { 82 {
83 newValue[column] = glm::vec4{dialog.value(), (column == 3) ? 1 : 0}; 83 newValue[column] = glm::vec4{dialog.value(), (column == 3) ? 1 : 0};
84 this->setValue(newValue); 84 this->setValue(newValue);
85 emit valueChanged(newValue); 85 Q_EMIT valueChanged(newValue);
86 } 86 }
87 } 87 }
88 } 88 }
89 } 89 }

mercurial