I\'d like to know if there is a way to get the type of the elements of a declared, but not instantiated, TList. I can capture the class of an object property like this:
As far as I know, RTTI is not flexible enough to give you information about Generic parameters. You will likely have to manually parse the value of MyRTTIProperty.PropertyType.Name
(TList
) to extract the Generic type name (TMyObject
), then use TRttiContext.FindType()
to get the RTTI for that type, and then finally you can create instances of its ClassType
as needed.