46 #ifndef QT_NO_UNDOGROUP 121 (*it)->d_func()->group = 0;
139 if (
d->stack_list.contains(stack))
141 d->stack_list.append(stack);
143 if (
QUndoGroup *other = stack->d_func()->group)
144 other->removeStack(stack);
145 stack->d_func()->group =
this;
159 if (
d->stack_list.removeAll(stack) == 0)
161 if (stack ==
d->active)
163 stack->d_func()->group = 0;
175 return d->stack_list;
195 if (
d->active == stack)
198 if (
d->active != 0) {
215 if (
d->active == 0) {
306 return d->active != 0 &&
d->active->canUndo();
321 return d->active != 0 &&
d->active->canRedo();
336 return d->active == 0 ?
QString() :
d->active->undoText();
351 return d->active == 0 ?
QString() :
d->active->redoText();
366 return d->active == 0 ||
d->active->isClean();
390 result->
setTextFormat(
tr(
"Undo %1"),
tr(
"Undo",
"Default text for undo action"));
395 result,
SLOT(setEnabled(
bool)));
421 result->
setTextFormat(
tr(
"Redo %1"),
tr(
"Redo",
"Default text for redo action"));
426 result,
SLOT(setEnabled(
bool)));
433 #endif // QT_NO_ACTION 525 #endif // QT_NO_UNDOGROUP
void undo()
Calls QUndoStack::undo() on the active stack.
QUndoGroup(QObject *parent=0)
Creates an empty QUndoGroup object with parent parent.
#define QT_END_NAMESPACE
This macro expands to.
#define it(className, varName)
void canUndoChanged(bool canUndo)
This signal is emitted whenever the active stack emits QUndoStack::canUndoChanged() or the active sta...
static QString tr(const char *sourceText, const char *comment=0, int n=-1)
void addStack(QUndoStack *stack)
Adds stack to this group.
void indexChanged(int idx)
This signal is emitted whenever the active stack emits QUndoStack::indexChanged() or the active stack...
The QString class provides a Unicode character string.
The QObject class is the base class of all Qt objects.
QList< QUndoStack * > stack_list
void setTextFormat(const QString &textFormat, const QString &defaultText)
The QUndoGroup class is a group of QUndoStack objects.
#define QT_BEGIN_NAMESPACE
This macro expands to.
QAction * createUndoAction(QObject *parent, const QString &prefix=QString()) const
Creates an undo QAction object with parent parent.
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...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
QUndoStack * activeStack() const
Returns the active stack of this group.
void setActiveStack(QUndoStack *stack)
Sets the active stack of this group to stack.
The QUndoStack class is a stack of QUndoCommand objects.
void activeStackChanged(QUndoStack *stack)
This signal is emitted whenever the active stack of the group changes.
void cleanChanged(bool clean)
This signal is emitted whenever the active stack emits QUndoStack::cleanChanged() or the active stack...
The QList::iterator class provides an STL-style non-const iterator for QList and QQueue.
QString redoText() const
Returns the value of the active stack's QUndoStack::redoText().
void redoTextChanged(const QString &redoText)
This signal is emitted whenever the active stack emits QUndoStack::redoTextChanged() or the active st...
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.
QAction * createRedoAction(QObject *parent, const QString &prefix=QString()) const
Creates an redo QAction object with parent parent.
void removeStack(QUndoStack *stack)
Removes stack from this group.
#define Q_DECLARE_PUBLIC(Class)
void undoTextChanged(const QString &undoText)
This signal is emitted whenever the active stack emits QUndoStack::undoTextChanged() or the active st...
bool isClean() const
Returns the value of the active stack's QUndoStack::isClean().
~QUndoGroup()
Destroys the QUndoGroup.
QObject * parent() const
Returns a pointer to the parent object.
void canRedoChanged(bool canRedo)
This signal is emitted whenever the active stack emits QUndoStack::canRedoChanged() or the active sta...
bool canUndo() const
Returns the value of the active stack's QUndoStack::canUndo().
void setPrefixedText(const QString &text)
QString undoText() const
Returns the value of the active stack's QUndoStack::undoText().
void redo()
Calls QUndoStack::redo() on the active stack.
QList< QUndoStack * > stacks() const
Returns a list of stacks in this group.
static const KeyPair *const end
The QAction class provides an abstract user interface action that can be inserted into widgets...
The QList class is a template class that provides lists.
bool canRedo() const
Returns the value of the active stack's QUndoStack::canRedo().