本文整理汇总了C++中QUndoGroup::redo方法的典型用法代码示例。如果您正苦于以下问题:C++ QUndoGroup::redo方法的具体用法?C++ QUndoGroup::redo怎么用?C++ QUndoGroup::redo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QUndoGroup
的用法示例。
在下文中一共展示了QUndoGroup::redo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkSignals
void tst_QUndoGroup::checkSignals()
{
QUndoGroup group;
QAction *undo_action = group.createUndoAction(0, QString("foo"));
QAction *redo_action = group.createRedoAction(0, QString("bar"));
QSignalSpy indexChangedSpy(&group, SIGNAL(indexChanged(int)));
QSignalSpy cleanChangedSpy(&group, SIGNAL(cleanChanged(bool)));
QSignalSpy canUndoChangedSpy(&group, SIGNAL(canUndoChanged(bool)));
QSignalSpy undoTextChangedSpy(&group, SIGNAL(undoTextChanged(QString)));
QSignalSpy canRedoChangedSpy(&group, SIGNAL(canRedoChanged(bool)));
QSignalSpy redoTextChangedSpy(&group, SIGNAL(redoTextChanged(QString)));
QString str;
CHECK_STATE(0, // activeStack
true, // clean
false, // canUndo
"", // undoText
false, // canRedo
"", // redoText
false, // cleanChanged
false, // indexChanged
false, // undoChanged
false) // redoChanged
group.undo();
CHECK_STATE(0, // activeStack
true, // clean
false, // canUndo
"", // undoText
false, // canRedo
"", // redoText
false, // cleanChanged
false, // indexChanged
false, // undoChanged
false) // redoChanged
group.redo();
CHECK_STATE(0, // activeStack
true, // clean
false, // canUndo
"", // undoText
false, // canRedo
"", // redoText
false, // cleanChanged
false, // indexChanged
false, // undoChanged
false) // redoChanged
QUndoStack *stack1 = new QUndoStack(&group);
CHECK_STATE(0, // activeStack
true, // clean
false, // canUndo
"", // undoText
false, // canRedo
"", // redoText
false, // cleanChanged
false, // indexChanged
false, // undoChanged
false) // redoChanged
stack1->push(new AppendCommand(&str, "foo"));
CHECK_STATE(0, // activeStack
true, // clean
false, // canUndo
"", // undoText
false, // canRedo
"", // redoText
false, // cleanChanged
false, // indexChanged
false, // undoChanged
false) // redoChanged
stack1->setActive();
CHECK_STATE(stack1, // activeStack
false, // clean
true, // canUndo
"append", // undoText
false, // canRedo
"", // redoText
true, // cleanChanged
true, // indexChanged
true, // undoChanged
true) // redoChanged
stack1->push(new InsertCommand(&str, 0, "bar"));
CHECK_STATE(stack1, // activeStack
false, // clean
true, // canUndo
"insert", // undoText
false, // canRedo
"", // redoText
false, // cleanChanged
true, // indexChanged
true, // undoChanged
true) // redoChanged
stack1->undo();
CHECK_STATE(stack1, // activeStack
false, // clean
//.........这里部分代码省略.........