Convert features.undogroup to QT_[REQUIRE_]CONFIG

Change-Id: I2fe0a3335e140875c425b28dc6e2d3081f534965
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
bb10
Stephan Binner 2017-06-13 21:11:17 +02:00
parent 769769a2ec
commit 61b47df391
6 changed files with 25 additions and 25 deletions

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -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