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
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
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
QItemSelectionModel * selectionModel() const
Definition qundoview.cpp:66
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:71
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:22
Combined button and popup list for selecting options.
QT_REQUIRE_CONFIG(undoview)