|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QUndoGroup
public class QUndoGroup
The QUndoGroup
class is a group of QUndoStack
objects. For an overview of the Qt's undo framework, see the overview.
An application often has multiple undo stacks, one for each opened document. At the same time, an application usually has one undo action and one redo action, which triggers undo or redo in the active document.
QUndoGroup
is a group of QUndoStack
objects, one of which may be active. It has an undo()
and redo()
slot, which calls QUndoStack::undo()
and QUndoStack::redo()
for the active stack. It also has the functions createUndoAction()
and createRedoAction()
. The actions returned by these functions behave in the same way as those returned by QUndoStack::createUndoAction()
and QUndoStack::createRedoAction()
of the active stack.
Stacks are added to a group with addStack()
and removed with removeStack()
. A stack is implicitly added to a group when it is created with the group as its parent QObject
.
It is the programmer's responsibility to specify which stack is active by calling QUndoStack::setActive()
, usually when the associated document window receives focus. The active stack may also be set with setActiveStack()
, and is returned by activeStack()
.
When a stack is added to a group using addStack()
, the group does not take ownership of the stack. This means the stack has to be deleted separately from the group. When a stack is deleted, it is automatically removed from a group. A stack may belong to only one group. Adding it to another group will cause it to be removed from the previous group.
A QUndoGroup
is also useful in conjunction with QUndoView
. If a QUndoView
is set to watch a group using QUndoView::setGroup()
, it will update itself to display the active stack.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary | |
---|---|
QSignalEmitter.Signal1 |
activeStackChanged
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal1 |
canRedoChanged
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal1 |
canUndoChanged
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal1 |
cleanChanged
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal1 |
indexChanged
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal1 |
redoTextChanged
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal1 |
undoTextChanged
This signal takes 1 generic argument(s). |
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
Constructor Summary | |
---|---|
QUndoGroup()
Creates an empty QUndoGroup object with parent parent. |
|
QUndoGroup(QObject parent)
Creates an empty QUndoGroup object with parent parent. |
Method Summary | |
---|---|
QUndoStack |
activeStack()
Returns the active stack of this group. |
void |
addStack(QUndoStack stack)
Adds stack to this group. |
boolean |
canRedo()
Returns the value of the active stack's QUndoStack::canRedo() . |
boolean |
canUndo()
Returns the value of the active stack's QUndoStack::canUndo() . |
QAction |
createRedoAction(QObject parent)
Creates an redo QAction object with parent parent. |
QAction |
createRedoAction(QObject parent,
java.lang.String prefix)
Creates an redo QAction object with parent parent. |
QAction |
createUndoAction(QObject parent)
Creates an undo QAction object with parent parent. |
QAction |
createUndoAction(QObject parent,
java.lang.String prefix)
Creates an undo QAction object with parent parent. |
boolean |
isClean()
Returns the value of the active stack's QUndoStack::isClean() . |
void |
redo()
Calls QUndoStack::redo() on the active stack. |
java.lang.String |
redoText()
Returns the value of the active stack's QUndoStack::redoText() . |
void |
removeStack(QUndoStack stack)
Removes stack from this group. |
void |
setActiveStack(QUndoStack stack)
Sets the active stack of this group to stack. |
java.util.List |
stacks()
Returns a list of stacks in this group. |
void |
undo()
Calls QUndoStack::undo() on the active stack. |
java.lang.String |
undoText()
Returns the value of the active stack's QUndoStack::undoText() . |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Field Detail |
---|
public final QSignalEmitter.Signal1 activeStackChanged
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <com.trolltech.qt.gui.QUndoStack(named: stack)>:
This signal is emitted whenever the active stack of the group changes. This can happen when setActiveStack()
or QUndoStack::setActive()
is called, or when the active stack is removed form the group. stack is the new active stack. If no stack is active, stack is 0.
setActiveStack()
, and QUndoStack::setActive()
.
public final QSignalEmitter.Signal1 canRedoChanged
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Boolean(named: canRedo)>:
This signal is emitted whenever the active stack emits QUndoStack::canRedoChanged()
or the active stack changes.
canRedo is the new state, or false if the active stack is 0.
QUndoStack::canRedoChanged()
, and setActiveStack()
.
public final QSignalEmitter.Signal1 canUndoChanged
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Boolean(named: canUndo)>:
This signal is emitted whenever the active stack emits QUndoStack::canUndoChanged()
or the active stack changes.
canUndo is the new state, or false if the active stack is 0.
QUndoStack::canUndoChanged()
, and setActiveStack()
.
public final QSignalEmitter.Signal1 cleanChanged
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Boolean(named: clean)>:
This signal is emitted whenever the active stack emits QUndoStack::cleanChanged()
or the active stack changes.
clean is the new state, or true if the active stack is 0.
QUndoStack::cleanChanged()
, and setActiveStack()
.
public final QSignalEmitter.Signal1 indexChanged
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.Integer(named: idx)>:
This signal is emitted whenever the active stack emits QUndoStack::indexChanged()
or the active stack changes.
idx is the new current index, or 0 if the active stack is 0.
QUndoStack::indexChanged()
, and setActiveStack()
.
public final QSignalEmitter.Signal1 redoTextChanged
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.String(named: redoText)>:
This signal is emitted whenever the active stack emits QUndoStack::redoTextChanged()
or the active stack changes.
redoText is the new state, or an empty string if the active stack is 0.
QUndoStack::redoTextChanged()
, and setActiveStack()
.
public final QSignalEmitter.Signal1 undoTextChanged
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.String(named: undoText)>:
This signal is emitted whenever the active stack emits QUndoStack::undoTextChanged()
or the active stack changes.
undoText is the new state, or an empty string if the active stack is 0.
QUndoStack::undoTextChanged()
, and setActiveStack()
.
Constructor Detail |
---|
public QUndoGroup()
QUndoGroup
object with parent parent. addStack()
.
public QUndoGroup(QObject parent)
QUndoGroup
object with parent parent. addStack()
.
Method Detail |
---|
public final QUndoStack activeStack()
If none of the stacks are active, or if the group is empty, this function returns 0.
setActiveStack()
, and QUndoStack::setActive()
.
public final void addStack(QUndoStack stack)
QObject
in QUndoStack::QUndoStack(). In this case, the stack is deleted when the group is deleted, in the usual manner of QObjects. removeStack()
, stacks()
, and QUndoStack::QUndoStack().
public final boolean canRedo()
QUndoStack::canRedo()
. If none of the stacks are active, or if the group is empty, this function returns false.
canUndo()
, and setActiveStack()
.
public final boolean canUndo()
QUndoStack::canUndo()
. If none of the stacks are active, or if the group is empty, this function returns false.
canRedo()
, and setActiveStack()
.
public final QAction createRedoAction(QObject parent)
QAction
object with parent parent. Triggering this action will cause a call to QUndoStack::redo()
on the active stack. The text of this action will always be the text of the command which will be redone in the next call to redo()
, prefixed by prefix. If there is no command available for redo, if the group is empty or if none of the stacks are active, this action will be disabled.
If prefix is empty, the default prefix "Undo" is used.
createUndoAction()
, canRedo()
, and QUndoCommand::text()
.
public final QAction createRedoAction(QObject parent, java.lang.String prefix)
QAction
object with parent parent. Triggering this action will cause a call to QUndoStack::redo()
on the active stack. The text of this action will always be the text of the command which will be redone in the next call to redo()
, prefixed by prefix. If there is no command available for redo, if the group is empty or if none of the stacks are active, this action will be disabled.
If prefix is empty, the default prefix "Undo" is used.
createUndoAction()
, canRedo()
, and QUndoCommand::text()
.
public final QAction createUndoAction(QObject parent)
QAction
object with parent parent. Triggering this action will cause a call to QUndoStack::undo()
on the active stack. The text of this action will always be the text of the command which will be undone in the next call to undo()
, prefixed by prefix. If there is no command available for undo, if the group is empty or if none of the stacks are active, this action will be disabled.
If prefix is empty, the default prefix "Undo" is used.
createRedoAction()
, canUndo()
, and QUndoCommand::text()
.
public final QAction createUndoAction(QObject parent, java.lang.String prefix)
QAction
object with parent parent. Triggering this action will cause a call to QUndoStack::undo()
on the active stack. The text of this action will always be the text of the command which will be undone in the next call to undo()
, prefixed by prefix. If there is no command available for undo, if the group is empty or if none of the stacks are active, this action will be disabled.
If prefix is empty, the default prefix "Undo" is used.
createRedoAction()
, canUndo()
, and QUndoCommand::text()
.
public final boolean isClean()
QUndoStack::isClean()
. If none of the stacks are active, or if the group is empty, this function returns true.
setActiveStack()
.
public final void redo()
QUndoStack::redo()
on the active stack. If none of the stacks are active, or if the group is empty, this function does nothing.
undo()
, canRedo()
, and setActiveStack()
.
public final java.lang.String redoText()
QUndoStack::redoText()
. If none of the stacks are active, or if the group is empty, this function returns an empty string.
undoText()
, and setActiveStack()
.
public final void removeStack(QUndoStack stack)
addStack()
, stacks()
, and QUndoStack::~QUndoStack().
public final void setActiveStack(QUndoStack stack)
If the stack is not a member of this group, this function does nothing.
Synonymous with calling QUndoStack::setActive()
on stack.
The actions returned by createUndoAction()
and createRedoAction()
will now behave in the same way as those returned by stack's QUndoStack::createUndoAction()
and QUndoStack::createRedoAction()
.
QUndoStack::setActive()
, and activeStack()
.
public final java.util.List stacks()
addStack()
, and removeStack()
.
public final void undo()
QUndoStack::undo()
on the active stack. If none of the stacks are active, or if the group is empty, this function does nothing.
redo()
, canUndo()
, and setActiveStack()
.
public final java.lang.String undoText()
QUndoStack::undoText()
. If none of the stacks are active, or if the group is empty, this function returns an empty string.
redoText()
, and setActiveStack()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |