1/*
2 SPDX-FileCopyrightText: 2010 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.net>
3 SPDX-FileContributor: Stephen Kelly <stephen@kdab.com>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef KVIEWSTATEMAINTAINERBASE_H
9#define KVIEWSTATEMAINTAINERBASE_H
10
11#include "kwidgetsaddons_export.h"
12
13#include <QObject>
14
15#include <memory>
16
17class QItemSelectionModel;
18class QAbstractItemView;
19
20class KViewStateMaintainerBasePrivate;
21
22/*!
23 * \class KViewStateMaintainerBase
24 * \inmodule KWidgetsAddons
25 */
26class KWIDGETSADDONS_EXPORT KViewStateMaintainerBase : public QObject
27{
28 Q_OBJECT
29public:
30 /*!
31 *
32 */
33 KViewStateMaintainerBase(QObject *parent = nullptr);
34 ~KViewStateMaintainerBase() override;
35
36 /*!
37 *
38 */
39 void setSelectionModel(QItemSelectionModel *selectionModel);
40
41 /*!
42 *
43 */
44 QItemSelectionModel *selectionModel() const;
45
46 /*!
47 *
48 */
49 void setView(QAbstractItemView *view);
50
51 /*!
52 *
53 */
54 QAbstractItemView *view() const;
55
56 /*!
57 *
58 */
59 virtual void saveState() = 0;
60
61 /*!
62 *
63 */
64 virtual void restoreState() = 0;
65
66private:
67 Q_DECLARE_PRIVATE(KViewStateMaintainerBase)
68 std::unique_ptr<KViewStateMaintainerBasePrivate> const d_ptr;
69};
70
71#endif
72

source code of kwidgetsaddons/src/kviewstatemaintainerbase.h