Skip to content

PythonQt.Qt.QUndoGroup

QUndoGroup

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

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.

Source: https://doc.qt.io/archives/qt-5.15/qundogroup.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
activeStack function (self) -> Any X.activeStack() -> PythonQt.QtGui.QUndoStack (shared captured text)
activeStackChanged function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.Qt.QUndoGroup.activeStackChanged; argument details are not documented.
addStack function (self, stack: Any) -> None Adds stack to this group. (shared captured text)
blockSignals function (self, b: Any) -> bool X.blockSignals(b) -> bool (shared captured text)
canRedo function (self) -> bool X.canRedo() -> bool (shared captured text)
canRedoChanged function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.Qt.QUndoGroup.canRedoChanged; argument details are not documented.
canUndo function (self) -> bool X.canUndo() -> bool (shared captured text)
canUndoChanged function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.Qt.QUndoGroup.canUndoChanged; argument details are not documented.
childEvent function (self, event: Any) -> Any (shared captured text)
children function (self) -> tuple X.children() -> tuple (shared captured text)
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
cleanChanged function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.Qt.QUndoGroup.cleanChanged; argument details are not documented.
connect function (self, signal: Any, receiver: Any, slot: Any, type: Any) -> bool X.connect(signal, receiver, slot, type) -> bool (shared captured text)
createRedoAction function (self, parent: Any, prefix: str) -> Any X.createRedoAction(parent, prefix) -> PythonQt.QtGui.QAction (shared captured text)
createUndoAction function (self, parent: Any, prefix: str) -> Any X.createUndoAction(parent, prefix) -> PythonQt.QtGui.QAction (shared captured text)
customEvent function (self, event: Any) -> Any (shared captured text)
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
deleteLater function (self) -> Any (shared captured text)
destroyed function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.Qt.QUndoGroup.destroyed; argument details are not documented.
disconnect function (self, signal: Any, receiver: Any, slot: Any) -> bool X.disconnect(signal, receiver, slot) -> bool (shared captured text)
dumpObjectInfo function (self) -> Any (shared captured text)
dumpObjectTree function (self) -> Any (shared captured text)
dynamicPropertyNames function (self) -> Any (shared captured text)
event function (self, event: Any) -> bool X.event(event) -> bool (shared captured text)
eventFilter function (self, watched: Any, event: Any) -> bool X.eventFilter(watched, event) -> bool (shared captured text)
findChild function (self, type: Any, name: Any) -> Any X.findChild(type, name) -> PythonQt.private.QObject (shared captured text)
findChildren function (self, type: Any, name: Any) -> tuple X.findChildren(type, name) -> tuple (shared captured text)
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
indexChanged function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.Qt.QUndoGroup.indexChanged; argument details are not documented.
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
installEventFilter function (self, filterObj: Any) -> Any (shared captured text)
isClean function (self) -> bool X.isClean() -> bool (shared captured text)
isSignalConnected function (self, signal: Any) -> bool X.isSignalConnected(signal) -> bool (shared captured text)
isWidgetType function (self) -> bool X.isWidgetType() -> bool (shared captured text)
isWindowType function (self) -> bool X.isWindowType() -> bool (shared captured text)
killTimer function (self, id: Any) -> Any (shared captured text)
metaObject function (self) -> Any X.metaObject() -> PythonQt.QtCore.QMetaObject (shared captured text)
moveToThread function (self, thread: Any) -> Any (shared captured text)
objectName attribute Any (shared captured text)
objectNameChanged function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.Qt.QUndoGroup.objectNameChanged; argument details are not documented.
parent function (self) -> Any X.parent() -> PythonQt.private.QObject (shared captured text)
property function (self, name: Any) -> Any X.property(name) -> object (shared captured text)
redo function (self) -> None Calls [QUndoStack::redo](https://doc.qt.io/archives/qt-5.15/qundostack.html#redo)() on the active stack. (shared captured text)
redoText function (self) -> str X.redoText() -> str (shared captured text)
redoTextChanged function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.Qt.QUndoGroup.redoTextChanged; argument details are not documented.
removeEventFilter function (self, obj: Any) -> Any (shared captured text)
removeStack function (self, stack: Any) -> None Removes stack from this group. (shared captured text)
sender function (self) -> Any X.sender() -> PythonQt.private.QObject (shared captured text)
senderSignalIndex function (self) -> int X.senderSignalIndex() -> int (shared captured text)
setActiveStack function (self, stack: Any) -> None Sets the active stack of this group to stack. (shared captured text)
setObjectName function (self, name: Any) -> Any (shared captured text)
setParent function (self, parent: Any) -> Any (shared captured text)
setProperty function (self, name: Any, value: Any) -> bool X.setProperty(name, value) -> bool (shared captured text)
signalsBlocked function (self) -> bool X.signalsBlocked() -> bool (shared captured text)
stacks function (self) -> tuple X.stacks() -> tuple (shared captured text)
startTimer function (self, interval: Any, timerType: Any) -> int X.startTimer(interval, timerType) -> int (shared captured text)
thread function (self) -> Any (shared captured text)
timerEvent function (self, event: Any) -> Any (shared captured text)
tr function (self, text: Any, ambig: Any, n: Any) -> str X.tr(text, ambig, n) -> str (shared captured text)
undo function (self) -> None Calls [QUndoStack::undo](https://doc.qt.io/archives/qt-5.15/qundostack.html#undo)() on the active stack. (shared captured text)
undoText function (self) -> str X.undoText() -> str (shared captured text)
undoTextChanged function (self, *args: Any, **kwargs: Any) -> Any Native PythonQt.Qt.QUndoGroup.undoTextChanged; argument details are not documented.