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

source code of kconfigwidgets/src/kconfigviewstatesaver.h