Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:08:18

0001 // Copyright (C) 2020 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QUNDOGROUP_H
0005 #define QUNDOGROUP_H
0006 
0007 #include <QtGui/qtguiglobal.h>
0008 #include <QtCore/qobject.h>
0009 #include <QtCore/qstring.h>
0010 
0011 QT_REQUIRE_CONFIG(undogroup);
0012 
0013 QT_BEGIN_NAMESPACE
0014 
0015 class QUndoGroupPrivate;
0016 class QUndoStack;
0017 class QAction;
0018 
0019 class Q_GUI_EXPORT QUndoGroup : public QObject
0020 {
0021     Q_OBJECT
0022     Q_DECLARE_PRIVATE(QUndoGroup)
0023 
0024 public:
0025     explicit QUndoGroup(QObject *parent = nullptr);
0026     ~QUndoGroup();
0027 
0028     void addStack(QUndoStack *stack);
0029     void removeStack(QUndoStack *stack);
0030     QList<QUndoStack*> stacks() const;
0031     QUndoStack *activeStack() const;
0032 
0033 #ifndef QT_NO_ACTION
0034     QAction *createUndoAction(QObject *parent, const QString &prefix = QString()) const;
0035     QAction *createRedoAction(QObject *parent, const QString &prefix = QString()) const;
0036 #endif // QT_NO_ACTION
0037 
0038     bool canUndo() const;
0039     bool canRedo() const;
0040     QString undoText() const;
0041     QString redoText() const;
0042     bool isClean() const;
0043 
0044 public Q_SLOTS:
0045     void undo();
0046     void redo();
0047     void setActiveStack(QUndoStack *stack);
0048 
0049 Q_SIGNALS:
0050     void activeStackChanged(QUndoStack *stack);
0051     void indexChanged(int idx);
0052     void cleanChanged(bool clean);
0053     void canUndoChanged(bool canUndo);
0054     void canRedoChanged(bool canRedo);
0055     void undoTextChanged(const QString &undoText);
0056     void redoTextChanged(const QString &redoText);
0057 
0058 private:
0059     Q_DISABLE_COPY(QUndoGroup)
0060 };
0061 
0062 QT_END_NAMESPACE
0063 
0064 #endif // QUNDOGROUP_H