7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtWidgets/qlistview.h>
9#include <QtCore/qstring.h>
15class QUndoViewPrivate;
24 Q_DECLARE_PRIVATE(QUndoView)
25 Q_PROPERTY(QString emptyLabel READ emptyLabel WRITE setEmptyLabel)
26 Q_PROPERTY(QIcon cleanIcon READ cleanIcon WRITE setCleanIcon)
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);
36 QUndoStack *stack()
const;
37#if QT_CONFIG(undogroup)
38 QUndoGroup *group()
const;
41 void setEmptyLabel(
const QString &label);
42 QString emptyLabel()
const;
44 void setCleanIcon(
const QIcon &icon);
45 QIcon cleanIcon()
const;
48 void setStack(QUndoStack *stack);
49#if QT_CONFIG(undogroup)
50 void setGroup(QUndoGroup *group);
54 Q_DISABLE_COPY(QUndoView)
QItemSelectionModel * selectionModel() const
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
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.
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.
Combined button and popup list for selecting options.
QT_REQUIRE_CONFIG(undoview)