[][src]Struct qt_widgets::QUndoStack

#[repr(C)]pub struct QUndoStack { /* fields omitted */ }

The QUndoStack class is a stack of QUndoCommand objects.

C++ class: QUndoStack.

C++ documentation:

The QUndoStack class is a stack of QUndoCommand objects.

For an overview of Qt's Undo Framework, see the overview document.

An undo stack maintains a stack of commands that have been applied to a document.

New commands are pushed on the stack using push(). Commands can be undone and redone using undo() and redo(), or by triggering the actions returned by createUndoAction() and createRedoAction().

QUndoStack keeps track of the current command. This is the command which will be executed by the next call to redo(). The index of this command is returned by index(). The state of the edited object can be rolled forward or back using setIndex(). If the top-most command on the stack has already been redone, index() is equal to count().

QUndoStack provides support for undo and redo actions, command compression, command macros, and supports the concept of a clean state.

Methods

impl QUndoStack[src]

pub fn slot_set_clean(&self) -> Receiver<()>[src]

Marks the stack as clean and emits cleanChanged() if the stack was not already clean.

Returns a built-in Qt slot QUndoStack::setClean that can be passed to qt_core::Signal::connect.

C++ documentation:

Marks the stack as clean and emits cleanChanged() if the stack was not already clean.

This is typically called when a document is saved, for example.

Whenever the stack returns to this state through the use of undo/redo commands, it emits the signal cleanChanged(). This signal is also emitted when the stack leaves the clean state.

See also isClean(), resetClean(), and cleanIndex().

pub fn slot_reset_clean(&self) -> Receiver<()>[src]

Leaves the clean state and emits cleanChanged() if the stack was clean. This method resets the clean index to -1.

Returns a built-in Qt slot QUndoStack::resetClean that can be passed to qt_core::Signal::connect.

C++ documentation:

Leaves the clean state and emits cleanChanged() if the stack was clean. This method resets the clean index to -1.

This is typically called in the following cases, when a document has been:

  • created basing on some template and has not been saved, so no filename has been associated with the document yet.
  • restored from a backup file.
  • changed outside of the editor and the user did not reload it.

This function was introduced in Qt 5.8.

See also isClean(), setClean(), and cleanIndex().

pub fn slot_set_index(&self) -> Receiver<(c_int,)>[src]

Repeatedly calls undo() or redo() until the current command index reaches idx. This function can be used to roll the state of the document forwards of backwards. indexChanged() is emitted only once.

Returns a built-in Qt slot QUndoStack::setIndex that can be passed to qt_core::Signal::connect.

C++ documentation:

Repeatedly calls undo() or redo() until the current command index reaches idx. This function can be used to roll the state of the document forwards of backwards. indexChanged() is emitted only once.

See also index(), count(), undo(), and redo().

pub fn slot_undo(&self) -> Receiver<()>[src]

Undoes the command below the current command by calling QUndoCommand::undo(). Decrements the current command index.

Returns a built-in Qt slot QUndoStack::undo that can be passed to qt_core::Signal::connect.

C++ documentation:

Undoes the command below the current command by calling QUndoCommand::undo(). Decrements the current command index.

If the stack is empty, or if the bottom command on the stack has already been undone, this function does nothing.

After the command is undone, if QUndoCommand::isObsolete() returns true, then the command will be deleted from the stack. Additionally, if the clean index is greater than or equal to the current command index, then the clean index is reset.

See also redo() and index().

pub fn slot_redo(&self) -> Receiver<()>[src]

Redoes the current command by calling QUndoCommand::redo(). Increments the current command index.

Returns a built-in Qt slot QUndoStack::redo that can be passed to qt_core::Signal::connect.

C++ documentation:

Redoes the current command by calling QUndoCommand::redo(). Increments the current command index.

If the stack is empty, or if the top command on the stack has already been redone, this function does nothing.

If QUndoCommand::isObsolete() returns true for the current command, then the command will be deleted from the stack. Additionally, if the clean index is greater than or equal to the current command index, then the clean index is reset.

See also undo() and index().

pub fn slot_set_active(&self) -> Receiver<(bool,)>[src]

This property holds the active status of this stack.

Returns a built-in Qt slot QUndoStack::setActive that can be passed to qt_core::Signal::connect.

C++ documentation:

This property holds the active status of this stack.

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 QUndoGroup, calls to QUndoGroup::undo() or QUndoGroup::redo() will be forwarded to this stack when it is active. If the QUndoGroup is watched by a QUndoView, the view will display the contents of this stack when it is active. If the stack does not belong to a QUndoGroup, making it active has no effect.

It is the programmer's responsibility to specify which stack is active by calling setActive(), usually when the associated document window receives focus.

Access functions:

bool isActive() const
void setActive(bool active = true)

See also QUndoGroup.

pub fn index_changed(&self) -> Signal<(c_int,)>[src]

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 setIndex() is called, this signal is emitted only once.

Returns a built-in Qt signal QUndoStack::indexChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

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 setIndex() is called, this signal is emitted only once.

idx specifies the index of the current command, ie. the command which will be executed on the next call to redo().

See also index() and setIndex().

pub fn clean_changed(&self) -> Signal<(bool,)>[src]

This signal is emitted whenever the stack enters or leaves the clean state. If clean is true, the stack is in a clean state; otherwise this signal indicates that it has left the clean state.

Returns a built-in Qt signal QUndoStack::cleanChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted whenever the stack enters or leaves the clean state. If clean is true, the stack is in a clean state; otherwise this signal indicates that it has left the clean state.

See also isClean() and setClean().

pub fn can_undo_changed(&self) -> Signal<(bool,)>[src]

This signal is emitted whenever the value of canUndo() changes. It is used to enable or disable the undo action returned by createUndoAction(). canUndo specifies the new value.

Returns a built-in Qt signal QUndoStack::canUndoChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted whenever the value of canUndo() changes. It is used to enable or disable the undo action returned by createUndoAction(). canUndo specifies the new value.

pub fn can_redo_changed(&self) -> Signal<(bool,)>[src]

This signal is emitted whenever the value of canRedo() changes. It is used to enable or disable the redo action returned by createRedoAction(). canRedo specifies the new value.

Returns a built-in Qt signal QUndoStack::canRedoChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted whenever the value of canRedo() changes. It is used to enable or disable the redo action returned by createRedoAction(). canRedo specifies the new value.

pub fn undo_text_changed(&self) -> Signal<(*const QString,)>[src]

This signal is emitted whenever the value of undoText() changes. It is used to update the text property of the undo action returned by createUndoAction(). undoText specifies the new text.

Returns a built-in Qt signal QUndoStack::undoTextChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted whenever the value of undoText() changes. It is used to update the text property of the undo action returned by createUndoAction(). undoText specifies the new text.

pub fn redo_text_changed(&self) -> Signal<(*const QString,)>[src]

This signal is emitted whenever the value of redoText() changes. It is used to update the text property of the redo action returned by createRedoAction(). redoText specifies the new text.

Returns a built-in Qt signal QUndoStack::redoTextChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted whenever the value of redoText() changes. It is used to update the text property of the redo action returned by createRedoAction(). redoText specifies the new text.

pub unsafe fn begin_macro(&self, text: impl CastInto<Ref<QString>>)[src]

Begins composition of a macro command with the given text description.

Calls C++ function: void QUndoStack::beginMacro(const QString& text).

C++ documentation:

Begins composition of a macro command with the given text description.

An empty command described by the specified text is pushed on the stack. Any subsequent commands pushed on the stack will be appended to the empty command's children until endMacro() is called.

Calls to beginMacro() and endMacro() may be nested, but every call to beginMacro() must have a matching call to endMacro().

While a macro is being composed, the stack is disabled. This means that:

The stack becomes enabled and appropriate signals are emitted when endMacro() is called for the outermost macro.

stack.beginMacro("insert red text"); stack.push(new InsertText(document, idx, text)); stack.push(new SetColor(document, idx, text.length(), Qt::red)); stack.endMacro(); // indexChanged() is emitted

This code is equivalent to:

QUndoCommand *insertRed = new QUndoCommand(); // an empty command insertRed->setText("insert red text");

new InsertText(document, idx, text, insertRed); // becomes child of insertRed new SetColor(document, idx, text.length(), Qt::red, insertRed);

stack.push(insertRed);

See also endMacro().

pub unsafe fn can_redo(&self) -> bool[src]

Returns true if there is a command available for redo; otherwise returns false.

Calls C++ function: bool QUndoStack::canRedo() const.

C++ documentation:

Returns true if there is a command available for redo; otherwise returns false.

This function returns false if the stack is empty or if the top command on the stack has already been redone.

Synonymous with index() == count().

See also index() and canUndo().

pub unsafe fn can_undo(&self) -> bool[src]

Returns true if there is a command available for undo; otherwise returns false.

Calls C++ function: bool QUndoStack::canUndo() const.

C++ documentation:

Returns true if there is a command available for undo; otherwise returns false.

This function returns false if the stack is empty, or if the bottom command on the stack has already been undone.

Synonymous with index() == 0.

See also index() and canRedo().

pub unsafe fn clean_index(&self) -> c_int[src]

Returns the clean index. This is the index at which setClean() was called.

Calls C++ function: int QUndoStack::cleanIndex() const.

C++ documentation:

Returns the clean index. This is the index at which setClean() was called.

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 push() 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. The -1 may also be returned after an explicit call to resetClean().

See also isClean() and setClean().

pub unsafe fn clear(&self)[src]

Clears the command stack by deleting all commands on it, and returns the stack to the clean state.

Calls C++ function: void QUndoStack::clear().

C++ documentation:

Clears the command stack by deleting all commands on it, and returns the stack to the clean state.

Commands are not undone or redone; the state of the edited object remains unchanged.

This function is usually used when the contents of the document are abandoned.

See also QUndoStack().

pub unsafe fn command(&self, index: c_int) -> Ptr<QUndoCommand>[src]

Returns a const pointer to the command at index.

Calls C++ function: const QUndoCommand* QUndoStack::command(int index) const.

C++ documentation:

Returns a const pointer to the command at index.

This function returns a const pointer, because modifying a command, once it has been pushed onto the stack and executed, almost always causes corruption of the state of the document, if the command is later undone or redone.

This function was introduced in Qt 4.4.

See also QUndoCommand::child().

pub unsafe fn count(&self) -> c_int[src]

Returns the number of commands on the stack. Macro commands are counted as one command.

Calls C++ function: int QUndoStack::count() const.

C++ documentation:

Returns the number of commands on the stack. Macro commands are counted as one command.

See also index(), setIndex(), and command().

pub unsafe fn create_redo_action_2a(
    &self,
    parent: impl CastInto<Ptr<QObject>>,
    prefix: impl CastInto<Ref<QString>>
) -> QPtr<QAction>
[src]

Creates an redo QAction object with the given parent.

Calls C++ function: QAction* QUndoStack::createRedoAction(QObject* parent, const QString& prefix = …) const.

C++ documentation:

Creates an redo QAction object with the given parent.

Triggering this action will cause a call to redo(). The text of this action is the text of the command which will be redone in the next call to redo(), prefixed by the specified prefix. If there is no command available for redo, this action will be disabled.

If prefix is empty, the default template "Redo %1" is used instead of prefix. Before Qt 4.8, the prefix "Redo" was used by default.

See also createUndoAction(), canRedo(), and QUndoCommand::text().

pub unsafe fn create_redo_action_1a(
    &self,
    parent: impl CastInto<Ptr<QObject>>
) -> QPtr<QAction>
[src]

Creates an redo QAction object with the given parent.

Calls C++ function: QAction* QUndoStack::createRedoAction(QObject* parent) const.

C++ documentation:

Creates an redo QAction object with the given parent.

Triggering this action will cause a call to redo(). The text of this action is the text of the command which will be redone in the next call to redo(), prefixed by the specified prefix. If there is no command available for redo, this action will be disabled.

If prefix is empty, the default template "Redo %1" is used instead of prefix. Before Qt 4.8, the prefix "Redo" was used by default.

See also createUndoAction(), canRedo(), and QUndoCommand::text().

pub unsafe fn create_undo_action_2a(
    &self,
    parent: impl CastInto<Ptr<QObject>>,
    prefix: impl CastInto<Ref<QString>>
) -> QPtr<QAction>
[src]

Creates an undo QAction object with the given parent.

Calls C++ function: QAction* QUndoStack::createUndoAction(QObject* parent, const QString& prefix = …) const.

C++ documentation:

Creates an undo QAction object with the given parent.

Triggering this action will cause a call to undo(). The text of this action is the text of the command which will be undone in the next call to undo(), prefixed by the specified prefix. If there is no command available for undo, this action will be disabled.

If prefix is empty, the default template "Undo %1" is used instead of prefix. Before Qt 4.8, the prefix "Undo" was used by default.

See also createRedoAction(), canUndo(), and QUndoCommand::text().

pub unsafe fn create_undo_action_1a(
    &self,
    parent: impl CastInto<Ptr<QObject>>
) -> QPtr<QAction>
[src]

Creates an undo QAction object with the given parent.

Calls C++ function: QAction* QUndoStack::createUndoAction(QObject* parent) const.

C++ documentation:

Creates an undo QAction object with the given parent.

Triggering this action will cause a call to undo(). The text of this action is the text of the command which will be undone in the next call to undo(), prefixed by the specified prefix. If there is no command available for undo, this action will be disabled.

If prefix is empty, the default template "Undo %1" is used instead of prefix. Before Qt 4.8, the prefix "Undo" was used by default.

See also createRedoAction(), canUndo(), and QUndoCommand::text().

pub unsafe fn end_macro(&self)[src]

Ends composition of a macro command.

Calls C++ function: void QUndoStack::endMacro().

C++ documentation:

Ends composition of a macro command.

If this is the outermost macro in a set nested macros, this function emits indexChanged() once for the entire macro command.

See also beginMacro().

pub unsafe fn index(&self) -> c_int[src]

Returns the index of the current command. This is the command that will be executed on the next call to redo(). It is not always the top-most command on the stack, since a number of commands may have been undone.

Calls C++ function: int QUndoStack::index() const.

C++ documentation:

Returns the index of the current command. This is the command that will be executed on the next call to redo(). It is not always the top-most command on the stack, since a number of commands may have been undone.

See also setIndex(), undo(), redo(), and count().

pub unsafe fn is_active(&self) -> bool[src]

This property holds the active status of this stack.

Calls C++ function: bool QUndoStack::isActive() const.

C++ documentation:

This property holds the active status of this stack.

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 QUndoGroup, calls to QUndoGroup::undo() or QUndoGroup::redo() will be forwarded to this stack when it is active. If the QUndoGroup is watched by a QUndoView, the view will display the contents of this stack when it is active. If the stack does not belong to a QUndoGroup, making it active has no effect.

It is the programmer's responsibility to specify which stack is active by calling setActive(), usually when the associated document window receives focus.

Access functions:

bool isActive() const
void setActive(bool active = true)

See also QUndoGroup.

pub unsafe fn is_clean(&self) -> bool[src]

If the stack is in the clean state, returns true; otherwise returns false.

Calls C++ function: bool QUndoStack::isClean() const.

C++ documentation:

If the stack is in the clean state, returns true; otherwise returns false.

See also setClean() and cleanIndex().

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QUndoStack::metaObject() const.

pub unsafe fn new_1a(parent: impl CastInto<Ptr<QObject>>) -> QBox<QUndoStack>[src]

Constructs an empty undo stack with the parent parent. The stack will initially be in the clean state. If parent is a QUndoGroup object, the stack is automatically added to the group.

Calls C++ function: [constructor] void QUndoStack::QUndoStack(QObject* parent = …).

C++ documentation:

Constructs an empty undo stack with the parent parent. The stack will initially be in the clean state. If parent is a QUndoGroup object, the stack is automatically added to the group.

See also push().

pub unsafe fn new_0a() -> QBox<QUndoStack>[src]

The QUndoStack class is a stack of QUndoCommand objects.

Calls C++ function: [constructor] void QUndoStack::QUndoStack().

C++ documentation:

The QUndoStack class is a stack of QUndoCommand objects.

For an overview of Qt's Undo Framework, see the overview document.

An undo stack maintains a stack of commands that have been applied to a document.

New commands are pushed on the stack using push(). Commands can be undone and redone using undo() and redo(), or by triggering the actions returned by createUndoAction() and createRedoAction().

QUndoStack keeps track of the current command. This is the command which will be executed by the next call to redo(). The index of this command is returned by index(). The state of the edited object can be rolled forward or back using setIndex(). If the top-most command on the stack has already been redone, index() is equal to count().

QUndoStack provides support for undo and redo actions, command compression, command macros, and supports the concept of a clean state.

pub unsafe fn push(&self, cmd: impl CastInto<Ptr<QUndoCommand>>)[src]

Pushes cmd on the stack or merges it with the most recently executed command. In either case, executes cmd by calling its redo() function.

Calls C++ function: void QUndoStack::push(QUndoCommand* cmd).

C++ documentation:

Pushes cmd on the stack or merges it with the most recently executed command. In either case, executes cmd by calling its redo() function.

If cmd's id is not -1, and if the id is the same as that of the most recently executed command, QUndoStack will attempt to merge the two commands by calling QUndoCommand::mergeWith() on the most recently executed command. If QUndoCommand::mergeWith() returns true, cmd is deleted.

After calling QUndoCommand::redo() and, if applicable, QUndoCommand::mergeWith(), QUndoCommand::isObsolete() will be called for cmd or the merged command. If QUndoCommand::isObsolete() returns true, then cmd or the merged command will be deleted from the stack.

In all other cases cmd is simply pushed on the stack.

If commands were undone before cmd was pushed, the current command and all commands above it are deleted. Hence cmd always ends up being the top-most on the stack.

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.

See also QUndoCommand::id() and QUndoCommand::mergeWith().

pub unsafe fn qt_metacall(
    &self,
    arg1: Call,
    arg2: c_int,
    arg3: *mut *mut c_void
) -> c_int
[src]

Calls C++ function: virtual int QUndoStack::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(&self, arg1: *const c_char) -> *mut c_void[src]

Calls C++ function: virtual void* QUndoStack::qt_metacast(const char* arg1).

pub unsafe fn redo(&self)[src]

Redoes the current command by calling QUndoCommand::redo(). Increments the current command index.

Calls C++ function: [slot] void QUndoStack::redo().

C++ documentation:

Redoes the current command by calling QUndoCommand::redo(). Increments the current command index.

If the stack is empty, or if the top command on the stack has already been redone, this function does nothing.

If QUndoCommand::isObsolete() returns true for the current command, then the command will be deleted from the stack. Additionally, if the clean index is greater than or equal to the current command index, then the clean index is reset.

See also undo() and index().

pub unsafe fn redo_text(&self) -> CppBox<QString>[src]

Returns the text of the command which will be redone in the next call to redo().

Calls C++ function: QString QUndoStack::redoText() const.

C++ documentation:

Returns the text of the command which will be redone in the next call to redo().

See also QUndoCommand::actionText() and undoText().

pub unsafe fn reset_clean(&self)[src]

Leaves the clean state and emits cleanChanged() if the stack was clean. This method resets the clean index to -1.

Calls C++ function: [slot] void QUndoStack::resetClean().

C++ documentation:

Leaves the clean state and emits cleanChanged() if the stack was clean. This method resets the clean index to -1.

This is typically called in the following cases, when a document has been:

  • created basing on some template and has not been saved, so no filename has been associated with the document yet.
  • restored from a backup file.
  • changed outside of the editor and the user did not reload it.

This function was introduced in Qt 5.8.

See also isClean(), setClean(), and cleanIndex().

pub unsafe fn set_active_1a(&self, active: bool)[src]

This property holds the active status of this stack.

Calls C++ function: [slot] void QUndoStack::setActive(bool active = …).

C++ documentation:

This property holds the active status of this stack.

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 QUndoGroup, calls to QUndoGroup::undo() or QUndoGroup::redo() will be forwarded to this stack when it is active. If the QUndoGroup is watched by a QUndoView, the view will display the contents of this stack when it is active. If the stack does not belong to a QUndoGroup, making it active has no effect.

It is the programmer's responsibility to specify which stack is active by calling setActive(), usually when the associated document window receives focus.

Access functions:

bool isActive() const
void setActive(bool active = true)

See also QUndoGroup.

pub unsafe fn set_active_0a(&self)[src]

This property holds the active status of this stack.

Calls C++ function: [slot] void QUndoStack::setActive().

C++ documentation:

This property holds the active status of this stack.

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 QUndoGroup, calls to QUndoGroup::undo() or QUndoGroup::redo() will be forwarded to this stack when it is active. If the QUndoGroup is watched by a QUndoView, the view will display the contents of this stack when it is active. If the stack does not belong to a QUndoGroup, making it active has no effect.

It is the programmer's responsibility to specify which stack is active by calling setActive(), usually when the associated document window receives focus.

Access functions:

bool isActive() const
void setActive(bool active = true)

See also QUndoGroup.

pub unsafe fn set_clean(&self)[src]

Marks the stack as clean and emits cleanChanged() if the stack was not already clean.

Calls C++ function: [slot] void QUndoStack::setClean().

C++ documentation:

Marks the stack as clean and emits cleanChanged() if the stack was not already clean.

This is typically called when a document is saved, for example.

Whenever the stack returns to this state through the use of undo/redo commands, it emits the signal cleanChanged(). This signal is also emitted when the stack leaves the clean state.

See also isClean(), resetClean(), and cleanIndex().

pub unsafe fn set_index(&self, idx: c_int)[src]

Repeatedly calls undo() or redo() until the current command index reaches idx. This function can be used to roll the state of the document forwards of backwards. indexChanged() is emitted only once.

Calls C++ function: [slot] void QUndoStack::setIndex(int idx).

C++ documentation:

Repeatedly calls undo() or redo() until the current command index reaches idx. This function can be used to roll the state of the document forwards of backwards. indexChanged() is emitted only once.

See also index(), count(), undo(), and redo().

pub unsafe fn set_undo_limit(&self, limit: c_int)[src]

This property holds the maximum number of commands on this stack.

Calls C++ function: void QUndoStack::setUndoLimit(int limit).

C++ documentation:

This property holds the maximum number of commands on this stack.

When the number of commands on a stack exceedes the stack's undoLimit, 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.

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 setUndoLimit() on a non-empty stack prints a warning and does nothing.

This property was introduced in Qt 4.3.

Access functions:

int undoLimit() const
void setUndoLimit(int limit)

pub unsafe fn static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

pub unsafe fn text(&self, idx: c_int) -> CppBox<QString>[src]

Returns the text of the command at index idx.

Calls C++ function: QString QUndoStack::text(int idx) const.

C++ documentation:

Returns the text of the command at index idx.

See also beginMacro().

pub unsafe fn tr(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QUndoStack::tr(const char* s, const char* c, int n).

pub unsafe fn tr_utf8(
    s: *const c_char,
    c: *const c_char,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QUndoStack::trUtf8(const char* s, const char* c, int n).

pub unsafe fn undo(&self)[src]

Undoes the command below the current command by calling QUndoCommand::undo(). Decrements the current command index.

Calls C++ function: [slot] void QUndoStack::undo().

C++ documentation:

Undoes the command below the current command by calling QUndoCommand::undo(). Decrements the current command index.

If the stack is empty, or if the bottom command on the stack has already been undone, this function does nothing.

After the command is undone, if QUndoCommand::isObsolete() returns true, then the command will be deleted from the stack. Additionally, if the clean index is greater than or equal to the current command index, then the clean index is reset.

See also redo() and index().

pub unsafe fn undo_limit(&self) -> c_int[src]

This property holds the maximum number of commands on this stack.

Calls C++ function: int QUndoStack::undoLimit() const.

C++ documentation:

This property holds the maximum number of commands on this stack.

When the number of commands on a stack exceedes the stack's undoLimit, 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.

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 setUndoLimit() on a non-empty stack prints a warning and does nothing.

This property was introduced in Qt 4.3.

Access functions:

int undoLimit() const
void setUndoLimit(int limit)

pub unsafe fn undo_text(&self) -> CppBox<QString>[src]

Returns the text of the command which will be undone in the next call to undo().

Calls C++ function: QString QUndoStack::undoText() const.

C++ documentation:

Returns the text of the command which will be undone in the next call to undo().

See also QUndoCommand::actionText() and redoText().

Trait Implementations

impl CppDeletable for QUndoStack[src]

unsafe fn delete(&self)[src]

Destroys the undo stack, deleting any commands that are on it. If the stack is in a QUndoGroup, the stack is automatically removed from the group.

Calls C++ function: virtual [destructor] void QUndoStack::~QUndoStack().

C++ documentation:

Destroys the undo stack, deleting any commands that are on it. If the stack is in a QUndoGroup, the stack is automatically removed from the group.

See also QUndoStack().

impl Deref for QUndoStack[src]

type Target = QObject

The resulting type after dereferencing.

fn deref(&self) -> &QObject[src]

Calls C++ function: QObject* static_cast<QObject*>(QUndoStack* ptr).

impl DynamicCast<QUndoStack> for QObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QUndoStack>[src]

Calls C++ function: QUndoStack* dynamic_cast<QUndoStack*>(QObject* ptr).

impl StaticDowncast<QUndoStack> for QObject[src]

unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QUndoStack>[src]

Calls C++ function: QUndoStack* static_cast<QUndoStack*>(QObject* ptr).

impl StaticUpcast<QObject> for QUndoStack[src]

unsafe fn static_upcast(ptr: Ptr<QUndoStack>) -> Ptr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QUndoStack* ptr).

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.