Core: In dialog to add property only list types that can be instantiated
Fixes #15159: Dialog for adding properties allows property types that give exceptions
This commit is contained in:
@@ -128,7 +128,7 @@ private:
|
||||
TYPESYSTEM_SOURCE_ABSTRACT_P(_class_) \
|
||||
void _class_::init(void) \
|
||||
{ \
|
||||
initSubclass(_class_::classTypeId, #_class_, #_parentclass_, &(_class_::create)); \
|
||||
initSubclass(_class_::classTypeId, #_class_, #_parentclass_, nullptr); \
|
||||
}
|
||||
// NOLINTEND(cppcoreguidelines-macro-usage)
|
||||
|
||||
|
||||
@@ -65,6 +65,11 @@ void* Type::createInstance()
|
||||
return method ? (*method)() : nullptr;
|
||||
}
|
||||
|
||||
bool Type::canInstantiate() const
|
||||
{
|
||||
instantiationMethod method = typedata[index]->instMethod;
|
||||
return method != nullptr;
|
||||
}
|
||||
|
||||
void* Type::createInstanceByName(const char* TypeName, bool bLoadModule)
|
||||
{
|
||||
|
||||
@@ -89,6 +89,8 @@ public:
|
||||
|
||||
/// creates a instance of this type
|
||||
void* createInstance();
|
||||
/// Checks whether this type can instantiate
|
||||
bool canInstantiate() const;
|
||||
/// creates a instance of the named type
|
||||
static void* createInstanceByName(const char* TypeName, bool bLoadModule = false);
|
||||
static void importModule(const char* TypeName);
|
||||
|
||||
Reference in New Issue
Block a user