void AttributesEditor::changeColor() { if (_boxEdited != NO_ID) { BasicBox * box = _scene->getBox(_boxEdited); QColor color = QColorDialog::getColor(box->currentColor(), this); if (color.isValid()) { _colorButtonPixmap->fill(color); _generalColorButton->setIcon(QIcon(*_colorButtonPixmap)); box->changeColor(color); } } else { _scene->displayMessage("No box selected", INDICATION_LEVEL); } }
void AttributesEditor::updateWidgets(bool boxModified) { Q_UNUSED(boxModified); BasicBox * box = _scene->getBox(_boxEdited); if (box != NULL) { box->update(); box->centerWidget(); _boxStartValue->setValue(box->beginPos() * MaquetteScene::MS_PER_PIXEL / S_TO_MS); _boxLengthValue->setValue(box->width() * MaquetteScene::MS_PER_PIXEL / S_TO_MS); _boxName->setText(box->name()); _colorButtonPixmap->fill(box->currentColor()); _generalColorButton->setIcon(QIcon(*_colorButtonPixmap)); } update(); }