11 ui {*new Ui::SubfileReferenceEditor} |
11 ui {*new Ui::SubfileReferenceEditor} |
12 { |
12 { |
13 this->ui.setupUi(this); |
13 this->ui.setupUi(this); |
14 this->ui.referenceName->setText(reference->referenceName()); |
14 this->ui.referenceName->setText(reference->referenceName()); |
15 this->color = reference->color(); |
15 this->color = reference->color(); |
|
16 ::setColorButton(this->ui.colorButton, this->color); |
16 this->ui.positionX->setValue(reference->position().x()); |
17 this->ui.positionX->setValue(reference->position().x()); |
17 this->ui.positionY->setValue(reference->position().y()); |
18 this->ui.positionY->setValue(reference->position().y()); |
18 this->ui.positionZ->setValue(reference->position().z()); |
19 this->ui.positionZ->setValue(reference->position().z()); |
19 |
|
20 connect( |
20 connect( |
21 this->ui.colorButton, |
21 this->ui.colorButton, |
22 &QPushButton::clicked, |
22 &QPushButton::clicked, |
23 [&]() |
23 [&]() |
24 { |
24 { |
25 if (ColorSelector::selectColor(this, this->color, this->color)) |
25 if (ColorSelector::selectColor(this, this->color, this->color)) |
26 ::setColorButton(this->ui.colorButton, this->color); |
26 ::setColorButton(this->ui.colorButton, this->color); |
27 } |
27 } |
28 ); |
28 ); |
29 |
|
30 for (int i : {0, 1, 2}) |
29 for (int i : {0, 1, 2}) |
31 for (int j : {0, 1, 2}) |
30 for (int j : {0, 1, 2}) |
32 { |
31 { |
33 QLayoutItem* item = this->ui.matrixLayout->itemAtPosition(i, j); |
32 QLayoutItem* item = this->ui.matrixLayout->itemAtPosition(i, j); |
34 QDoubleSpinBox* spinbox = item ? qobject_cast<QDoubleSpinBox*>(item->widget()) : nullptr; |
33 QDoubleSpinBox* spinbox = item ? qobject_cast<QDoubleSpinBox*>(item->widget()) : nullptr; |