Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 3f684444755c5ad1181cdd5a97348f3c > files > 1675

PyQt4-devel-4.7.4-2.fc14.i686.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QUndoGroup Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="../pyqt4ref.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QUndoGroup Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QUndoGroup class is a group of <a href="qundostack.html">QUndoStack</a> objects. <a href="#details">More...</a></p>
<p>Inherits <a href="qobject.html">QObject</a>.</p><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qundogroup.html#QUndoGroup">__init__</a></b> (<i>self</i>, QObject&#160;<i>parent</i>&#160;=&#160;None)</li><li><div class="fn" />QUndoStack <b><a href="qundogroup.html#activeStack">activeStack</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qundogroup.html#addStack">addStack</a></b> (<i>self</i>, QUndoStack)</li><li><div class="fn" />bool <b><a href="qundogroup.html#canRedo">canRedo</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qundogroup.html#canUndo">canUndo</a></b> (<i>self</i>)</li><li><div class="fn" />QAction <b><a href="qundogroup.html#createRedoAction">createRedoAction</a></b> (<i>self</i>, QObject, QString&#160;<i>prefix</i>&#160;=&#160;QString())</li><li><div class="fn" />QAction <b><a href="qundogroup.html#createUndoAction">createUndoAction</a></b> (<i>self</i>, QObject, QString&#160;<i>prefix</i>&#160;=&#160;QString())</li><li><div class="fn" />bool <b><a href="qundogroup.html#isClean">isClean</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qundogroup.html#redo">redo</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qundogroup.html#redoText">redoText</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qundogroup.html#removeStack">removeStack</a></b> (<i>self</i>, QUndoStack)</li><li><div class="fn" /><b><a href="qundogroup.html#setActiveStack">setActiveStack</a></b> (<i>self</i>, QUndoStack)</li><li><div class="fn" />list-of-QUndoStack <b><a href="qundogroup.html#stacks">stacks</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qundogroup.html#undo">undo</a></b> (<i>self</i>)</li><li><div class="fn" />QString <b><a href="qundogroup.html#undoText">undoText</a></b> (<i>self</i>)</li></ul><h3>Qt Signals</h3><ul><li><div class="fn" />void <b><a href="qundogroup.html#activeStackChanged">activeStackChanged</a></b> (QUndoStack *)</li><li><div class="fn" />void <b><a href="qundogroup.html#canRedoChanged">canRedoChanged</a></b> (bool)</li><li><div class="fn" />void <b><a href="qundogroup.html#canUndoChanged">canUndoChanged</a></b> (bool)</li><li><div class="fn" />void <b><a href="qundogroup.html#cleanChanged">cleanChanged</a></b> (bool)</li><li><div class="fn" />void <b><a href="qundogroup.html#indexChanged">indexChanged</a></b> (int)</li><li><div class="fn" />void <b><a href="qundogroup.html#redoTextChanged">redoTextChanged</a></b> (const QString&amp;)</li><li><div class="fn" />void <b><a href="qundogroup.html#undoTextChanged">undoTextChanged</a></b> (const QString&amp;)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QUndoGroup class is a group of <a href="qundostack.html">QUndoStack</a> objects.</p>
<p>For an overview of the Qt's undo framework, see the <a href="qundo.html">overview</a>.</p>
<p>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.</p>
<p>QUndoGroup is a group of <a href="qundostack.html">QUndoStack</a> objects, one of which may be active. It has an <a href="qundogroup.html#undo">undo</a>() and <a href="qundogroup.html#redo">redo</a>() slot, which calls <a href="qundostack.html#undo">QUndoStack.undo</a>() and <a href="qundostack.html#redo">QUndoStack.redo</a>() for the active stack. It also has the functions <a href="qundogroup.html#createUndoAction">createUndoAction</a>() and <a href="qundogroup.html#createRedoAction">createRedoAction</a>(). The actions returned by these functions behave in the same way as those returned by <a href="qundostack.html#createUndoAction">QUndoStack.createUndoAction</a>() and <a href="qundostack.html#createRedoAction">QUndoStack.createRedoAction</a>() of the active stack.</p>
<p>Stacks are added to a group with <a href="qundogroup.html#addStack">addStack</a>() and removed with <a href="qundogroup.html#removeStack">removeStack</a>(). A stack is implicitly added to a group when it is created with the group as its parent <a href="qobject.html">QObject</a>.</p>
<p>It is the programmer's responsibility to specify which stack is active by calling <a href="qundostack.html#active-prop">QUndoStack.setActive</a>(), usually when the associated document window receives focus. The active stack may also be set with <a href="qundogroup.html#setActiveStack">setActiveStack</a>(), and is returned by <a href="qundogroup.html#activeStack">activeStack</a>().</p>
<p>When a stack is added to a group using <a href="qundogroup.html#addStack">addStack</a>(), 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.</p>
<p>A QUndoGroup is also useful in conjunction with <a href="qundoview.html">QUndoView</a>. If a <a href="qundoview.html">QUndoView</a> is set to watch a group using <a href="qundoview.html#setGroup">QUndoView.setGroup</a>(), it will update itself to display the active stack.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QUndoGroup" />QUndoGroup.__init__ (<i>self</i>, <a href="qobject.html">QObject</a>&#160;<i>parent</i>&#160;=&#160;None)</h3><p>The <i>parent</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Creates an empty <a href="qundogroup.html">QUndoGroup</a> object with parent <i>parent</i>.</p>
<p>See also <a href="qundogroup.html#addStack">addStack</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/~QUndoGroup" />
<h3 class="fn"><a name="activeStack" /><a href="qundostack.html">QUndoStack</a> QUndoGroup.activeStack (<i>self</i>)</h3><p>Returns the active stack of this group.</p>
<p>If none of the stacks are active, or if the group is empty, this function returns 0.</p>
<p>See also <a href="qundogroup.html#setActiveStack">setActiveStack</a>() and <a href="qundostack.html#active-prop">QUndoStack.setActive</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/activeStackChanged" />
<h3 class="fn"><a name="addStack" />QUndoGroup.addStack (<i>self</i>, <a href="qundostack.html">QUndoStack</a>)</h3><p>Adds <i>stack</i> to this group. The group does not take ownership of the stack. Another way of adding a stack to a group is by specifying the group as the stack's parent <a href="qobject.html">QObject</a> in <a href="qundostack.html#QUndoStack">QUndoStack.QUndoStack</a>(). In this case, the stack is deleted when the group is deleted, in the usual manner of QObjects.</p>
<p>See also <a href="qundogroup.html#removeStack">removeStack</a>(), <a href="qundogroup.html#stacks">stacks</a>(), and <a href="qundostack.html#QUndoStack">QUndoStack.QUndoStack</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/canRedo" />
<h3 class="fn"><a name="canRedo" />bool QUndoGroup.canRedo (<i>self</i>)</h3><p>Returns the value of the active stack's <a href="qundostack.html#canRedo">QUndoStack.canRedo</a>().</p>
<p>If none of the stacks are active, or if the group is empty, this function returns false.</p>
<p>See also <a href="qundogroup.html#canUndo">canUndo</a>() and <a href="qundogroup.html#setActiveStack">setActiveStack</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/canRedoChanged" />
<h3 class="fn"><a name="canUndo" />bool QUndoGroup.canUndo (<i>self</i>)</h3><p>Returns the value of the active stack's <a href="qundostack.html#canUndo">QUndoStack.canUndo</a>().</p>
<p>If none of the stacks are active, or if the group is empty, this function returns false.</p>
<p>See also <a href="qundogroup.html#canRedo">canRedo</a>() and <a href="qundogroup.html#setActiveStack">setActiveStack</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/canUndoChanged" />
<h3 class="fn"><a name="createRedoAction" /><a href="qaction.html">QAction</a> QUndoGroup.createRedoAction (<i>self</i>, <a href="qobject.html">QObject</a>, QString&#160;<i>prefix</i>&#160;=&#160;QString())</h3><p>The <i>QObject</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Creates an redo <a href="qaction.html">QAction</a> object with parent <i>parent</i>.</p>
<p>Triggering this action will cause a call to <a href="qundostack.html#redo">QUndoStack.redo</a>() 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 <a href="qundogroup.html#redo">redo</a>(), prefixed by <i>prefix</i>. 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.</p>
<p>If <i>prefix</i> is empty, the default prefix "Undo" is used.</p>
<p>See also <a href="qundogroup.html#createUndoAction">createUndoAction</a>(), <a href="qundogroup.html#canRedo">canRedo</a>(), and <a href="qundocommand.html#text">QUndoCommand.text</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/createUndoAction" />
<h3 class="fn"><a name="createUndoAction" /><a href="qaction.html">QAction</a> QUndoGroup.createUndoAction (<i>self</i>, <a href="qobject.html">QObject</a>, QString&#160;<i>prefix</i>&#160;=&#160;QString())</h3><p>The <i>QObject</i> argument, if not None, causes <i>self</i> to be owned by Qt instead of PyQt.</p><p>Creates an undo <a href="qaction.html">QAction</a> object with parent <i>parent</i>.</p>
<p>Triggering this action will cause a call to <a href="qundostack.html#undo">QUndoStack.undo</a>() 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 <a href="qundogroup.html#undo">undo</a>(), prefixed by <i>prefix</i>. 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.</p>
<p>If <i>prefix</i> is empty, the default prefix "Undo" is used.</p>
<p>See also <a href="qundogroup.html#createRedoAction">createRedoAction</a>(), <a href="qundogroup.html#canUndo">canUndo</a>(), and <a href="qundocommand.html#text">QUndoCommand.text</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/indexChanged" />
<h3 class="fn"><a name="isClean" />bool QUndoGroup.isClean (<i>self</i>)</h3><p>Returns the value of the active stack's <a href="qundostack.html#isClean">QUndoStack.isClean</a>().</p>
<p>If none of the stacks are active, or if the group is empty, this function returns true.</p>
<p>See also <a href="qundogroup.html#setActiveStack">setActiveStack</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/redo" />
<h3 class="fn"><a name="redo" />QUndoGroup.redo (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void redo()</tt>.</p><p>Calls <a href="qundostack.html#redo">QUndoStack.redo</a>() on the active stack.</p>
<p>If none of the stacks are active, or if the group is empty, this function does nothing.</p>
<p>See also <a href="qundogroup.html#undo">undo</a>(), <a href="qundogroup.html#canRedo">canRedo</a>(), and <a href="qundogroup.html#setActiveStack">setActiveStack</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/redoText" />
<h3 class="fn"><a name="redoText" />QString QUndoGroup.redoText (<i>self</i>)</h3><p>Returns the value of the active stack's <a href="qundostack.html#redoText">QUndoStack.redoText</a>().</p>
<p>If none of the stacks are active, or if the group is empty, this function returns an empty string.</p>
<p>See also <a href="qundogroup.html#undoText">undoText</a>() and <a href="qundogroup.html#setActiveStack">setActiveStack</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/redoTextChanged" />
<h3 class="fn"><a name="removeStack" />QUndoGroup.removeStack (<i>self</i>, <a href="qundostack.html">QUndoStack</a>)</h3><p>Removes <i>stack</i> from this group. If the stack was the active stack in the group, the active stack becomes 0.</p>
<p>See also <a href="qundogroup.html#addStack">addStack</a>(), <a href="qundogroup.html#stacks">stacks</a>(), and <a href="qundostack.html#dtor.QUndoStack">QUndoStack.~QUndoStack</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/setActiveStack" />
<h3 class="fn"><a name="setActiveStack" />QUndoGroup.setActiveStack (<i>self</i>, <a href="qundostack.html">QUndoStack</a>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void setActiveStack(QUndoStack *)</tt>.</p><p>Sets the active stack of this group to <i>stack</i>.</p>
<p>If the stack is not a member of this group, this function does nothing.</p>
<p>Synonymous with calling <a href="qundostack.html#active-prop">QUndoStack.setActive</a>() on <i>stack</i>.</p>
<p>The actions returned by <a href="qundogroup.html#createUndoAction">createUndoAction</a>() and <a href="qundogroup.html#createRedoAction">createRedoAction</a>() will now behave in the same way as those returned by <i>stack</i>'s <a href="qundostack.html#createUndoAction">QUndoStack.createUndoAction</a>() and <a href="qundostack.html#createRedoAction">QUndoStack.createRedoAction</a>().</p>
<p>See also <a href="qundostack.html#active-prop">QUndoStack.setActive</a>() and <a href="qundogroup.html#activeStack">activeStack</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/stacks" />
<h3 class="fn"><a name="stacks" />list-of-QUndoStack QUndoGroup.stacks (<i>self</i>)</h3><p>Returns a list of stacks in this group.</p>
<p>See also <a href="qundogroup.html#addStack">addStack</a>() and <a href="qundogroup.html#removeStack">removeStack</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/undo" />
<h3 class="fn"><a name="undo" />QUndoGroup.undo (<i>self</i>)</h3><p>This method is also a Qt slot with the C++ signature <tt>void undo()</tt>.</p><p>Calls <a href="qundostack.html#undo">QUndoStack.undo</a>() on the active stack.</p>
<p>If none of the stacks are active, or if the group is empty, this function does nothing.</p>
<p>See also <a href="qundogroup.html#redo">redo</a>(), <a href="qundogroup.html#canUndo">canUndo</a>(), and <a href="qundogroup.html#setActiveStack">setActiveStack</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/undoText" />
<h3 class="fn"><a name="undoText" />QString QUndoGroup.undoText (<i>self</i>)</h3><p>Returns the value of the active stack's <a href="qundostack.html#undoText">QUndoStack.undoText</a>().</p>
<p>If none of the stacks are active, or if the group is empty, this function returns an empty string.</p>
<p>See also <a href="qundogroup.html#redoText">redoText</a>() and <a href="qundogroup.html#setActiveStack">setActiveStack</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/undoTextChanged" />
<hr /><h2>Qt Signal Documentation</h2><h3 class="fn"><a name="activeStackChanged" />void activeStackChanged (QUndoStack *)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the active stack of the group changes. This can happen when <a href="qundogroup.html#setActiveStack">setActiveStack</a>() or <a href="qundostack.html#active-prop">QUndoStack.setActive</a>() is called, or when the active stack is removed form the group. <i>stack</i> is the new active stack. If no stack is active, <i>stack</i> is 0.</p>
<p>See also <a href="qundogroup.html#setActiveStack">setActiveStack</a>() and <a href="qundostack.html#active-prop">QUndoStack.setActive</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/addStack" />
<h3 class="fn"><a name="canRedoChanged" />void canRedoChanged (bool)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the active stack emits <a href="qundostack.html#canRedoChanged">QUndoStack.canRedoChanged</a>() or the active stack changes.</p>
<p><i>canRedo</i> is the new state, or false if the active stack is 0.</p>
<p>See also <a href="qundostack.html#canRedoChanged">QUndoStack.canRedoChanged</a>() and <a href="qundogroup.html#setActiveStack">setActiveStack</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/canUndo" />
<h3 class="fn"><a name="canUndoChanged" />void canUndoChanged (bool)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the active stack emits <a href="qundostack.html#canUndoChanged">QUndoStack.canUndoChanged</a>() or the active stack changes.</p>
<p><i>canUndo</i> is the new state, or false if the active stack is 0.</p>
<p>See also <a href="qundostack.html#canUndoChanged">QUndoStack.canUndoChanged</a>() and <a href="qundogroup.html#setActiveStack">setActiveStack</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/cleanChanged" />
<h3 class="fn"><a name="cleanChanged" />void cleanChanged (bool)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the active stack emits <a href="qundostack.html#cleanChanged">QUndoStack.cleanChanged</a>() or the active stack changes.</p>
<p><i>clean</i> is the new state, or true if the active stack is 0.</p>
<p>See also <a href="qundostack.html#cleanChanged">QUndoStack.cleanChanged</a>() and <a href="qundogroup.html#setActiveStack">setActiveStack</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/createRedoAction" />
<h3 class="fn"><a name="indexChanged" />void indexChanged (int)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the active stack emits <a href="qundostack.html#indexChanged">QUndoStack.indexChanged</a>() or the active stack changes.</p>
<p><i>idx</i> is the new current index, or 0 if the active stack is 0.</p>
<p>See also <a href="qundostack.html#indexChanged">QUndoStack.indexChanged</a>() and <a href="qundogroup.html#setActiveStack">setActiveStack</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/isClean" />
<h3 class="fn"><a name="redoTextChanged" />void redoTextChanged (const QString&amp;)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the active stack emits <a href="qundostack.html#redoTextChanged">QUndoStack.redoTextChanged</a>() or the active stack changes.</p>
<p><i>redoText</i> is the new state, or an empty string if the active stack is 0.</p>
<p>See also <a href="qundostack.html#redoTextChanged">QUndoStack.redoTextChanged</a>() and <a href="qundogroup.html#setActiveStack">setActiveStack</a>().</p>
<a name="//apple_ref/cpp/instm/QUndoGroup/removeStack" />
<h3 class="fn"><a name="undoTextChanged" />void undoTextChanged (const QString&amp;)</h3><p>This is the default overload of this signal.</p><p>This signal is emitted whenever the active stack emits <a href="qundostack.html#undoTextChanged">QUndoStack.undoTextChanged</a>() or the active stack changes.</p>
<p><i>undoText</i> is the new state, or an empty string if the active stack is 0.</p>
<p>See also <a href="qundostack.html#undoTextChanged">QUndoStack.undoTextChanged</a>() and <a href="qundogroup.html#setActiveStack">setActiveStack</a>().</p>
<p /><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.7.4 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2010</td><td align="right" width="25%">Qt&#160;4.6.3</td></tr></table></div></address></body></html>