45 #ifndef QT_NO_UNDOVIEW 48 #include <QtCore/qabstractitemmodel.h> 49 #include <QtCore/qpointer.h> 50 #include <QtGui/qicon.h> 51 #include <private/qlistview_p.h> 218 if (index.
row() == 0)
284 #ifndef QT_NO_UNDOGROUP 298 q->setSelectionModel(model->selectionModel());
324 #ifndef QT_NO_UNDOGROUP 340 #endif // QT_NO_UNDOGROUP 360 return d->model->stack();
375 #ifndef QT_NO_UNDOGROUP 378 d->model->setStack(stack);
381 #ifndef QT_NO_UNDOGROUP 396 if (
d->group == group)
409 d->model->setStack(
d->group->activeStack());
411 d->model->setStack(0);
429 #endif // QT_NO_UNDOGROUP 446 d->model->setEmptyLabel(label);
452 return d->model->emptyLabel();
471 d->model->setCleanIcon(icon);
478 return d->model->cleanIcon();
483 #include "qundoview.moc" 485 #endif // QT_NO_UNDOVIEW The QVariant class acts like a union for the most common Qt data types.
void setStack(QUndoStack *stack)
Sets the stack displayed by this view to stack.
void setCleanIcon(const QIcon &icon)
QString text(int idx) const
Returns the text of the command at index idx.
The QItemSelectionModel class keeps track of a view's selected items.
#define QT_END_NAMESPACE
This macro expands to.
void setEmptyLabel(const QString &label)
QString emptyLabel() const
QUndoModel(QObject *parent=0)
QModelIndex createIndex(int row, int column, void *data=0) const
Creates a model index for the given row and column with the internal pointer ptr. ...
QUndoGroup * group() const
Returns the group displayed by this view.
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
QPointer< QUndoGroup > group
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
void setStack(QUndoStack *stack)
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const
Returns the number of rows under the given parent.
The QUndoGroup class is a group of QUndoStack objects.
void setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
Sets the model item index to be the current item, and emits currentChanged().
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QUndoView class displays the contents of a QUndoStack.
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const
Returns the index of the item in the model specified by the given row, column and parent index...
QItemSelectionModel * selectionModel() const
void destroyed(QObject *=0)
This signal is emitted immediately before the object obj is destroyed, and can not be blocked...
virtual QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Returns the data stored under the given role for the item referred to by the index.
QItemSelectionModel * m_sel_model
void setStackCurrentIndex(const QModelIndex &index)
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
int row() const
Returns the row this model index refers to.
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const
Returns the number of columns for the children of the given parent.
void setCleanIcon(const QIcon &icon)
QUndoView(QWidget *parent=0)
Constructs a new view with parent parent.
bool isNull() const
Returns true if the icon is empty; otherwise returns false.
QString emptyLabel() const
The QUndoStack class is a stack of QUndoCommand objects.
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
The QAbstractItemModel class provides the abstract interface for item model classes.
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
Disconnects signal in object sender from method in object receiver.
void stackDestroyed(QObject *obj)
#define Q_DECLARE_PUBLIC(Class)
~QUndoView()
Destroys this view.
The QListView class provides a list or icon view onto a model.
int cleanIndex() const
Returns the clean index.
QObject * parent() const
Returns a pointer to the parent object.
The QModelIndex class is used to locate data in a data model.
QUndoStack * stack() const
Returns the stack currently displayed by this view.
QModelIndex selectedIndex() const
int count() const
Returns the number of commands on the stack.
void setIndex(int idx)
Repeatedly calls undo() or redo() until the current command index reaches idx.
QUndoStack * stack() const
int index() const
Returns the index of the current command.
void setGroup(QUndoGroup *group)
Sets the group displayed by this view to group.
void reset()
Resets the model to its original state in any attached views.
int column() const
Returns the column this model index refers to.
void setEmptyLabel(const QString &label)
The QIcon class provides scalable icons in different modes and states.