PDA

View Full Version : Best way to store and retrieve contents of QTableWidget?



codeslicer
5th April 2008, 00:05
What is the best way of saving and restoring the contents of a QTableWidget into QSettings? Saving and restoring every single item would take a while, is there anything else?

Thanks in advance ~codeslicer :)

wysota
5th April 2008, 07:59
You can use a proper model, for example onebased on a stringlist and then save the stringlist to settings. But it will take the same amount of time as storing each item manualy.

codeslicer
6th April 2008, 00:56
Ok thanks, I was just wandering if there was a way of taking out one huge piece of "data" from the QTableWidget and just stuffing it into QSettings. But I guess I'll just create a parser script which will check a folder in QSettings for any values.

Thanks again

wysota
6th April 2008, 09:39
There is no single piece of data in QTableWidget. It consists of separate items. If you had a proper model, you could implement it in such a way that all data would be stored in a list that you could simply redirect to QSettings.