aEditor = QStyledItemDelegate::createEditor(theParent, theOption, theIndex);
}
}
- QObject* aThat = (QObject*) this;
- aEditor->installEventFilter(aThat);
+ if (myType == ModelAPI_AttributeTables::BOOLEAN)
+ connect(aEditor, SIGNAL(currentTextChanged(const QString&)),
+ SLOT(onEditItem(const QString&)));
+ else
+ connect(aEditor, SIGNAL(textEdited(const QString&)),
+ SLOT(onEditItem(const QString&)));
return aEditor;
}
-//bool DataTableItemDelegate::eventFilter(QObject* theObj, QEvent* theEvent)
-//{
-// qDebug("### Type = %i", theEvent->type());
-// if (theEvent->type() == QEvent::Close) {
-// QWidget* aWgt = dynamic_cast<QWidget*>(theObj);
-// commitData(aWgt);
-// }
-// return QStyledItemDelegate::eventFilter(theObj, theEvent);
-//}
+void DataTableItemDelegate::onEditItem(const QString& theText)
+{
+ QWidget* aWgt = dynamic_cast<QWidget*>(sender());
+ commitData(aWgt);
+}
+
//**********************************************************************************
std::string aTypeStr = aSelList->selectionType();
if (aTypeStr == "")
return false; // The attribute is not initialized
+ isBlocked = myShapeTypeCombo->blockSignals(true);
myShapeTypeCombo->setCurrentIndex(getSelectionType(aTypeStr));
+ myShapeTypeCombo->blockSignals(isBlocked);
// Get number of components
AttributeStringArrayPtr aStringsAttr =
for (anIt = theValues.begin(); anIt != theValues.end(); anIt++) {
ModuleBase_ViewerPrsPtr aValue = *anIt;
ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aValue->object());
- if (theToValidate && aRes.get() && acceptSubShape(aValue->shape(), aRes))
- aSelected.append(aValue);
+ if (theToValidate && aRes.get()) {
+ if (myShapeTypeCombo->currentIndex() > 3)
+ aSelected.append(aValue);
+ else if (acceptSubShape(aValue->shape(), aRes))
+ aSelected.append(aValue);
+ }
}
AttributeSelectionListPtr aSelList =
myFeature->data()->selectionList(CollectionPlugin_Field::SELECTED_ID());