mercredi 6 juillet 2016

What is a possible strategy to save/restore a GUI with Qt?

I want to implement the open/save functions of a GUI built with Qt and based on a QMainWindow. The whole GUI contains several QStandardItemModel, QLineEdit, QGroupBox, QSpinBox...

The first idea i have is to take all the widgets, class or model to be save and add a saveToFile / openFromFile methods, using QFile and QDataStream for data serialization.

The global architecture is a kind of implementation of the Smart UI approach however i am mixing MVC triads, and widgets inside the QMainWindow.

The GUI is not that big but i wonder if there are existing strategy to implement this open/save feature, in terms of software architecture.

I guess there are much clever ways to do so, and i am looking for any documentation or design pattern that can be used in general for this purpose.

Thanks.

Aucun commentaire:

Enregistrer un commentaire