Repository: FreeCAD/FreeCAD
File: src/Gui/Dialogs/DlgAddProperty.cpp (C++)

Code before:
    }

    App::Property* prop = propertyItem->getFirstProperty();
    if (prop == nullptr) {
        return false;
    }

    const Base::Type type = prop->getTypeId();
    return isTypeWithEditor(type);
}

bool DlgAddProperty::isTypeWithEditor(const Base::Type& type) const
{
    static const std::initializer_list<Base::Type> subTypesWithEditor = {
        // These types and their subtypes have editors.
        App::PropertyBool::getClassTypeId(),
        App::PropertyColor::getClassTypeId(),
        App::PropertyFileIncluded::getClassTypeId(),
        App::PropertyFloat::getClassTypeId(),
        App::PropertyInteger::getClassTypeId()
    };

    static const std::initializer_list<Base::Type> typesWithEditor = {
        // These types have editors but not necessarily their subtypes.

        // Allthough sublink properties have editors, they need the 3D view to
        // select an object.  Because the dialog is modal, it is not possible
        // to make use of the 3D view, hence we do not provide an editor for
        // sublinks and their lists.  It is possible to create a property of
        // this type though and the property can be set in the property view
        // later which does give access to the 3D view.
        App::PropertyEnumeration::getClassTypeId(),
        App::PropertyFile::getClassTypeId(),
        App::PropertyFloatList::getClassTypeId(),
        App::PropertyFont::getClassTypeId(),
        App::PropertyIntegerList::getClassTypeId(),
        App::PropertyLink::getClassTypeId(),
        App::PropertyLinkList::getClassTypeId(),
        App::PropertyXLink::getClassTypeId(),
        App::PropertyXLinkList::getClassTypeId(),
        App::PropertyMaterialList::getClassTypeId(),
        App::PropertyPath::getClassTypeId(),
        App::PropertyString::getClassTypeId(),
        App::PropertyStringList::getClassTypeId(),
        App::PropertyVectorList::getClassTypeId()
    };

    const auto isDerivedFromType = [&type](const Base::Type& t) {
        return type.isDerivedFrom(t);
    };


Review comment (suggestion):
```suggestion
        // Although sublink properties have editors, they need the 3D view to
```

Code after:
    }

    App::Property* prop = propertyItem->getFirstProperty();
    if (prop == nullptr) {
        return false;
    }

    const Base::Type type = prop->getTypeId();
    return isTypeWithEditor(type);
}

bool DlgAddProperty::isTypeWithEditor(const Base::Type& type) const
{
    static const std::initializer_list<Base::Type> subTypesWithEditor = {
        // These types and their subtypes have editors.
        App::PropertyBool::getClassTypeId(),
        App::PropertyColor::getClassTypeId(),
        App::PropertyFileIncluded::getClassTypeId(),
        App::PropertyFloat::getClassTypeId(),
        App::PropertyInteger::getClassTypeId()
    };

    static const std::initializer_list<Base::Type> typesWithEditor = {
        // These types have editors but not necessarily their subtypes.

        // Although sublink properties have editors, they need the 3D view to
        // select an object.  Because the dialog is modal, it is not possible
        // to make use of the 3D view, hence we do not provide an editor for
        // sublinks and their lists.  It is possible to create a property of
        // this type though and the property can be set in the property view
        // later which does give access to the 3D view.
        App::PropertyEnumeration::getClassTypeId(),
        App::PropertyFile::getClassTypeId(),
        App::PropertyFloatList::getClassTypeId(),
        App::PropertyFont::getClassTypeId(),
        App::PropertyIntegerList::getClassTypeId(),
        App::PropertyLink::getClassTypeId(),
        App::PropertyLinkList::getClassTypeId(),
        App::PropertyXLink::getClassTypeId(),
        App::PropertyXLinkList::getClassTypeId(),
        App::PropertyMaterialList::getClassTypeId(),
        App::PropertyPath::getClassTypeId(),
        App::PropertyString::getClassTypeId(),
        App::PropertyStringList::getClassTypeId(),
        App::PropertyVectorList::getClassTypeId()
    };

    const auto isDerivedFromType = [&type](const Base::Type& t) {
        return type.isDerivedFrom(t);
    };