6#if QT_CONFIG(undogroup)
7#include <QtGui/qundogroup.h>
9#include <QtGui/qundostack.h>
10#include <QtCore/qabstractitemmodel.h>
11#include <QtCore/qpointer.h>
12#include <QtGui/qicon.h>
13#include <private/qlistview_p.h>
23 QUndoStack *
stack()
const;
63 m_emty_label =
tr(
"<empty>");
81 if (m_stack !=
nullptr) {
87 if (m_stack !=
nullptr) {
105void QUndoModel::stackChanged()
114 if (m_stack ==
nullptr)
120 if (
index.column() != 0)
123 m_stack->setIndex(
index.row());
133 if (m_stack ==
nullptr)
142 if (row < 0 || row > m_stack->count())
155 if (m_stack ==
nullptr)
161 return m_stack->count() + 1;
171 if (m_stack ==
nullptr)
174 if (
index.column() != 0)
177 if (
index.row() < 0 ||
index.row() > m_stack->count())
181 if (
index.row() == 0)
183 return m_stack->text(
index.row() - 1);
185 if (
index.row() == m_stack->cleanIndex() && !m_clean_icon.
isNull())
200 m_emty_label =
label;
245#if QT_CONFIG(undogroup)
285#if QT_CONFIG(undogroup)
321 return d->model->stack();
336#if QT_CONFIG(undogroup)
339 d->model->setStack(
stack);
342#if QT_CONFIG(undogroup)
360 if (
d->group !=
nullptr) {
367 if (
d->group !=
nullptr) {
370 d->model->setStack(
d->group->activeStack());
372 d->model->setStack(
nullptr);
404 d->model->setEmptyLabel(
label);
410 return d->model->emptyLabel();
426 d->model->setCleanIcon(
icon);
433 return d->model->cleanIcon();
438#include "qundoview.moc"
439#include "moc_qundoview.cpp"
Q_INVOKABLE int const QModelIndex & parent
Returns the parent of the model item with the given index.
void endResetModel()
Completes a model reset operation.
void beginResetModel()
Begins a model reset operation.
QModelIndex createIndex(int row, int column, const void *data=nullptr) const
Creates a model index for the given row and column with the internal pointer ptr.
The QIcon class provides scalable icons in different modes and states.
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
virtual void setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
Sets the model item index to be the current item, and emits currentChanged().
The QListView class provides a list or icon view onto a model.
constexpr bool isValid() const noexcept
Returns {true} if this model index is valid; otherwise returns {false}.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
\macro QT_RESTRICTED_CAST_FROM_ASCII
The QUndoGroup class is a group of QUndoStack objects.
QItemSelectionModel * selectionModel() const
QUndoModel(QObject *parent=nullptr)
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 int rowCount(const QModelIndex &parent=QModelIndex()) const override
Returns the number of rows under the given parent.
void setStack(QUndoStack *stack)
The QUndoView class displays the contents of a QUndoStack.
~QUndoView()
Destroys this view.
QIcon cleanIcon
the icon used to represent the clean state.
QString emptyLabel
the label used for the empty state.
QUndoStack * stack() const
Returns the stack currently displayed by this view.
void setCleanIcon(const QIcon &icon)
QUndoView(QWidget *parent=nullptr)
Constructs a new view with parent parent.
void setEmptyLabel(const QString &label)
void setStack(QUndoStack *stack)
Sets the stack displayed by this view to stack.
Combined button and popup list for selecting options.
GLuint GLsizei const GLchar * label
[43]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei void GLsizei void * column
GLdouble GLdouble GLdouble GLdouble q
GLenum GLenum GLsizei void * row
#define QT_CONFIG(feature)
if(qFloatDistance(a, b)<(1<< 7))
[0]
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)
myObject disconnect()
[26]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent