How do you synchronize GUI elements to a (non-database) data source?
I have an array of items. An item is represented by a class that contains three string fields. I have a GUI with three line edits to display/edit the fields of an item. I also have a slider to access the items within the array.
I want to synchronize the items within the array with any changes made to the line edits. Is there a way to do that automatically, such that a change to the line edit updates the data? (And vice-versa?)
Re: How do you synchronize GUI elements to a (non-database) data source?
Your data structure seems like a table (rows are the elements in your array, columns are the three string values). Hence you might want to subclass the QAbstractTableModel.
I don't think what you want to do can be done automatically.
Re: How do you synchronize GUI elements to a (non-database) data source?
I'd say maybe QAbstractTableModel with a QDataWidgetMapper
Cheers,
_