I do not see a problem with the MVC card in QT for this.
Basically, the difference between the standard table display and the fact that you create a list that looks like a map dynamically:
QMap<QString, QVariant> property_map;
You can do:
QList<std::pair<QString, QVariant>> property_list;
which can then be used to display properties in the table. A better way would probably be:
struct { QString prop_name; int prop_type; QVariant prop_value; };
QVariant will basically provide you with one abstraction class for storing data, and in fact this is what is returned by the data()
function inside QAbstractItemModel
, which you could override.
So, basically you take a list of properties and boil it in the same table as the data in the form of a database.
CHANGED
If you have a widget that you want this widget to be filled with other predefined widgets, you will most likely have many problems if the widgets do not have the same or well-defined size.
What you can do is in widgets. A widget defines a layout, for example: QGridLayout or other possible layouts, then add other widgets to it it uses some set of parameters that can be executed, but can be a little painful.
Another approach you can take is to place all the widgets on the front panel of the display interface and simply include the ones you need and the rest, but this only applies if you have a well-defined limited number of presets, designed widgets .
source share