summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorStephan Binner <stephan.binner@basyskom.com>2017-06-13 21:11:17 +0200
committerStephan Binner <stephan.binner@basyskom.com>2017-06-28 16:15:43 +0000
commit61b47df3915abeec44b830fda211cb1105070500 (patch)
tree778a34427ef118799573054d62fc614b0ac3f669 /src/widgets
parent769769a2ec9ac5ab48df1108f34410df8bfad814 (diff)
Convert features.undogroup to QT_[REQUIRE_]CONFIG
Change-Id: I2fe0a3335e140875c425b28dc6e2d3081f534965 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/util/qundogroup.cpp4
-rw-r--r--src/widgets/util/qundogroup.h7
-rw-r--r--src/widgets/util/qundostack.cpp10
-rw-r--r--src/widgets/util/qundoview.cpp16
-rw-r--r--src/widgets/util/qundoview.h6
-rw-r--r--src/widgets/util/util.pri7
6 files changed, 25 insertions, 25 deletions
diff --git a/src/widgets/util/qundogroup.cpp b/src/widgets/util/qundogroup.cpp
index ec4fc2788a..f9605c7a2f 100644
--- a/src/widgets/util/qundogroup.cpp
+++ b/src/widgets/util/qundogroup.cpp
@@ -41,8 +41,6 @@
#include "qundostack.h"
#include "qundostack_p.h"
-#ifndef QT_NO_UNDOGROUP
-
QT_BEGIN_NAMESPACE
class QUndoGroupPrivate : public QObjectPrivate
@@ -502,5 +500,3 @@ QAction *QUndoGroup::createRedoAction(QObject *parent, const QString &prefix) co
QT_END_NAMESPACE
#include "moc_qundogroup.cpp"
-
-#endif // QT_NO_UNDOGROUP
diff --git a/src/widgets/util/qundogroup.h b/src/widgets/util/qundogroup.h
index 4e2fdeed26..dba79ea706 100644
--- a/src/widgets/util/qundogroup.h
+++ b/src/widgets/util/qundogroup.h
@@ -44,15 +44,14 @@
#include <QtCore/qobject.h>
#include <QtCore/qstring.h>
+QT_REQUIRE_CONFIG(undogroup);
+
QT_BEGIN_NAMESPACE
class QUndoGroupPrivate;
class QUndoStack;
class QAction;
-
-#ifndef QT_NO_UNDOGROUP
-
class Q_WIDGETS_EXPORT QUndoGroup : public QObject
{
Q_OBJECT
@@ -97,8 +96,6 @@ private:
Q_DISABLE_COPY(QUndoGroup)
};
-#endif // QT_NO_UNDOGROUP
-
QT_END_NAMESPACE
#endif // QUNDOGROUP_H
diff --git a/src/widgets/util/qundostack.cpp b/src/widgets/util/qundostack.cpp
index dc0b6855ac..849b3c78f2 100644
--- a/src/widgets/util/qundostack.cpp
+++ b/src/widgets/util/qundostack.cpp
@@ -39,7 +39,9 @@
#include <QtCore/qdebug.h>
#include "qundostack.h"
+#if QT_CONFIG(undogroup)
#include "qundogroup.h"
+#endif
#include "qundostack_p.h"
#ifndef QT_NO_UNDOCOMMAND
@@ -544,7 +546,7 @@ bool QUndoStackPrivate::checkUndoLimit()
QUndoStack::QUndoStack(QObject *parent)
: QObject(*(new QUndoStackPrivate), parent)
{
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
if (QUndoGroup *group = qobject_cast<QUndoGroup*>(parent))
group->addStack(this);
#endif
@@ -559,7 +561,7 @@ QUndoStack::QUndoStack(QObject *parent)
QUndoStack::~QUndoStack()
{
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
Q_D(QUndoStack);
if (d->group != 0)
d->group->removeStack(this);
@@ -1247,7 +1249,7 @@ int QUndoStack::undoLimit() const
void QUndoStack::setActive(bool active)
{
-#ifdef QT_NO_UNDOGROUP
+#if !QT_CONFIG(undogroup)
Q_UNUSED(active);
#else
Q_D(QUndoStack);
@@ -1263,7 +1265,7 @@ void QUndoStack::setActive(bool active)
bool QUndoStack::isActive() const
{
-#ifdef QT_NO_UNDOGROUP
+#if !QT_CONFIG(undogroup)
return true;
#else
Q_D(const QUndoStack);
diff --git a/src/widgets/util/qundoview.cpp b/src/widgets/util/qundoview.cpp
index 94610520b5..b56aa42aed 100644
--- a/src/widgets/util/qundoview.cpp
+++ b/src/widgets/util/qundoview.cpp
@@ -40,7 +40,9 @@
#include "qundostack.h"
#include "qundoview.h"
+#if QT_CONFIG(undogroup)
#include "qundogroup.h"
+#endif
#include <QtCore/qabstractitemmodel.h>
#include <QtCore/qpointer.h>
#include <QtGui/qicon.h>
@@ -271,12 +273,12 @@ class QUndoViewPrivate : public QListViewPrivate
Q_DECLARE_PUBLIC(QUndoView)
public:
QUndoViewPrivate() :
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
group(0),
#endif
model(0) {}
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
QPointer<QUndoGroup> group;
#endif
QUndoModel *model;
@@ -316,7 +318,7 @@ QUndoView::QUndoView(QUndoStack *stack, QWidget *parent)
setStack(stack);
}
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
/*!
Constructs a new view with parent \a parent and sets the observed group to \a group.
@@ -332,7 +334,7 @@ QUndoView::QUndoView(QUndoGroup *group, QWidget *parent)
setGroup(group);
}
-#endif // QT_NO_UNDOGROUP
+#endif // QT_CONFIG(undogroup)
/*!
Destroys this view.
@@ -367,13 +369,13 @@ QUndoStack *QUndoView::stack() const
void QUndoView::setStack(QUndoStack *stack)
{
Q_D(QUndoView);
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
setGroup(0);
#endif
d->model->setStack(stack);
}
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
/*!
Sets the group displayed by this view to \a group. If \a group is 0, the view will
@@ -421,7 +423,7 @@ QUndoGroup *QUndoView::group() const
return d->group;
}
-#endif // QT_NO_UNDOGROUP
+#endif // QT_CONFIG(undogroup)
/*!
\property QUndoView::emptyLabel
diff --git a/src/widgets/util/qundoview.h b/src/widgets/util/qundoview.h
index 35cffb0a28..0bfcdd0c18 100644
--- a/src/widgets/util/qundoview.h
+++ b/src/widgets/util/qundoview.h
@@ -64,13 +64,13 @@ class Q_WIDGETS_EXPORT QUndoView : public QListView
public:
explicit QUndoView(QWidget *parent = Q_NULLPTR);
explicit QUndoView(QUndoStack *stack, QWidget *parent = Q_NULLPTR);
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
explicit QUndoView(QUndoGroup *group, QWidget *parent = Q_NULLPTR);
#endif
~QUndoView();
QUndoStack *stack() const;
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
QUndoGroup *group() const;
#endif
@@ -82,7 +82,7 @@ public:
public Q_SLOTS:
void setStack(QUndoStack *stack);
-#ifndef QT_NO_UNDOGROUP
+#if QT_CONFIG(undogroup)
void setGroup(QUndoGroup *group);
#endif
diff --git a/src/widgets/util/util.pri b/src/widgets/util/util.pri
index 60d4cd0872..99a1a62887 100644
--- a/src/widgets/util/util.pri
+++ b/src/widgets/util/util.pri
@@ -6,7 +6,6 @@ HEADERS += \
util/qcompleter.h \
util/qcompleter_p.h \
util/qsystemtrayicon_p.h \
- util/qundogroup.h \
util/qundostack.h \
util/qundostack_p.h
@@ -14,7 +13,6 @@ SOURCES += \
util/qsystemtrayicon.cpp \
util/qcolormap.cpp \
util/qcompleter.cpp \
- util/qundogroup.cpp \
util/qundostack.cpp
qtConfig(scroller) {
@@ -31,6 +29,11 @@ qtConfig(scroller) {
util/qflickgesture.cpp \
}
+qtConfig(undogroup) {
+ HEADERS += util/qundogroup.h
+ SOURCES += util/qundogroup.cpp
+}
+
qtConfig(undoview) {
HEADERS += util/qundoview.h
SOURCES += util/qundoview.cpp