Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qundoview.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5#ifndef QUNDOVIEW_H
6#define QUNDOVIEW_H
7
8#include <QtWidgets/qtwidgetsglobal.h>
9#include <QtWidgets/qlistview.h>
10#include <QtCore/qstring.h>
11
13
14QT_BEGIN_NAMESPACE
15
16class QUndoViewPrivate;
17class QUndoStack;
18class QUndoGroup;
19class QIcon;
20
21
22class Q_WIDGETS_EXPORT QUndoView : public QListView
23{
24 Q_OBJECT
25 Q_DECLARE_PRIVATE(QUndoView)
26 Q_PROPERTY(QString emptyLabel READ emptyLabel WRITE setEmptyLabel)
27 Q_PROPERTY(QIcon cleanIcon READ cleanIcon WRITE setCleanIcon)
28
29public:
30 explicit QUndoView(QWidget *parent = nullptr);
31 explicit QUndoView(QUndoStack *stack, QWidget *parent = nullptr);
32#if QT_CONFIG(undogroup)
33 explicit QUndoView(QUndoGroup *group, QWidget *parent = nullptr);
34#endif
35 ~QUndoView();
36
37 QUndoStack *stack() const;
38#if QT_CONFIG(undogroup)
39 QUndoGroup *group() const;
40#endif
41
42 void setEmptyLabel(const QString &label);
43 QString emptyLabel() const;
44
45 void setCleanIcon(const QIcon &icon);
46 QIcon cleanIcon() const;
47
48public Q_SLOTS:
49 void setStack(QUndoStack *stack);
50#if QT_CONFIG(undogroup)
51 void setGroup(QUndoGroup *group);
52#endif
53
54private:
55 Q_DISABLE_COPY(QUndoView)
56};
57
58QT_END_NAMESPACE
59
60#endif // QUNDOVIEW_H
QItemSelectionModel * selectionModel() const
Definition qundoview.cpp:67
void setCleanIcon(const QIcon &icon)
QString emptyLabel() const
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const override
Returns the data stored under the given role for the item referred to by the index.
void setEmptyLabel(const QString &label)
QUndoStack * stack() const
Definition qundoview.cpp:72
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of columns for the children of the given parent.
QModelIndex selectedIndex() const
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Returns the index of the item in the model specified by the given row, column and parent index.
QIcon cleanIcon() const
virtual QModelIndex parent(const QModelIndex &child) const override
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows under the given parent.
The QUndoView class displays the contents of a QUndoStack.
Definition qundoview.h:23
QT_REQUIRE_CONFIG(undoview)