void UndoManager::setActiveStackIndex(int index)
{
    if (index == -1) // When there are no open documents, the index is -1.
        return;

    setActiveStack(undoStacks.at(index).get());
}
Esempio n. 2
0
void KUndo2Group::removeStack(KUndo2QStack *stack)
{
    if (m_stack_list.removeAll(stack) == 0)
        return;
    if (stack == m_active)
        setActiveStack(0);
    stack->m_group = 0;
}
Esempio n. 3
0
void QUndoGroup::removeStack(QUndoStack *stack)
{
    Q_D(QUndoGroup);

    if (d->stack_list.removeAll(stack) == 0)
        return;
    if (stack == d->active)
        setActiveStack(0);
    stack->d_func()->group = 0;
}
int QUndoGroup::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: activeStackChanged((*reinterpret_cast< QUndoStack*(*)>(_a[1]))); break;
        case 1: indexChanged((*reinterpret_cast< int(*)>(_a[1]))); break;
        case 2: cleanChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 3: canUndoChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 4: canRedoChanged((*reinterpret_cast< bool(*)>(_a[1]))); break;
        case 5: undoTextChanged((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 6: redoTextChanged((*reinterpret_cast< const QString(*)>(_a[1]))); break;
        case 7: undo(); break;
        case 8: redo(); break;
        case 9: setActiveStack((*reinterpret_cast< QUndoStack*(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 10;
    }
    return _id;
}