I have a design issue which I've had in the past and never really found a satisfactory solution for, so I was hoping to get some fresh ideas on how to handle it.

I have a list of objects. Each object is of a different dervied type, but they all inherit from a common base class.

I have a GUI which needs to show the properties of each object in the list. The exact layout of each section of the GUI depends on the derived class type of the object.

In the past I have basically used typeid(...) and a bunch of conditional branches to determine which layout I use, but this feels clunky to me.

Does anybody have a neat solution they'd be prepared to share?

Cheers,
BJW