+ fixes #0001941: Refresh Property Editor

This commit is contained in:
wmayer
2015-09-13 15:53:59 +02:00
parent f83707d73e
commit 854ffb0013
3 changed files with 11 additions and 3 deletions

View File

@@ -81,15 +81,20 @@ void PropertyItem::reset()
void PropertyItem::setPropertyData(const std::vector<App::Property*>& items)
{
propertyItems = items;
updateData();
this->initialize();
}
void PropertyItem::updateData()
{
bool ro = true;
for (std::vector<App::Property*>::const_iterator it = items.begin();
it != items.end(); ++it) {
for (std::vector<App::Property*>::const_iterator it = propertyItems.begin();
it != propertyItems.end(); ++it) {
App::PropertyContainer* parent = (*it)->getContainer();
if (parent)
ro &= (parent->isReadOnly(*it) || (*it)->StatusBits.test(2));
}
this->setReadOnly(ro);
this->initialize();
}
const std::vector<App::Property*>& PropertyItem::getPropertyData() const
@@ -1774,6 +1779,7 @@ void PropertyEnumItem::setEditorData(QWidget *editor, const QVariant& data) cons
QComboBox *cb = qobject_cast<QComboBox*>(editor);
if (!commonModes.isEmpty()) {
cb->clear();
cb->addItems(commonModes);
cb->setCurrentIndex(cb->findText(data.toString()));
}