| 1 | |
| 2 | #ifndef KCONFIGVIEWSTATESAVER_H |
| 3 | #define KCONFIGVIEWSTATESAVER_H |
| 4 | |
| 5 | #include <KViewStateSerializer> |
| 6 | |
| 7 | #include "kconfigwidgets_export.h" |
| 8 | |
| 9 | class KConfigGroup; |
| 10 | |
| 11 | /*! |
| 12 | * \class KConfigViewStateSaver |
| 13 | * \inmodule KConfigWidgets |
| 14 | * |
| 15 | * \brief Base class for saving and restoring state in QTreeViews and QItemSelectionModels using KConfig as storage. |
| 16 | */ |
| 17 | class KCONFIGWIDGETS_EXPORT KConfigViewStateSaver : public KViewStateSerializer |
| 18 | { |
| 19 | Q_OBJECT |
| 20 | public: |
| 21 | explicit KConfigViewStateSaver(QObject *parent = nullptr); |
| 22 | |
| 23 | /*! |
| 24 | Saves the state to the \a configGroup |
| 25 | */ |
| 26 | void saveState(KConfigGroup &configGroup); |
| 27 | |
| 28 | /*! |
| 29 | Restores the state from the \a configGroup |
| 30 | */ |
| 31 | void restoreState(const KConfigGroup &configGroup); |
| 32 | }; |
| 33 | |
| 34 | #endif |
| 35 | |