1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QUNDOVIEW_H
5#define QUNDOVIEW_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtWidgets/qlistview.h>
9#include <QtCore/qstring.h>
10
11QT_REQUIRE_CONFIG(undoview);
12
13QT_BEGIN_NAMESPACE
14
15class QUndoViewPrivate;
16class QUndoStack;
17class QUndoGroup;
18class QIcon;
19
20
21class Q_WIDGETS_EXPORT QUndoView : public QListView
22{
23 Q_OBJECT
24 Q_DECLARE_PRIVATE(QUndoView)
25 Q_PROPERTY(QString emptyLabel READ emptyLabel WRITE setEmptyLabel)
26 Q_PROPERTY(QIcon cleanIcon READ cleanIcon WRITE setCleanIcon)
27
28public:
29 explicit QUndoView(QWidget *parent = nullptr);
30 explicit QUndoView(QUndoStack *stack, QWidget *parent = nullptr);
31#if QT_CONFIG(undogroup)
32 explicit QUndoView(QUndoGroup *group, QWidget *parent = nullptr);
33#endif
34 ~QUndoView();
35
36 QUndoStack *stack() const;
37#if QT_CONFIG(undogroup)
38 QUndoGroup *group() const;
39#endif
40
41 void setEmptyLabel(const QString &label);
42 QString emptyLabel() const;
43
44 void setCleanIcon(const QIcon &icon);
45 QIcon cleanIcon() const;
46
47public Q_SLOTS:
48 void setStack(QUndoStack *stack);
49#if QT_CONFIG(undogroup)
50 void setGroup(QUndoGroup *group);
51#endif
52
53private:
54 Q_DISABLE_COPY(QUndoView)
55};
56
57QT_END_NAMESPACE
58
59#endif // QUNDOVIEW_H
60

source code of qtbase/src/widgets/util/qundoview.h