ModuleBase_Tools::zeroMargins(aLay);
QLineEdit* aEditor = new QLineEdit(QString::number(theValue), &aDlg);
+ aEditor->selectAll();
aEditor->setValidator(new QDoubleValidator(aEditor));
QObject::connect(aEditor, SIGNAL(returnPressed()), &aDlg, SLOT(accept()));
aLay->addWidget(aEditor);
if (!myObjectTypes.isEmpty() && myObjTypeFilter.IsNull()) {
myObjTypeFilter = new ModuleBase_ObjectTypesFilter(myWorkshop, myObjectTypes);
}
- theFilters.Append(myObjTypeFilter);
+ if (!myObjTypeFilter.IsNull())
+ theFilters.Append(myObjTypeFilter);
// apply filters loaded from the XML definition of the widget
ModuleBase_FilterFactory* aFactory = myWorkshop->selectionFilters();
const std::string& theParentId)
: ModuleBase_ModelWidget(theParent, theData, theParentId)
{
+ // the control should accept the focus, so the boolen flag is corrected to be true
+ myIsObligatory = true;
//myOptionParam = theData->getProperty(PREVIOUS_FEATURE_PARAM);
QString aPageName = QString::fromStdString(theData->getProperty(CONTAINER_PAGE_NAME));
myGroupBox = new QGroupBox(aPageName, theParent);
if (aShapeType != 6/*an edge*/ && aShapeType != 7/*a vertex*/)
return;
- bool isConstruction = data()->boolean(SketchPlugin_Feature::CONSTRUCTION_ID())->value();
+ std::shared_ptr<ModelAPI_AttributeBoolean> aConstructionAttr =
+ data()->boolean(SketchPlugin_Feature::CONSTRUCTION_ID());
+ bool isConstruction = aConstructionAttr.get() != NULL && aConstructionAttr->value();
if (aShapeType == 6) { // if this is an edge
if (isConstruction) {
thePrs->setWidth(1);