summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/CMakeLists.txt9
-rw-r--r--src/gui/configure.cmake20
-rw-r--r--src/gui/configure.json20
-rw-r--r--src/gui/util/qundogroup.cpp (renamed from src/widgets/util/qundogroup.cpp)147
-rw-r--r--src/gui/util/qundogroup.h (renamed from src/widgets/util/qundogroup.h)13
-rw-r--r--src/gui/util/qundostack.cpp (renamed from src/widgets/util/qundostack.cpp)120
-rw-r--r--src/gui/util/qundostack.h (renamed from src/widgets/util/qundostack.h)14
-rw-r--r--src/gui/util/qundostack_p.h (renamed from src/widgets/util/qundostack_p.h)27
-rw-r--r--src/gui/util/util.pri13
-rw-r--r--src/tools/uic/qclass_lib_map.h6
-rw-r--r--src/widgets/CMakeLists.txt10
-rw-r--r--src/widgets/configure.cmake20
-rw-r--r--src/widgets/configure.json20
-rw-r--r--src/widgets/util/qundoview.cpp4
-rw-r--r--src/widgets/util/util.pri13
15 files changed, 228 insertions, 228 deletions
diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt
index 700b06fe11..efa7b1c41f 100644
--- a/src/gui/CMakeLists.txt
+++ b/src/gui/CMakeLists.txt
@@ -793,6 +793,15 @@ qt_extend_target(Gui CONDITION NOT GCC OR NOT QT_COMPILER_VERSION_MAJOR STREQUAL
"painting/qdrawhelper.cpp"
)
+qt_extend_target(Gui CONDITION QT_FEATURE_undocommand
+ SOURCES
+ util/qundostack.cpp util/qundostack.h util/qundostack_p.h
+)
+
+qt_extend_target(Gui CONDITION QT_FEATURE_undogroup
+ SOURCES
+ util/qundogroup.cpp util/qundogroup.h
+)
qt_create_tracepoints(Gui qtgui.tracepoints)
qt_add_docs(Gui
diff --git a/src/gui/configure.cmake b/src/gui/configure.cmake
index 45ca061ed7..eb7d2b5549 100644
--- a/src/gui/configure.cmake
+++ b/src/gui/configure.cmake
@@ -1134,6 +1134,26 @@ qt_feature("multiprocess" PRIVATE
PURPOSE "Provides support for detecting the desktop environment, launching external processes and opening URLs."
CONDITION NOT INTEGRITY AND NOT rtems
)
+qt_feature("undocommand" PUBLIC
+ SECTION "Utilities"
+ LABEL "QUndoCommand"
+ PURPOSE "Applies (redo or) undo of a single change in a document."
+)
+qt_feature_definition("undocommand" "QT_NO_UNDOCOMMAND" NEGATE VALUE "1")
+qt_feature("undostack" PUBLIC
+ SECTION "Utilities"
+ LABEL "QUndoStack"
+ PURPOSE "Provides the ability to (redo or) undo a list of changes in a document."
+ CONDITION QT_FEATURE_undocommand
+)
+qt_feature_definition("undostack" "QT_NO_UNDOSTACK" NEGATE VALUE "1")
+qt_feature("undogroup" PUBLIC
+ SECTION "Utilities"
+ LABEL "QUndoGroup"
+ PURPOSE "Provides the ability to cluster QUndoCommands."
+ CONDITION QT_FEATURE_undostack
+)
+qt_feature_definition("undogroup" "QT_NO_UNDOGROUP" NEGATE VALUE "1")
qt_feature("whatsthis" PUBLIC
SECTION "Widget Support"
LABEL "QWhatsThis"
diff --git a/src/gui/configure.json b/src/gui/configure.json
index 500251a280..cf33408991 100644
--- a/src/gui/configure.json
+++ b/src/gui/configure.json
@@ -1821,6 +1821,26 @@
"purpose": "Internal painting support for 64 bit (16 bpc) rasterization.",
"section": "Painting",
"output": [ "privateFeature" ]
+ },
+ "undocommand": {
+ "label": "QUndoCommand",
+ "purpose": "Applies (redo or) undo of a single change in a document.",
+ "section": "Utilities",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "undostack": {
+ "label": "QUndoStack",
+ "purpose": "Provides the ability to (redo or) undo a list of changes in a document.",
+ "section": "Utilities",
+ "condition": "features.undocommand",
+ "output": [ "publicFeature", "feature" ]
+ },
+ "undogroup": {
+ "label": "QUndoGroup",
+ "purpose": "Provides the ability to cluster QUndoCommands.",
+ "section": "Utilities",
+ "condition": "features.undostack",
+ "output": [ "publicFeature", "feature" ]
}
},
diff --git a/src/widgets/util/qundogroup.cpp b/src/gui/util/qundogroup.cpp
index ae439743bc..2f4c81b046 100644
--- a/src/widgets/util/qundogroup.cpp
+++ b/src/gui/util/qundogroup.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -253,6 +253,85 @@ QUndoStack *QUndoGroup::activeStack() const
return d->active;
}
+#ifndef QT_NO_ACTION
+
+/*!
+ Creates an undo QAction object with parent \a parent.
+
+ Triggering this action will cause a call to QUndoStack::undo() on the active stack.
+ The text of this action will always be the text of the command which will be undone
+ in the next call to undo(), prefixed by \a prefix. If there is no command available
+ for undo, if the group is empty or if none of the stacks are active, this action will
+ be disabled.
+
+ If \a prefix is empty, the default template "Undo %1" is used instead of prefix.
+ Before Qt 4.8, the prefix "Undo" was used by default.
+
+ \sa createRedoAction(), canUndo(), QUndoCommand::text()
+*/
+
+QAction *QUndoGroup::createUndoAction(QObject *parent, const QString &prefix) const
+{
+ QAction *action = new QAction(parent);
+ action->setEnabled(canUndo());
+
+ QString effectivePrefix = prefix;
+ QString defaultText;
+ if (prefix.isEmpty()) {
+ effectivePrefix = tr("Undo %1");
+ defaultText = tr("Undo", "Default text for undo action");
+ }
+
+ QUndoStackPrivate::setPrefixedText(action, effectivePrefix, defaultText, undoText());
+
+ connect(this, &QUndoGroup::canUndoChanged, action, &QAction::setEnabled);
+ connect(this, &QUndoGroup::undoTextChanged, action, [=](const QString &text) {
+ QUndoStackPrivate::setPrefixedText(action, effectivePrefix, defaultText, text);
+ });
+ connect(action, &QAction::triggered, this, &QUndoGroup::undo);
+
+ return action;
+}
+
+/*!
+ Creates an redo QAction object with parent \a parent.
+
+ Triggering this action will cause a call to QUndoStack::redo() on the active stack.
+ The text of this action will always be the text of the command which will be redone
+ in the next call to redo(), prefixed by \a prefix. If there is no command available
+ for redo, if the group is empty or if none of the stacks are active, this action will
+ be disabled.
+
+ If \a prefix is empty, the default template "Redo %1" is used instead of prefix.
+ Before Qt 4.8, the prefix "Redo" was used by default.
+
+ \sa createUndoAction(), canRedo(), QUndoCommand::text()
+*/
+
+QAction *QUndoGroup::createRedoAction(QObject *parent, const QString &prefix) const
+{
+ QAction *action = new QAction(parent);
+ action->setEnabled(canRedo());
+
+ QString effectivePrefix = prefix;
+ QString defaultText;
+ if (prefix.isEmpty()) {
+ effectivePrefix = tr("Redo %1");
+ defaultText = tr("Redo", "Default text for redo action");
+ }
+
+ QUndoStackPrivate::setPrefixedText(action, effectivePrefix, defaultText, redoText());
+
+ connect(this, &QUndoGroup::canRedoChanged, action, &QAction::setEnabled);
+ connect(this, &QUndoGroup::redoTextChanged, action, [=](const QString &text) {
+ QUndoStackPrivate::setPrefixedText(action, effectivePrefix, defaultText, text);
+ });
+ connect(action, &QAction::triggered, this, &QUndoGroup::redo);
+ return action;
+}
+
+#endif // QT_NO_ACTION
+
/*!
Calls QUndoStack::undo() on the active stack.
@@ -361,72 +440,6 @@ bool QUndoGroup::isClean() const
return d->active == nullptr || d->active->isClean();
}
-#ifndef QT_NO_ACTION
-
-/*!
- Creates an undo QAction object with parent \a parent.
-
- Triggering this action will cause a call to QUndoStack::undo() on the active stack.
- The text of this action will always be the text of the command which will be undone
- in the next call to undo(), prefixed by \a prefix. If there is no command available
- for undo, if the group is empty or if none of the stacks are active, this action will
- be disabled.
-
- If \a prefix is empty, the default template "Undo %1" is used instead of prefix.
- Before Qt 4.8, the prefix "Undo" was used by default.
-
- \sa createRedoAction(), canUndo(), QUndoCommand::text()
-*/
-
-QAction *QUndoGroup::createUndoAction(QObject *parent, const QString &prefix) const
-{
- QUndoAction *result = new QUndoAction(prefix, parent);
- if (prefix.isEmpty())
- result->setTextFormat(tr("Undo %1"), tr("Undo", "Default text for undo action"));
-
- result->setEnabled(canUndo());
- result->setPrefixedText(undoText());
- connect(this, SIGNAL(canUndoChanged(bool)),
- result, SLOT(setEnabled(bool)));
- connect(this, SIGNAL(undoTextChanged(QString)),
- result, SLOT(setPrefixedText(QString)));
- connect(result, SIGNAL(triggered()), this, SLOT(undo()));
- return result;
-}
-
-/*!
- Creates an redo QAction object with parent \a parent.
-
- Triggering this action will cause a call to QUndoStack::redo() on the active stack.
- The text of this action will always be the text of the command which will be redone
- in the next call to redo(), prefixed by \a prefix. If there is no command available
- for redo, if the group is empty or if none of the stacks are active, this action will
- be disabled.
-
- If \a prefix is empty, the default template "Redo %1" is used instead of prefix.
- Before Qt 4.8, the prefix "Redo" was used by default.
-
- \sa createUndoAction(), canRedo(), QUndoCommand::text()
-*/
-
-QAction *QUndoGroup::createRedoAction(QObject *parent, const QString &prefix) const
-{
- QUndoAction *result = new QUndoAction(prefix, parent);
- if (prefix.isEmpty())
- result->setTextFormat(tr("Redo %1"), tr("Redo", "Default text for redo action"));
-
- result->setEnabled(canRedo());
- result->setPrefixedText(redoText());
- connect(this, SIGNAL(canRedoChanged(bool)),
- result, SLOT(setEnabled(bool)));
- connect(this, SIGNAL(redoTextChanged(QString)),
- result, SLOT(setPrefixedText(QString)));
- connect(result, SIGNAL(triggered()), this, SLOT(redo()));
- return result;
-}
-
-#endif // QT_NO_ACTION
-
/*! \fn void QUndoGroup::activeStackChanged(QUndoStack *stack)
This signal is emitted whenever the active stack of the group changes. This can happen
diff --git a/src/widgets/util/qundogroup.h b/src/gui/util/qundogroup.h
index 1845f7e057..ef5b053610 100644
--- a/src/widgets/util/qundogroup.h
+++ b/src/gui/util/qundogroup.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -40,7 +40,7 @@
#ifndef QUNDOGROUP_H
#define QUNDOGROUP_H
-#include <QtWidgets/qtwidgetsglobal.h>
+#include <QtGui/qtguiglobal.h>
#include <QtCore/qobject.h>
#include <QtCore/qstring.h>
@@ -52,7 +52,7 @@ class QUndoGroupPrivate;
class QUndoStack;
class QAction;
-class Q_WIDGETS_EXPORT QUndoGroup : public QObject
+class Q_GUI_EXPORT QUndoGroup : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QUndoGroup)
@@ -67,11 +67,10 @@ public:
QUndoStack *activeStack() const;
#ifndef QT_NO_ACTION
- QAction *createUndoAction(QObject *parent,
- const QString &prefix = QString()) const;
- QAction *createRedoAction(QObject *parent,
- const QString &prefix = QString()) const;
+ QAction *createUndoAction(QObject *parent, const QString &prefix = QString()) const;
+ QAction *createRedoAction(QObject *parent, const QString &prefix = QString()) const;
#endif // QT_NO_ACTION
+
bool canUndo() const;
bool canRedo() const;
QString undoText() const;
diff --git a/src/widgets/util/qundostack.cpp b/src/gui/util/qundostack.cpp
index 8974f11a13..f7b5024389 100644
--- a/src/widgets/util/qundostack.cpp
+++ b/src/gui/util/qundostack.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -215,7 +215,7 @@ int QUndoCommand::id() const
bool QUndoCommand::mergeWith(const QUndoCommand *command)
{
- Q_UNUSED(command);
+ Q_UNUSED(command)
return false;
}
@@ -443,38 +443,6 @@ const QUndoCommand *QUndoCommand::child(int index) const
\sa QUndoCommand, QUndoView
*/
-#if QT_CONFIG(action)
-
-QUndoAction::QUndoAction(const QString &prefix, QObject *parent)
- : QAction(parent)
-{
- m_prefix = prefix;
-}
-
-void QUndoAction::setPrefixedText(const QString &text)
-{
- if (m_defaultText.isEmpty()) {
- QString s = m_prefix;
- if (!m_prefix.isEmpty() && !text.isEmpty())
- s.append(QLatin1Char(' '));
- s.append(text);
- setText(s);
- } else {
- if (text.isEmpty())
- setText(m_defaultText);
- else
- setText(m_prefix.arg(text));
- }
-}
-
-void QUndoAction::setTextFormat(const QString &textFormat, const QString &defaultText)
-{
- m_prefix = textFormat;
- m_defaultText = defaultText;
-}
-
-#endif // QT_CONFIG(action)
-
/*! \internal
Sets the current index to \a idx, emitting appropriate signals. If \a clean is true,
makes \a idx the clean index as well.
@@ -1067,6 +1035,27 @@ QString QUndoStack::redoText() const
#ifndef QT_NO_ACTION
/*!
+ \internal
+
+ Sets the text property of \a action to \a text, applying \a prefix, and falling back to \a defaultText if \a text is empty.
+*/
+void QUndoStackPrivate::setPrefixedText(QAction *action, const QString &prefix, const QString &defaultText, const QString &text)
+{
+ if (defaultText.isEmpty()) {
+ QString s = prefix;
+ if (!prefix.isEmpty() && !text.isEmpty())
+ s.append(QLatin1Char(' '));
+ s.append(text);
+ action->setText(s);
+ } else {
+ if (text.isEmpty())
+ action->setText(defaultText);
+ else
+ action->setText(prefix.arg(text));
+ }
+};
+
+/*!
Creates an undo QAction object with the given \a parent.
Triggering this action will cause a call to undo(). The text of this action
@@ -1082,18 +1071,25 @@ QString QUndoStack::redoText() const
QAction *QUndoStack::createUndoAction(QObject *parent, const QString &prefix) const
{
- QUndoAction *result = new QUndoAction(prefix, parent);
- if (prefix.isEmpty())
- result->setTextFormat(tr("Undo %1"), tr("Undo", "Default text for undo action"));
-
- result->setEnabled(canUndo());
- result->setPrefixedText(undoText());
- connect(this, SIGNAL(canUndoChanged(bool)),
- result, SLOT(setEnabled(bool)));
- connect(this, SIGNAL(undoTextChanged(QString)),
- result, SLOT(setPrefixedText(QString)));
- connect(result, SIGNAL(triggered()), this, SLOT(undo()));
- return result;
+ QAction *action = new QAction(parent);
+ action->setEnabled(canUndo());
+
+ QString effectivePrefix = prefix;
+ QString defaultText;
+ if (prefix.isEmpty()) {
+ effectivePrefix = tr("Undo %1");
+ defaultText = tr("Undo", "Default text for undo action");
+ }
+
+ QUndoStackPrivate::setPrefixedText(action, effectivePrefix, defaultText, undoText());
+
+ connect(this, &QUndoStack::canUndoChanged, action, &QAction::setEnabled);
+ connect(this, &QUndoStack::undoTextChanged, action, [=](const QString &text) {
+ QUndoStackPrivate::setPrefixedText(action, effectivePrefix, defaultText, text);
+ });
+ connect(action, &QAction::triggered, this, &QUndoStack::undo);
+
+ return action;
}
/*!
@@ -1112,18 +1108,25 @@ QAction *QUndoStack::createUndoAction(QObject *parent, const QString &prefix) co
QAction *QUndoStack::createRedoAction(QObject *parent, const QString &prefix) const
{
- QUndoAction *result = new QUndoAction(prefix, parent);
- if (prefix.isEmpty())
- result->setTextFormat(tr("Redo %1"), tr("Redo", "Default text for redo action"));
-
- result->setEnabled(canRedo());
- result->setPrefixedText(redoText());
- connect(this, SIGNAL(canRedoChanged(bool)),
- result, SLOT(setEnabled(bool)));
- connect(this, SIGNAL(redoTextChanged(QString)),
- result, SLOT(setPrefixedText(QString)));
- connect(result, SIGNAL(triggered()), this, SLOT(redo()));
- return result;
+ QAction *action = new QAction(parent);
+ action->setEnabled(canRedo());
+
+ QString effectivePrefix = prefix;
+ QString defaultText;
+ if (prefix.isEmpty()) {
+ effectivePrefix = tr("Redo %1");
+ defaultText = tr("Redo", "Default text for redo action");
+ }
+
+ QUndoStackPrivate::setPrefixedText(action, effectivePrefix, defaultText, redoText());
+
+ connect(this, &QUndoStack::canRedoChanged, action, &QAction::setEnabled);
+ connect(this, &QUndoStack::redoTextChanged, action, [=](const QString &text) {
+ QUndoStackPrivate::setPrefixedText(action, effectivePrefix, defaultText, text);
+ });
+ connect(action, &QAction::triggered, this, &QUndoStack::redo);
+
+ return action;
}
#endif // QT_NO_ACTION
@@ -1383,6 +1386,5 @@ bool QUndoStack::isActive() const
QT_END_NAMESPACE
#include "moc_qundostack.cpp"
-#include "moc_qundostack_p.cpp"
#endif // QT_CONFIG(undostack)
diff --git a/src/widgets/util/qundostack.h b/src/gui/util/qundostack.h
index b5716b2e9b..c137e7d942 100644
--- a/src/widgets/util/qundostack.h
+++ b/src/gui/util/qundostack.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -40,7 +40,7 @@
#ifndef QUNDOSTACK_H
#define QUNDOSTACK_H
-#include <QtWidgets/qtwidgetsglobal.h>
+#include <QtGui/qtguiglobal.h>
#include <QtCore/qobject.h>
#include <QtCore/qstring.h>
@@ -52,7 +52,7 @@ class QAction;
class QUndoCommandPrivate;
class QUndoStackPrivate;
-class Q_WIDGETS_EXPORT QUndoCommand
+class Q_GUI_EXPORT QUndoCommand
{
QUndoCommandPrivate *d;
@@ -84,7 +84,7 @@ private:
#if QT_CONFIG(undostack)
-class Q_WIDGETS_EXPORT QUndoStack : public QObject
+class Q_GUI_EXPORT QUndoStack : public QObject
{
Q_OBJECT
Q_DECLARE_PRIVATE(QUndoStack)
@@ -113,10 +113,8 @@ public:
QString text(int idx) const;
#ifndef QT_NO_ACTION
- QAction *createUndoAction(QObject *parent,
- const QString &prefix = QString()) const;
- QAction *createRedoAction(QObject *parent,
- const QString &prefix = QString()) const;
+ QAction *createUndoAction(QObject *parent, const QString &prefix = QString()) const;
+ QAction *createRedoAction(QObject *parent, const QString &prefix = QString()) const;
#endif // QT_NO_ACTION
bool isActive() const;
diff --git a/src/widgets/util/qundostack_p.h b/src/gui/util/qundostack_p.h
index efe0ceeef8..5f2c438a83 100644
--- a/src/widgets/util/qundostack_p.h
+++ b/src/gui/util/qundostack_p.h
@@ -1,9 +1,9 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2020 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
-** This file is part of the QtWidgets module of the Qt Toolkit.
+** This file is part of the QtGui module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
@@ -40,7 +40,7 @@
#ifndef QUNDOSTACK_P_H
#define QUNDOSTACK_P_H
-#include <QtWidgets/private/qtwidgetsglobal_p.h>
+#include <QtGui/private/qtguiglobal_p.h>
#include <private/qobject_p.h>
#include <QtCore/qlist.h>
#include <QtCore/qstring.h>
@@ -58,9 +58,9 @@ class QUndoGroup;
// W A R N I N G
// -------------
//
-// This file is not part of the Qt API. It exists for the convenience
-// of qapplication_*.cpp, qwidget*.cpp and qfiledialog.cpp. This header
-// file may change from version to version without notice, or even be removed.
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
//
// We mean it.
//
@@ -93,22 +93,11 @@ public:
void setIndex(int idx, bool clean);
bool checkUndoLimit();
-};
#ifndef QT_NO_ACTION
-class QUndoAction : public QAction
-{
- Q_OBJECT
-public:
- explicit QUndoAction(const QString &prefix, QObject *parent = nullptr);
- void setTextFormat(const QString &textFormat, const QString &defaultText);
-public Q_SLOTS:
- void setPrefixedText(const QString &text);
-private:
- QString m_prefix;
- QString m_defaultText;
+ static void setPrefixedText(QAction *action, const QString &prefix, const QString &defaultText, const QString &text);
+#endif
};
-#endif // QT_NO_ACTION
QT_END_NAMESPACE
#endif // QT_CONFIG(undostack)
diff --git a/src/gui/util/util.pri b/src/gui/util/util.pri
index d3402133d6..a799c3e591 100644
--- a/src/gui/util/util.pri
+++ b/src/gui/util/util.pri
@@ -46,3 +46,16 @@ qtConfig(regularexpression) {
SOURCES += \
util/qshadergenerator.cpp
}
+
+qtConfig(undocommand) {
+ HEADERS += \
+ util/qundostack.h \
+ util/qundostack_p.h
+
+ SOURCES += util/qundostack.cpp
+}
+
+qtConfig(undogroup) {
+ HEADERS += util/qundogroup.h
+ SOURCES += util/qundogroup.cpp
+}
diff --git a/src/tools/uic/qclass_lib_map.h b/src/tools/uic/qclass_lib_map.h
index e6b450cdea..456101c2e7 100644
--- a/src/tools/uic/qclass_lib_map.h
+++ b/src/tools/uic/qclass_lib_map.h
@@ -878,9 +878,9 @@ QT_CLASS_LIB(QDesktopServices, QtWidgets, qdesktopservices.h)
QT_CLASS_LIB(QScroller, QtWidgets, qscroller.h)
QT_CLASS_LIB(QScrollerProperties, QtWidgets, qscrollerproperties.h)
QT_CLASS_LIB(QSystemTrayIcon, QtGui, qsystemtrayicon.h)
-QT_CLASS_LIB(QUndoGroup, QtWidgets, qundogroup.h)
-QT_CLASS_LIB(QUndoCommand, QtWidgets, qundostack.h)
-QT_CLASS_LIB(QUndoStack, QtWidgets, qundostack.h)
+QT_CLASS_LIB(QUndoGroup, QtGui, qundogroup.h)
+QT_CLASS_LIB(QUndoCommand, QtGui, qundostack.h)
+QT_CLASS_LIB(QUndoStack, QtGui, qundostack.h)
QT_CLASS_LIB(QUndoView, QtWidgets, qundoview.h)
QT_CLASS_LIB(QAbstractButton, QtWidgets, qabstractbutton.h)
QT_CLASS_LIB(QAbstractScrollArea, QtWidgets, qabstractscrollarea.h)
diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt
index 9730b787be..8b2f599a60 100644
--- a/src/widgets/CMakeLists.txt
+++ b/src/widgets/CMakeLists.txt
@@ -796,16 +796,6 @@ qt_extend_target(Widgets CONDITION QT_FEATURE_scroller
util/qscrollerproperties.cpp util/qscrollerproperties.h util/qscrollerproperties_p.h
)
-qt_extend_target(Widgets CONDITION QT_FEATURE_undocommand
- SOURCES
- util/qundostack.cpp util/qundostack.h util/qundostack_p.h
-)
-
-qt_extend_target(Widgets CONDITION QT_FEATURE_undogroup
- SOURCES
- util/qundogroup.cpp util/qundogroup.h
-)
-
qt_extend_target(Widgets CONDITION QT_FEATURE_undoview
SOURCES
util/qundoview.cpp util/qundoview.h
diff --git a/src/widgets/configure.cmake b/src/widgets/configure.cmake
index 9d79ddb788..7c8f712889 100644
--- a/src/widgets/configure.cmake
+++ b/src/widgets/configure.cmake
@@ -534,26 +534,6 @@ qt_feature("fscompleter" PUBLIC
CONDITION QT_FEATURE_filesystemmodel AND QT_FEATURE_completer
)
qt_feature_definition("fscompleter" "QT_NO_FSCOMPLETER" NEGATE VALUE "1")
-qt_feature("undocommand" PUBLIC
- SECTION "Utilities"
- LABEL "QUndoCommand"
- PURPOSE "Applies (redo or) undo of a single change in a document."
-)
-qt_feature_definition("undocommand" "QT_NO_UNDOCOMMAND" NEGATE VALUE "1")
-qt_feature("undostack" PUBLIC
- SECTION "Utilities"
- LABEL "QUndoStack"
- PURPOSE "Provides the ability to (redo or) undo a list of changes in a document."
- CONDITION QT_FEATURE_undocommand
-)
-qt_feature_definition("undostack" "QT_NO_UNDOSTACK" NEGATE VALUE "1")
-qt_feature("undogroup" PUBLIC
- SECTION "Utilities"
- LABEL "QUndoGroup"
- PURPOSE "Provides the ability to cluster QUndoCommands."
- CONDITION QT_FEATURE_undostack
-)
-qt_feature_definition("undogroup" "QT_NO_UNDOGROUP" NEGATE VALUE "1")
qt_feature("undoview" PUBLIC
SECTION "Utilities"
LABEL "QUndoView"
diff --git a/src/widgets/configure.json b/src/widgets/configure.json
index cab120098a..6634ca0059 100644
--- a/src/widgets/configure.json
+++ b/src/widgets/configure.json
@@ -633,26 +633,6 @@
"condition": "features.filesystemmodel && features.completer",
"output": [ "publicFeature", "feature" ]
},
- "undocommand": {
- "label": "QUndoCommand",
- "purpose": "Applies (redo or) undo of a single change in a document.",
- "section": "Utilities",
- "output": [ "publicFeature", "feature" ]
- },
- "undostack": {
- "label": "QUndoStack",
- "purpose": "Provides the ability to (redo or) undo a list of changes in a document.",
- "section": "Utilities",
- "condition": "features.undocommand",
- "output": [ "publicFeature", "feature" ]
- },
- "undogroup": {
- "label": "QUndoGroup",
- "purpose": "Provides the ability to cluster QUndoCommands.",
- "section": "Utilities",
- "condition": "features.undostack",
- "output": [ "publicFeature", "feature" ]
- },
"undoview": {
"label": "QUndoView",
"purpose": "Provides a widget which shows the contents of an undo stack.",
diff --git a/src/widgets/util/qundoview.cpp b/src/widgets/util/qundoview.cpp
index a39276a2b8..a823c005c1 100644
--- a/src/widgets/util/qundoview.cpp
+++ b/src/widgets/util/qundoview.cpp
@@ -37,12 +37,12 @@
**
****************************************************************************/
-#include "qundostack.h"
#include "qundoview.h"
#if QT_CONFIG(undogroup)
-#include "qundogroup.h"
+#include <QtGui/qundogroup.h>
#endif
+#include <QtGui/qundostack.h>
#include <QtCore/qabstractitemmodel.h>
#include <QtCore/qpointer.h>
#include <QtGui/qicon.h>
diff --git a/src/widgets/util/util.pri b/src/widgets/util/util.pri
index 363291528e..2819ac565a 100644
--- a/src/widgets/util/util.pri
+++ b/src/widgets/util/util.pri
@@ -31,19 +31,6 @@ qtConfig(scroller) {
util/qflickgesture.cpp \
}
-qtConfig(undocommand) {
- HEADERS += \
- util/qundostack.h \
- util/qundostack_p.h
-
- SOURCES += util/qundostack.cpp
-}
-
-qtConfig(undogroup) {
- HEADERS += util/qundogroup.h
- SOURCES += util/qundogroup.cpp
-}
-
qtConfig(undoview) {
HEADERS += util/qundoview.h
SOURCES += util/qundoview.cpp