Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > a6711891ce757817bba854bf3f25205a > files > 2439

qtjambi-doc-4.3.3-3mdv2008.1.i586.rpm

<class name="QUndoStack" doc="/**
&lt;p&gt;The &lt;a href=&quot;QUndoStack.html#QUndoStack(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QUndoStack&lt;/tt&gt;&lt;/a&gt; class is a stack of &lt;a href=&quot;QUndoCommand.html&quot;&gt;&lt;tt&gt;QUndoCommand&lt;/tt&gt;&lt;/a&gt; objects.&lt;/p&gt;
&lt;p&gt;For an overview of Qt's Undo Framework, see the &lt;a href=&quot;%2E%2E/qundo.html&quot;&gt;overview document&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;An undo stack maintains a stack of commands that have been applied to a document.&lt;/p&gt;
&lt;p&gt;New commands are pushed on the stack using &lt;a href=&quot;QUndoStack.html#push(com.trolltech.qt.gui.QUndoCommand)&quot;&gt;&lt;tt&gt;push&lt;/tt&gt;&lt;/a&gt;. Commands can be undone and redone using &lt;a href=&quot;QUndoStack.html#undo()&quot;&gt;&lt;tt&gt;undo&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QUndoStack.html#redo()&quot;&gt;&lt;tt&gt;redo&lt;/tt&gt;&lt;/a&gt;, or by triggering the actions returned by &lt;a href=&quot;QUndoStack.html#createUndoAction(com.trolltech.qt.core.QObject, java.lang.String)&quot;&gt;&lt;tt&gt;createUndoAction&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QUndoStack.html#createRedoAction(com.trolltech.qt.core.QObject, java.lang.String)&quot;&gt;&lt;tt&gt;createRedoAction&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QUndoStack.html#QUndoStack(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QUndoStack&lt;/tt&gt;&lt;/a&gt; keeps track of the &lt;tt&gt;current&lt;/tt&gt; command. This is the command which will be executed by the next call to &lt;a href=&quot;QUndoStack.html#redo()&quot;&gt;&lt;tt&gt;redo&lt;/tt&gt;&lt;/a&gt;. The index of this command is returned by &lt;a href=&quot;QUndoStack.html#index()&quot;&gt;&lt;tt&gt;index&lt;/tt&gt;&lt;/a&gt;. The state of the edited object can be rolled forward or back using &lt;a href=&quot;QUndoStack.html#setIndex(int)&quot;&gt;&lt;tt&gt;setIndex&lt;/tt&gt;&lt;/a&gt;. If the top-most command on the stack has already been redone, &lt;a href=&quot;QUndoStack.html#index()&quot;&gt;&lt;tt&gt;index&lt;/tt&gt;&lt;/a&gt; is equal to &lt;a href=&quot;QUndoStack.html#count()&quot;&gt;&lt;tt&gt;count&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;QUndoStack.html#QUndoStack(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QUndoStack&lt;/tt&gt;&lt;/a&gt; provides support for undo and redo actions, command compression, command macros, and supports the concept of a &lt;i&gt;clean state&lt;/i&gt;.&lt;/p&gt;
&lt;a name=&quot;undo-and-redo-actions&quot;&gt;&lt;/a&gt;
&lt;h3&gt;Undo and Redo Actions&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;QUndoStack.html#QUndoStack(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QUndoStack&lt;/tt&gt;&lt;/a&gt; provides convenient undo and redo &lt;a href=&quot;QAction.html&quot;&gt;&lt;tt&gt;QAction&lt;/tt&gt;&lt;/a&gt; objects, which can be inserted into a menu or a toolbar. When commands are undone or redone, &lt;a href=&quot;QUndoStack.html#QUndoStack(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QUndoStack&lt;/tt&gt;&lt;/a&gt; updates the text properties of these actions to reflect what change they will trigger. The actions are also disabled when no command is available for undo or redo. These actions are returned by QUndoStack::createUndoAction() and QUndoStack::createRedoAction().&lt;/p&gt;
&lt;a name=&quot;command-compression-and-macros&quot;&gt;&lt;/a&gt;
&lt;h3&gt;Command Compression and Macros&lt;/h3&gt;
&lt;p&gt;Command compression is useful when several commands can be compressed into a single command that can be undone and redone in a single operation. For example, when a user types a character in a text editor, a new command is created. This command inserts the character into the document at the cursor position. However, it is more convenient for the user to be able to undo or redo typing of whole words, sentences, or paragraphs. Command compression allows these single-character commands to be merged into a single command which inserts or deletes sections of text. For more information, see QUndoCommand::mergeWith() and &lt;a href=&quot;QUndoStack.html#push(com.trolltech.qt.gui.QUndoCommand)&quot;&gt;&lt;tt&gt;push&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A command macro is a sequence of commands, all of which are undone and redone in one go. Command macros are created by giving a command a list of child commands. Undoing or redoing the parent command will cause the child commands to be undone or redone. Command macros may be created explicitly by specifying a parent in the &lt;a href=&quot;QUndoCommand.html&quot;&gt;&lt;tt&gt;QUndoCommand&lt;/tt&gt;&lt;/a&gt; constructor, or by using the convenience functions &lt;a href=&quot;QUndoStack.html#beginMacro(java.lang.String)&quot;&gt;&lt;tt&gt;beginMacro&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QUndoStack.html#endMacro()&quot;&gt;&lt;tt&gt;endMacro&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Although command compression and macros appear to have the same effect to the user, they often have different uses in an application. Commands that perform small changes to a document may be usefully compressed if there is no need to individually record them, and if only larger changes are relevant to the user. However, for commands that need to be recorded individually, or those that cannot be compressed, it is useful to use macros to provide a more convenient user experience while maintaining a record of each command.&lt;/p&gt;
&lt;a name=&quot;clean-state&quot;&gt;&lt;/a&gt;
&lt;h3&gt;Clean State&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;QUndoStack.html#QUndoStack(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QUndoStack&lt;/tt&gt;&lt;/a&gt; supports the concept of a clean state. When the document is saved to disk, the stack can be marked as clean using &lt;a href=&quot;QUndoStack.html#setClean()&quot;&gt;&lt;tt&gt;setClean&lt;/tt&gt;&lt;/a&gt;. Whenever the stack returns to this state through undoing and redoing commands, it emits the signal &lt;a href=&quot;QUndoStack.html#cleanChanged(boolean)&quot;&gt;&lt;tt&gt;cleanChanged&lt;/tt&gt;&lt;/a&gt;. This signal is also emitted when the stack leaves the clean state. This signal is usually used to enable and disable the save actions in the application, and to update the document's title to reflect that it contains unsaved changes.&lt;/p&gt;

@see &lt;a href=&quot;QUndoCommand.html&quot;&gt;&lt;tt&gt;QUndoCommand&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUndoView.html&quot;&gt;&lt;tt&gt;QUndoView&lt;/tt&gt;&lt;/a&gt; */">
    <signal name="protected final void canRedoChanged(boolean canRedo)" doc="/**
&lt;p&gt;This signal is emitted whenever the value of &lt;a href=&quot;QUndoStack.html#canRedo()&quot;&gt;&lt;tt&gt;canRedo&lt;/tt&gt;&lt;/a&gt; changes. It is used to enable or disable the redo action returned by &lt;a href=&quot;QUndoStack.html#createRedoAction(com.trolltech.qt.core.QObject, java.lang.String)&quot;&gt;&lt;tt&gt;createRedoAction&lt;/tt&gt;&lt;/a&gt;. &lt;tt&gt;canRedo&lt;/tt&gt; specifies the new value.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(boolean canRedo)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void canUndoChanged(boolean canUndo)" doc="/**
&lt;p&gt;This signal is emitted whenever the value of &lt;a href=&quot;QUndoStack.html#canUndo()&quot;&gt;&lt;tt&gt;canUndo&lt;/tt&gt;&lt;/a&gt; changes. It is used to enable or disable the undo action returned by &lt;a href=&quot;QUndoStack.html#createUndoAction(com.trolltech.qt.core.QObject, java.lang.String)&quot;&gt;&lt;tt&gt;createUndoAction&lt;/tt&gt;&lt;/a&gt;. &lt;tt&gt;canUndo&lt;/tt&gt; specifies the new value.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(boolean canUndo)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void cleanChanged(boolean clean)" doc="/**
&lt;p&gt;This signal is emitted whenever the stack enters or leaves the clean state. If &lt;tt&gt;clean&lt;/tt&gt; is true, the stack is in a clean state; otherwise this signal indicates that it has left the clean state.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(boolean clean)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QUndoStack.html#isClean()&quot;&gt;&lt;tt&gt;isClean&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QUndoStack.html#setClean()&quot;&gt;&lt;tt&gt;setClean&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void indexChanged(int idx)" doc="/**
&lt;p&gt;This signal is emitted whenever a command modifies the state of the document. This happens when a command is undone or redone. When a macro command is undone or redone, or &lt;a href=&quot;QUndoStack.html#setIndex(int)&quot;&gt;&lt;tt&gt;setIndex&lt;/tt&gt;&lt;/a&gt; is called, this signal is emitted only once.&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;idx&lt;/tt&gt; specifies the index of the current command, ie. the command which will be executed on the next call to &lt;a href=&quot;QUndoStack.html#redo()&quot;&gt;&lt;tt&gt;redo&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(int idx)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;See Also:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;a href=&quot;QUndoStack.html#index()&quot;&gt;&lt;tt&gt;index&lt;/tt&gt;&lt;/a&gt;, &lt;a href=&quot;QUndoStack.html#setIndex(int)&quot;&gt;&lt;tt&gt;setIndex&lt;/tt&gt;&lt;/a&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void redoTextChanged(java.lang.String redoText)" doc="/**
&lt;p&gt;This signal is emitted whenever the value of &lt;a href=&quot;QUndoStack.html#redoText()&quot;&gt;&lt;tt&gt;redoText&lt;/tt&gt;&lt;/a&gt; changes. It is used to update the text property of the redo action returned by &lt;a href=&quot;QUndoStack.html#createRedoAction(com.trolltech.qt.core.QObject, java.lang.String)&quot;&gt;&lt;tt&gt;createRedoAction&lt;/tt&gt;&lt;/a&gt;. &lt;tt&gt;redoText&lt;/tt&gt; specifies the new text.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(java.lang.String redoText)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <signal name="protected final void undoTextChanged(java.lang.String undoText)" doc="/**
&lt;p&gt;This signal is emitted whenever the value of &lt;a href=&quot;QUndoStack.html#undoText()&quot;&gt;&lt;tt&gt;undoText&lt;/tt&gt;&lt;/a&gt; changes. It is used to update the text property of the undo action returned by &lt;a href=&quot;QUndoStack.html#createUndoAction(com.trolltech.qt.core.QObject, java.lang.String)&quot;&gt;&lt;tt&gt;createUndoAction&lt;/tt&gt;&lt;/a&gt;. &lt;tt&gt;undoText&lt;/tt&gt; specifies the new text.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;b&gt;Compatible Slot Signatures:&lt;/b&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot(java.lang.String undoText)&lt;/tt&gt;&lt;/dd&gt;
&lt;dd&gt;&lt;tt&gt;void mySlot()&lt;/tt&gt;&lt;/dd&gt;
&lt;/dl&gt;
 */"/>
    <method name="public QUndoStack(com.trolltech.qt.core.QObject parent)" doc="/**
&lt;p&gt;Constructs an empty undo stack with the parent &lt;tt&gt;parent&lt;/tt&gt;. The stack will initally be in the clean state. If &lt;tt&gt;parent&lt;/tt&gt; is a &lt;a href=&quot;QUndoGroup.html&quot;&gt;&lt;tt&gt;QUndoGroup&lt;/tt&gt;&lt;/a&gt; object, the stack is automatically added to the group.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#push(com.trolltech.qt.gui.QUndoCommand)&quot;&gt;&lt;tt&gt;push&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public QUndoStack()" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QUndoStack.html#QUndoStack(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QUndoStack&lt;/tt&gt;&lt;/a&gt;(0). */"/>
    <method name="public final void beginMacro(java.lang.String text)" doc="/**
&lt;p&gt;Begins composition of a macro command with the given &lt;tt&gt;text&lt;/tt&gt; description.&lt;/p&gt;
&lt;p&gt;An empty command described by the specified &lt;tt&gt;text&lt;/tt&gt; is pushed on the stack. Any subsequent commands pushed on the stack will be appended to the empty command's children until &lt;a href=&quot;QUndoStack.html#endMacro()&quot;&gt;&lt;tt&gt;endMacro&lt;/tt&gt;&lt;/a&gt; is called.&lt;/p&gt;
&lt;p&gt;Calls to &lt;a href=&quot;QUndoStack.html#beginMacro(java.lang.String)&quot;&gt;&lt;tt&gt;beginMacro&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QUndoStack.html#endMacro()&quot;&gt;&lt;tt&gt;endMacro&lt;/tt&gt;&lt;/a&gt; may be nested, but every call to &lt;a href=&quot;QUndoStack.html#beginMacro(java.lang.String)&quot;&gt;&lt;tt&gt;beginMacro&lt;/tt&gt;&lt;/a&gt; must have a matching call to &lt;a href=&quot;QUndoStack.html#endMacro()&quot;&gt;&lt;tt&gt;endMacro&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;While a macro is composed, the stack is disabled. This means that:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;QUndoStack.html#indexChanged(int)&quot;&gt;&lt;tt&gt;indexChanged&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QUndoStack.html#cleanChanged(boolean)&quot;&gt;&lt;tt&gt;cleanChanged&lt;/tt&gt;&lt;/a&gt; are not emitted,&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;QUndoStack.html#canUndo()&quot;&gt;&lt;tt&gt;canUndo&lt;/tt&gt;&lt;/a&gt; and &lt;a href=&quot;QUndoStack.html#canRedo()&quot;&gt;&lt;tt&gt;canRedo&lt;/tt&gt;&lt;/a&gt; return false,&lt;/li&gt;
&lt;li&gt;calling &lt;a href=&quot;QUndoStack.html#undo()&quot;&gt;&lt;tt&gt;undo&lt;/tt&gt;&lt;/a&gt; or &lt;a href=&quot;QUndoStack.html#redo()&quot;&gt;&lt;tt&gt;redo&lt;/tt&gt;&lt;/a&gt; has no effect,&lt;/li&gt;
&lt;li&gt;the undo/redo actions are disabled.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The stack becomes enabled and appropriate signals are emitted when &lt;a href=&quot;QUndoStack.html#endMacro()&quot;&gt;&lt;tt&gt;endMacro&lt;/tt&gt;&lt;/a&gt; is called for the outermost macro.&lt;/p&gt;
&lt;pre&gt;    stack.beginMacro(&amp;quot;insert red text&amp;quot;);
    stack.push(new InsertText(document, idx, text));
    stack.push(new SetColor(document, idx, text.length(), Qt::red));
    stack.endMacro(); &lt;span class=&quot;comment&quot;&gt;// indexChanged() is emitted&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This code is equivalent to:&lt;/p&gt;
&lt;pre&gt;    QUndoCommand *insertRed = new QUndoCommand(); &lt;span class=&quot;comment&quot;&gt;// an empty command&lt;/span&gt;
    insertRed-&amp;gt;setText(&amp;quot;insert red text&amp;quot;);

    new InsertText(document, idx, text, insertRed); &lt;span class=&quot;comment&quot;&gt;// becomes child of insertRed&lt;/span&gt;
    new SetColor(document, idx, text.length(), Qt::red, insertRed);

    stack.push(insertRed);&lt;/pre&gt;

@see &lt;a href=&quot;QUndoStack.html#endMacro()&quot;&gt;&lt;tt&gt;endMacro&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final boolean canRedo()" doc="/**
&lt;p&gt;Returns true if there is a command available for redo; otherwise returns false.&lt;/p&gt;
&lt;p&gt;This function returns false if the stack is empty or if the top command on the stack has already been redone.&lt;/p&gt;
&lt;p&gt;Synonymous with &lt;a href=&quot;QUndoStack.html#index()&quot;&gt;&lt;tt&gt;index&lt;/tt&gt;&lt;/a&gt; == &lt;a href=&quot;QUndoStack.html#count()&quot;&gt;&lt;tt&gt;count&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#index()&quot;&gt;&lt;tt&gt;index&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUndoStack.html#canUndo()&quot;&gt;&lt;tt&gt;canUndo&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final boolean canUndo()" doc="/**
&lt;p&gt;Returns true if there is a command available for undo; otherwise returns false.&lt;/p&gt;
&lt;p&gt;This function returns false if the stack is empty, or if the bottom command on the stack has already been undone.&lt;/p&gt;
&lt;p&gt;Synonymous with &lt;a href=&quot;QUndoStack.html#index()&quot;&gt;&lt;tt&gt;index&lt;/tt&gt;&lt;/a&gt; == 0.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#index()&quot;&gt;&lt;tt&gt;index&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUndoStack.html#canRedo()&quot;&gt;&lt;tt&gt;canRedo&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int cleanIndex()" doc="/**
&lt;p&gt;Returns the clean index. This is the index at which &lt;a href=&quot;QUndoStack.html#setClean()&quot;&gt;&lt;tt&gt;setClean&lt;/tt&gt;&lt;/a&gt; was called.&lt;/p&gt;
&lt;p&gt;A stack may not have a clean index. This happens if a document is saved, some commands are undone, then a new command is pushed. Since &lt;a href=&quot;QUndoStack.html#push(com.trolltech.qt.gui.QUndoCommand)&quot;&gt;&lt;tt&gt;push&lt;/tt&gt;&lt;/a&gt; deletes all the undone commands before pushing the new command, the stack can't return to the clean state again. In this case, this function returns -1.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#isClean()&quot;&gt;&lt;tt&gt;isClean&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUndoStack.html#setClean()&quot;&gt;&lt;tt&gt;setClean&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void clear()" doc="/**
&lt;p&gt;Clears the command stack by deleting all commands on it, and returns the stack to the clean state.&lt;/p&gt;
&lt;p&gt;Commands are not undone or redone; the state of the edited object remains unchanged.&lt;/p&gt;
&lt;p&gt;This function is usually used when the contents of the document are abandoned.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#QUndoStack(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QUndoStack&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int count()" doc="/**
&lt;p&gt;Returns the number of commands on the stack. Macro commands are counted as one command.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#index()&quot;&gt;&lt;tt&gt;index&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUndoStack.html#setIndex(int)&quot;&gt;&lt;tt&gt;setIndex&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final com.trolltech.qt.gui.QAction createRedoAction(com.trolltech.qt.core.QObject parent, java.lang.String prefix)" doc="/**
&lt;p&gt;Creates an redo &lt;a href=&quot;QAction.html&quot;&gt;&lt;tt&gt;QAction&lt;/tt&gt;&lt;/a&gt; object with the given &lt;tt&gt;parent&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;Triggering this action will cause a call to &lt;a href=&quot;QUndoStack.html#redo()&quot;&gt;&lt;tt&gt;redo&lt;/tt&gt;&lt;/a&gt;. The text of this action is the text of the command which will be redone in the next call to &lt;a href=&quot;QUndoStack.html#redo()&quot;&gt;&lt;tt&gt;redo&lt;/tt&gt;&lt;/a&gt;, prefixed by the specified &lt;tt&gt;prefix&lt;/tt&gt;. If there is no command available for redo, this action will be disabled.&lt;/p&gt;
&lt;p&gt;If &lt;tt&gt;prefix&lt;/tt&gt; is empty, the default prefix &amp;quot;Redo&amp;quot; is used.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#createUndoAction(com.trolltech.qt.core.QObject, java.lang.String)&quot;&gt;&lt;tt&gt;createUndoAction&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUndoStack.html#canRedo()&quot;&gt;&lt;tt&gt;canRedo&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;QUndoCommand::text&lt;/tt&gt; */"/>
    <method name="public final com.trolltech.qt.gui.QAction createRedoAction(com.trolltech.qt.core.QObject parent)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QUndoStack.html#createRedoAction(com.trolltech.qt.core.QObject, java.lang.String)&quot;&gt;&lt;tt&gt;createRedoAction&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;parent&lt;/tt&gt;, QString()). */"/>
    <method name="public final com.trolltech.qt.gui.QAction createUndoAction(com.trolltech.qt.core.QObject parent, java.lang.String prefix)" doc="/**
&lt;p&gt;Creates an undo &lt;a href=&quot;QAction.html&quot;&gt;&lt;tt&gt;QAction&lt;/tt&gt;&lt;/a&gt; object with the given &lt;tt&gt;parent&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;Triggering this action will cause a call to &lt;a href=&quot;QUndoStack.html#undo()&quot;&gt;&lt;tt&gt;undo&lt;/tt&gt;&lt;/a&gt;. The text of this action is the text of the command which will be undone in the next call to &lt;a href=&quot;QUndoStack.html#undo()&quot;&gt;&lt;tt&gt;undo&lt;/tt&gt;&lt;/a&gt;, prefixed by the specified &lt;tt&gt;prefix&lt;/tt&gt;. If there is no command available for undo, this action will be disabled.&lt;/p&gt;
&lt;p&gt;If &lt;tt&gt;prefix&lt;/tt&gt; is empty, the default prefix &amp;quot;Undo&amp;quot; is used.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#createRedoAction(com.trolltech.qt.core.QObject, java.lang.String)&quot;&gt;&lt;tt&gt;createRedoAction&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUndoStack.html#canUndo()&quot;&gt;&lt;tt&gt;canUndo&lt;/tt&gt;&lt;/a&gt;
@see &lt;tt&gt;QUndoCommand::text&lt;/tt&gt; */"/>
    <method name="public final com.trolltech.qt.gui.QAction createUndoAction(com.trolltech.qt.core.QObject parent)" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QUndoStack.html#createUndoAction(com.trolltech.qt.core.QObject, java.lang.String)&quot;&gt;&lt;tt&gt;createUndoAction&lt;/tt&gt;&lt;/a&gt;(&lt;tt&gt;parent&lt;/tt&gt;, QString()). */"/>
    <method name="public final void endMacro()" doc="/**
&lt;p&gt;Ends composition of a macro command.&lt;/p&gt;
&lt;p&gt;If this is the outermost macro in a set nested macros, this function emits &lt;a href=&quot;QUndoStack.html#indexChanged(int)&quot;&gt;&lt;tt&gt;indexChanged&lt;/tt&gt;&lt;/a&gt; once for the entire macro command.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#beginMacro(java.lang.String)&quot;&gt;&lt;tt&gt;beginMacro&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int index()" doc="/**
&lt;p&gt;Returns the index of the current command. This is the command that will be executed on the next call to &lt;a href=&quot;QUndoStack.html#redo()&quot;&gt;&lt;tt&gt;redo&lt;/tt&gt;&lt;/a&gt;. It is not always the top-most command on the stack, since a number of commands may have been undone.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#setIndex(int)&quot;&gt;&lt;tt&gt;setIndex&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUndoStack.html#undo()&quot;&gt;&lt;tt&gt;undo&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUndoStack.html#redo()&quot;&gt;&lt;tt&gt;redo&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUndoStack.html#count()&quot;&gt;&lt;tt&gt;count&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final boolean isActive()" doc="/**
&lt;p&gt;Returns the active status of this stack..&lt;/p&gt;
&lt;p&gt;An application often has multiple undo stacks, one for each opened document. The active stack is the one associated with the currently active document. If the stack belongs to a &lt;a href=&quot;QUndoGroup.html&quot;&gt;&lt;tt&gt;QUndoGroup&lt;/tt&gt;&lt;/a&gt;, calls to QUndoGroup::undo() or QUndoGroup::redo() will be forwarded to this stack when it is active. If the &lt;a href=&quot;QUndoGroup.html&quot;&gt;&lt;tt&gt;QUndoGroup&lt;/tt&gt;&lt;/a&gt; is watched by a &lt;a href=&quot;QUndoView.html&quot;&gt;&lt;tt&gt;QUndoView&lt;/tt&gt;&lt;/a&gt;, the view will display the contents of this stack when it is active. If the stack does not belong to a &lt;a href=&quot;QUndoGroup.html&quot;&gt;&lt;tt&gt;QUndoGroup&lt;/tt&gt;&lt;/a&gt;, making it active has no effect.&lt;/p&gt;
&lt;p&gt;It is the programmer's responsibility to specify which stack is active by calling &lt;a href=&quot;QUndoStack.html#setActive(boolean)&quot;&gt;&lt;tt&gt;setActive&lt;/tt&gt;&lt;/a&gt;, usually when the associated document window receives focus.&lt;/p&gt;

@see &lt;a href=&quot;QUndoGroup.html&quot;&gt;&lt;tt&gt;QUndoGroup&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final boolean isClean()" doc="/**
&lt;p&gt;If the stack is in the clean state, returns true; otherwise returns false.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#setClean()&quot;&gt;&lt;tt&gt;setClean&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUndoStack.html#cleanIndex()&quot;&gt;&lt;tt&gt;cleanIndex&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void push(com.trolltech.qt.gui.QUndoCommand cmd)" doc="/**
&lt;p&gt;Pushes &lt;tt&gt;cmd&lt;/tt&gt; on the stack or merges it with the most recently executed command. In either case, executes &lt;tt&gt;cmd&lt;/tt&gt; by calling its &lt;a href=&quot;QUndoStack.html#redo()&quot;&gt;&lt;tt&gt;redo&lt;/tt&gt;&lt;/a&gt; function.&lt;/p&gt;
&lt;p&gt;If &lt;tt&gt;cmd&lt;/tt&gt;'s id is not -1, and if the id is the same as that of the most recently executed command, &lt;a href=&quot;QUndoStack.html#QUndoStack(com.trolltech.qt.core.QObject)&quot;&gt;&lt;tt&gt;QUndoStack&lt;/tt&gt;&lt;/a&gt; will attempt to merge the two commands by calling QUndoCommand::mergeWith() on the most recently executed command. If QUndoCommand::mergeWith() returns true, &lt;tt&gt;cmd&lt;/tt&gt; is deleted.&lt;/p&gt;
&lt;p&gt;In all other cases &lt;tt&gt;cmd&lt;/tt&gt; is simply pushed on the stack.&lt;/p&gt;
&lt;p&gt;If commands were undone before &lt;tt&gt;cmd&lt;/tt&gt; was pushed, the current command and all commands above it are deleted. Hence &lt;tt&gt;cmd&lt;/tt&gt; always ends up being the top-most on the stack.&lt;/p&gt;
&lt;p&gt;Once a command is pushed, the stack takes ownership of it. There are no getters to return the command, since modifying it after it has been executed will almost always lead to corruption of the document's state.&lt;/p&gt;

@see &lt;tt&gt;QUndoCommand::id&lt;/tt&gt;
@see &lt;tt&gt;QUndoCommand::mergeWith&lt;/tt&gt; */"/>
    <method name="public final void redo()" doc="/**
&lt;p&gt;Redoes the current command by calling QUndoCommand::redo(). Increments the current command index.&lt;/p&gt;
&lt;p&gt;If the stack is empty, or if the top command on the stack has already been redone, this function does nothing.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#undo()&quot;&gt;&lt;tt&gt;undo&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUndoStack.html#index()&quot;&gt;&lt;tt&gt;index&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final java.lang.String redoText()" doc="/**
&lt;p&gt;Returns the text of the command which will be redone in the next call to &lt;a href=&quot;QUndoStack.html#redo()&quot;&gt;&lt;tt&gt;redo&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;

@see &lt;tt&gt;QUndoCommand::text&lt;/tt&gt;
@see &lt;a href=&quot;QUndoStack.html#undoText()&quot;&gt;&lt;tt&gt;undoText&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setActive(boolean active)" doc="/**
&lt;p&gt;Sets the active status of this stack. to &lt;tt&gt;active&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;An application often has multiple undo stacks, one for each opened document. The active stack is the one associated with the currently active document. If the stack belongs to a &lt;a href=&quot;QUndoGroup.html&quot;&gt;&lt;tt&gt;QUndoGroup&lt;/tt&gt;&lt;/a&gt;, calls to QUndoGroup::undo() or QUndoGroup::redo() will be forwarded to this stack when it is active. If the &lt;a href=&quot;QUndoGroup.html&quot;&gt;&lt;tt&gt;QUndoGroup&lt;/tt&gt;&lt;/a&gt; is watched by a &lt;a href=&quot;QUndoView.html&quot;&gt;&lt;tt&gt;QUndoView&lt;/tt&gt;&lt;/a&gt;, the view will display the contents of this stack when it is active. If the stack does not belong to a &lt;a href=&quot;QUndoGroup.html&quot;&gt;&lt;tt&gt;QUndoGroup&lt;/tt&gt;&lt;/a&gt;, making it active has no effect.&lt;/p&gt;
&lt;p&gt;It is the programmer's responsibility to specify which stack is active by calling &lt;a href=&quot;QUndoStack.html#setActive(boolean)&quot;&gt;&lt;tt&gt;setActive&lt;/tt&gt;&lt;/a&gt;, usually when the associated document window receives focus.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#isActive()&quot;&gt;&lt;tt&gt;isActive&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUndoGroup.html&quot;&gt;&lt;tt&gt;QUndoGroup&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setActive()" doc="/**
&lt;p&gt;Equivalent to &lt;a href=&quot;QUndoStack.html#setActive(boolean)&quot;&gt;&lt;tt&gt;setActive&lt;/tt&gt;&lt;/a&gt;(true). */"/>
    <method name="public final void setClean()" doc="/**
&lt;p&gt;Marks the stack as clean and emits &lt;a href=&quot;QUndoStack.html#cleanChanged(boolean)&quot;&gt;&lt;tt&gt;cleanChanged&lt;/tt&gt;&lt;/a&gt; if the stack was not already clean.&lt;/p&gt;
&lt;p&gt;Whenever the stack returns to this state through the use of undo/redo commands, it emits the signal &lt;a href=&quot;QUndoStack.html#cleanChanged(boolean)&quot;&gt;&lt;tt&gt;cleanChanged&lt;/tt&gt;&lt;/a&gt;. This signal is also emitted when the stack leaves the clean state.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#isClean()&quot;&gt;&lt;tt&gt;isClean&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUndoStack.html#cleanIndex()&quot;&gt;&lt;tt&gt;cleanIndex&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setIndex(int idx)" doc="/**
&lt;p&gt;Repeatedly calls &lt;a href=&quot;QUndoStack.html#undo()&quot;&gt;&lt;tt&gt;undo&lt;/tt&gt;&lt;/a&gt; or &lt;a href=&quot;QUndoStack.html#redo()&quot;&gt;&lt;tt&gt;redo&lt;/tt&gt;&lt;/a&gt; until the the current command index reaches &lt;tt&gt;idx&lt;/tt&gt;. This function can be used to roll the state of the document forwards of backwards. &lt;a href=&quot;QUndoStack.html#indexChanged(int)&quot;&gt;&lt;tt&gt;indexChanged&lt;/tt&gt;&lt;/a&gt; is emitted only once.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#index()&quot;&gt;&lt;tt&gt;index&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUndoStack.html#count()&quot;&gt;&lt;tt&gt;count&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUndoStack.html#undo()&quot;&gt;&lt;tt&gt;undo&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUndoStack.html#redo()&quot;&gt;&lt;tt&gt;redo&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void setUndoLimit(int limit)" doc="/**
&lt;p&gt;Sets the maximum number of commands on this stack. to &lt;tt&gt;limit&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;When the number of commands on a stack exceedes the stack's &lt;a href=&quot;QUndoStack.html#undoLimit()&quot;&gt;&lt;tt&gt;undoLimit&lt;/tt&gt;&lt;/a&gt;, commands are deleted from the bottom of the stack. Macro commands (commands with child commands) are treated as one command. The default value is 0, which means that there is no limit.&lt;/p&gt;
&lt;p&gt;This property may only be set when the undo stack is empty, since setting it on a non-empty stack might delete the command at the current index. Calling &lt;a href=&quot;QUndoStack.html#setUndoLimit(int)&quot;&gt;&lt;tt&gt;setUndoLimit&lt;/tt&gt;&lt;/a&gt; on a non-empty stack prints a warning and does nothing.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#undoLimit()&quot;&gt;&lt;tt&gt;undoLimit&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final java.lang.String text(int idx)" doc="/**
&lt;p&gt;Returns the text of the command at index &lt;tt&gt;idx&lt;/tt&gt;.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#beginMacro(java.lang.String)&quot;&gt;&lt;tt&gt;beginMacro&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final void undo()" doc="/**
&lt;p&gt;Undoes the command below the current command by calling QUndoCommand::undo(). Decrements the current command index.&lt;/p&gt;
&lt;p&gt;If the stack is empty, or if the bottom command on the stack has already been undone, this function does nothing.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#redo()&quot;&gt;&lt;tt&gt;redo&lt;/tt&gt;&lt;/a&gt;
@see &lt;a href=&quot;QUndoStack.html#index()&quot;&gt;&lt;tt&gt;index&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final int undoLimit()" doc="/**
&lt;p&gt;Returns the maximum number of commands on this stack..&lt;/p&gt;
&lt;p&gt;When the number of commands on a stack exceedes the stack's &lt;a href=&quot;QUndoStack.html#undoLimit()&quot;&gt;&lt;tt&gt;undoLimit&lt;/tt&gt;&lt;/a&gt;, commands are deleted from the bottom of the stack. Macro commands (commands with child commands) are treated as one command. The default value is 0, which means that there is no limit.&lt;/p&gt;
&lt;p&gt;This property may only be set when the undo stack is empty, since setting it on a non-empty stack might delete the command at the current index. Calling &lt;a href=&quot;QUndoStack.html#setUndoLimit(int)&quot;&gt;&lt;tt&gt;setUndoLimit&lt;/tt&gt;&lt;/a&gt; on a non-empty stack prints a warning and does nothing.&lt;/p&gt;

@see &lt;a href=&quot;QUndoStack.html#setUndoLimit(int)&quot;&gt;&lt;tt&gt;setUndoLimit&lt;/tt&gt;&lt;/a&gt; */"/>
    <method name="public final java.lang.String undoText()" doc="/**
&lt;p&gt;Returns the text of the command which will be undone in the next call to &lt;a href=&quot;QUndoStack.html#undo()&quot;&gt;&lt;tt&gt;undo&lt;/tt&gt;&lt;/a&gt;.&lt;/p&gt;

@see &lt;tt&gt;QUndoCommand::text&lt;/tt&gt;
@see &lt;a href=&quot;QUndoStack.html#redoText()&quot;&gt;&lt;tt&gt;redoText&lt;/tt&gt;&lt;/a&gt; */"/>
</class>