summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2016-08-30 12:23:53 +0200
committerLars Knoll <lars.knoll@qt.io>2016-10-11 06:05:09 +0000
commit8d330f55ba26600b93dda9fdcfacb571cfd1e94b (patch)
tree7bd9a2facc8b72ded18b55f7351cd40395bb33cd /src
parent267dd9133d76d466c0f940e7286dc9ba03bac18e (diff)
Fix build with statemachine feature disabled
The sources of the state machine are excluded completely at the build system level instead of littering them with #ifs. All remaining usages of QT_NO_STATEMACHINE are converted to QT_CONFIG(statemachine) or a QT_REQUIRE_CONFIG(statemachine). Also make the qeventtransition feature dependent on statemachine. Change-Id: Ib05c7ca263a02042523fff8f794fa87342df1069 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/configure.json1
-rw-r--r--src/corelib/statemachine/qabstractstate.cpp5
-rw-r--r--src/corelib/statemachine/qabstractstate.h7
-rw-r--r--src/corelib/statemachine/qabstractstate_p.h8
-rw-r--r--src/corelib/statemachine/qabstracttransition.cpp5
-rw-r--r--src/corelib/statemachine/qabstracttransition.h7
-rw-r--r--src/corelib/statemachine/qabstracttransition_p.h2
-rw-r--r--src/corelib/statemachine/qeventtransition.cpp5
-rw-r--r--src/corelib/statemachine/qeventtransition.h7
-rw-r--r--src/corelib/statemachine/qeventtransition_p.h2
-rw-r--r--src/corelib/statemachine/qfinalstate.cpp4
-rw-r--r--src/corelib/statemachine/qfinalstate.h6
-rw-r--r--src/corelib/statemachine/qfinalstate_p.h4
-rw-r--r--src/corelib/statemachine/qhistorystate.cpp5
-rw-r--r--src/corelib/statemachine/qhistorystate.h7
-rw-r--r--src/corelib/statemachine/qhistorystate_p.h7
-rw-r--r--src/corelib/statemachine/qsignaleventgenerator_p.h2
-rw-r--r--src/corelib/statemachine/qsignaltransition.cpp5
-rw-r--r--src/corelib/statemachine/qsignaltransition.h7
-rw-r--r--src/corelib/statemachine/qsignaltransition_p.h2
-rw-r--r--src/corelib/statemachine/qstate.cpp5
-rw-r--r--src/corelib/statemachine/qstate.h7
-rw-r--r--src/corelib/statemachine/qstate_p.h4
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp5
-rw-r--r--src/corelib/statemachine/qstatemachine.h7
-rw-r--r--src/corelib/statemachine/qstatemachine_p.h2
-rw-r--r--src/corelib/statemachine/statemachine.pri2
-rw-r--r--src/widgets/kernel/qapplication.cpp6
-rw-r--r--src/widgets/statemachine/qbasickeyeventtransition.cpp4
-rw-r--r--src/widgets/statemachine/qbasickeyeventtransition_p.h8
-rw-r--r--src/widgets/statemachine/qbasicmouseeventtransition.cpp5
-rw-r--r--src/widgets/statemachine/qbasicmouseeventtransition_p.h8
-rw-r--r--src/widgets/statemachine/qguistatemachine.cpp5
-rw-r--r--src/widgets/statemachine/qkeyeventtransition.cpp5
-rw-r--r--src/widgets/statemachine/qkeyeventtransition.h7
-rw-r--r--src/widgets/statemachine/qmouseeventtransition.cpp5
-rw-r--r--src/widgets/statemachine/qmouseeventtransition.h7
-rw-r--r--src/widgets/statemachine/statemachine.pri7
38 files changed, 51 insertions, 146 deletions
diff --git a/src/corelib/configure.json b/src/corelib/configure.json
index b0c78f5122..a471d55dca 100644
--- a/src/corelib/configure.json
+++ b/src/corelib/configure.json
@@ -353,6 +353,7 @@
},
"qeventtransition": {
"label": "QEventTransition class",
+ "condition": "features.statemachine",
"output": [ "publicFeature" ]
},
"sharedmemory": {
diff --git a/src/corelib/statemachine/qabstractstate.cpp b/src/corelib/statemachine/qabstractstate.cpp
index 13b669d3f6..13bf41faa9 100644
--- a/src/corelib/statemachine/qabstractstate.cpp
+++ b/src/corelib/statemachine/qabstractstate.cpp
@@ -38,9 +38,6 @@
****************************************************************************/
#include "qabstractstate.h"
-
-#ifndef QT_NO_STATEMACHINE
-
#include "qabstractstate_p.h"
#include "qstate.h"
#include "qstate_p.h"
@@ -237,5 +234,3 @@ bool QAbstractState::event(QEvent *e)
}
QT_END_NAMESPACE
-
-#endif //QT_NO_STATEMACHINE
diff --git a/src/corelib/statemachine/qabstractstate.h b/src/corelib/statemachine/qabstractstate.h
index 24e312ac5b..02c7d9e830 100644
--- a/src/corelib/statemachine/qabstractstate.h
+++ b/src/corelib/statemachine/qabstractstate.h
@@ -42,10 +42,9 @@
#include <QtCore/qobject.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(statemachine);
-#ifndef QT_NO_STATEMACHINE
+QT_BEGIN_NAMESPACE
class QState;
class QStateMachine;
@@ -84,8 +83,6 @@ private:
Q_DECLARE_PRIVATE(QAbstractState)
};
-#endif //QT_NO_STATEMACHINE
-
QT_END_NAMESPACE
#endif
diff --git a/src/corelib/statemachine/qabstractstate_p.h b/src/corelib/statemachine/qabstractstate_p.h
index 552125f95a..11befc187e 100644
--- a/src/corelib/statemachine/qabstractstate_p.h
+++ b/src/corelib/statemachine/qabstractstate_p.h
@@ -51,13 +51,11 @@
// We mean it.
//
-#include <QtCore/qglobal.h>
-
-#ifndef QT_NO_STATEMACHINE
-
#include <private/qobject_p.h>
#include <QtCore/qabstractstate.h>
+QT_REQUIRE_CONFIG(statemachine);
+
QT_BEGIN_NAMESPACE
class QStateMachine;
@@ -98,6 +96,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_STATEMACHINE
-
#endif // QABSTRACTSTATE_P_H
diff --git a/src/corelib/statemachine/qabstracttransition.cpp b/src/corelib/statemachine/qabstracttransition.cpp
index 42d1342e10..8c30d5f11c 100644
--- a/src/corelib/statemachine/qabstracttransition.cpp
+++ b/src/corelib/statemachine/qabstracttransition.cpp
@@ -38,9 +38,6 @@
****************************************************************************/
#include "qabstracttransition.h"
-
-#ifndef QT_NO_STATEMACHINE
-
#include "qabstracttransition_p.h"
#include "qabstractstate.h"
#include "qhistorystate.h"
@@ -434,5 +431,3 @@ bool QAbstractTransition::event(QEvent *e)
}
QT_END_NAMESPACE
-
-#endif //QT_NO_STATEMACHINE
diff --git a/src/corelib/statemachine/qabstracttransition.h b/src/corelib/statemachine/qabstracttransition.h
index 41acaa643b..b86d26e969 100644
--- a/src/corelib/statemachine/qabstracttransition.h
+++ b/src/corelib/statemachine/qabstracttransition.h
@@ -44,10 +44,9 @@
#include <QtCore/qlist.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(statemachine);
-#ifndef QT_NO_STATEMACHINE
+QT_BEGIN_NAMESPACE
class QEvent;
class QAbstractState;
@@ -113,8 +112,6 @@ private:
Q_DECLARE_PRIVATE(QAbstractTransition)
};
-#endif //QT_NO_STATEMACHINE
-
QT_END_NAMESPACE
#endif
diff --git a/src/corelib/statemachine/qabstracttransition_p.h b/src/corelib/statemachine/qabstracttransition_p.h
index fd7a9dc311..e11514670e 100644
--- a/src/corelib/statemachine/qabstracttransition_p.h
+++ b/src/corelib/statemachine/qabstracttransition_p.h
@@ -57,6 +57,8 @@
#include <QtCore/qvector.h>
#include <QtCore/qsharedpointer.h>
+QT_REQUIRE_CONFIG(statemachine);
+
QT_BEGIN_NAMESPACE
class QAbstractState;
diff --git a/src/corelib/statemachine/qeventtransition.cpp b/src/corelib/statemachine/qeventtransition.cpp
index ecf40e9c9c..cd0cfe2f85 100644
--- a/src/corelib/statemachine/qeventtransition.cpp
+++ b/src/corelib/statemachine/qeventtransition.cpp
@@ -38,9 +38,6 @@
****************************************************************************/
#include "qeventtransition.h"
-
-#ifndef QT_NO_STATEMACHINE
-
#include "qeventtransition_p.h"
#include "qstate.h"
#include "qstate_p.h"
@@ -255,5 +252,3 @@ bool QEventTransition::event(QEvent *e)
}
QT_END_NAMESPACE
-
-#endif //QT_NO_STATEMACHINE
diff --git a/src/corelib/statemachine/qeventtransition.h b/src/corelib/statemachine/qeventtransition.h
index 454ad1199c..3c66e72658 100644
--- a/src/corelib/statemachine/qeventtransition.h
+++ b/src/corelib/statemachine/qeventtransition.h
@@ -43,10 +43,9 @@
#include <QtCore/qabstracttransition.h>
#include <QtCore/qcoreevent.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(qeventtransition);
-#ifndef QT_NO_STATEMACHINE
+QT_BEGIN_NAMESPACE
class QEventTransitionPrivate;
class Q_CORE_EXPORT QEventTransition : public QAbstractTransition
@@ -81,8 +80,6 @@ private:
Q_DECLARE_PRIVATE(QEventTransition)
};
-#endif //QT_NO_STATEMACHINE
-
QT_END_NAMESPACE
#endif
diff --git a/src/corelib/statemachine/qeventtransition_p.h b/src/corelib/statemachine/qeventtransition_p.h
index 020a2f9cba..e30e12bc8d 100644
--- a/src/corelib/statemachine/qeventtransition_p.h
+++ b/src/corelib/statemachine/qeventtransition_p.h
@@ -53,6 +53,8 @@
#include "private/qabstracttransition_p.h"
+QT_REQUIRE_CONFIG(qeventtransition);
+
QT_BEGIN_NAMESPACE
class QEventTransition;
diff --git a/src/corelib/statemachine/qfinalstate.cpp b/src/corelib/statemachine/qfinalstate.cpp
index efcb364794..bef9fc4239 100644
--- a/src/corelib/statemachine/qfinalstate.cpp
+++ b/src/corelib/statemachine/qfinalstate.cpp
@@ -39,8 +39,6 @@
#include "qfinalstate_p.h"
-#ifndef QT_NO_STATEMACHINE
-
QT_BEGIN_NAMESPACE
/*!
@@ -139,5 +137,3 @@ bool QFinalState::event(QEvent *e)
}
QT_END_NAMESPACE
-
-#endif //QT_NO_STATEMACHINE
diff --git a/src/corelib/statemachine/qfinalstate.h b/src/corelib/statemachine/qfinalstate.h
index 9b6b193231..1563bef397 100644
--- a/src/corelib/statemachine/qfinalstate.h
+++ b/src/corelib/statemachine/qfinalstate.h
@@ -42,9 +42,9 @@
#include <QtCore/qabstractstate.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(statemachine);
-#ifndef QT_NO_STATEMACHINE
+QT_BEGIN_NAMESPACE
class QFinalStatePrivate;
class Q_CORE_EXPORT QFinalState : public QAbstractState
@@ -68,8 +68,6 @@ private:
Q_DECLARE_PRIVATE(QFinalState)
};
-#endif //QT_NO_STATEMACHINE
-
QT_END_NAMESPACE
#endif
diff --git a/src/corelib/statemachine/qfinalstate_p.h b/src/corelib/statemachine/qfinalstate_p.h
index 74640289f1..57de703fe9 100644
--- a/src/corelib/statemachine/qfinalstate_p.h
+++ b/src/corelib/statemachine/qfinalstate_p.h
@@ -48,7 +48,7 @@
#include "qfinalstate.h"
#include "private/qabstractstate_p.h"
-#ifndef QT_NO_STATEMACHINE
+QT_REQUIRE_CONFIG(statemachine);
QT_BEGIN_NAMESPACE
@@ -63,6 +63,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_STATEMACHINE
-
#endif // QFINALSTATE_P_H
diff --git a/src/corelib/statemachine/qhistorystate.cpp b/src/corelib/statemachine/qhistorystate.cpp
index 338c89c688..b1c5a92d00 100644
--- a/src/corelib/statemachine/qhistorystate.cpp
+++ b/src/corelib/statemachine/qhistorystate.cpp
@@ -38,9 +38,6 @@
****************************************************************************/
#include "qhistorystate.h"
-
-#ifndef QT_NO_STATEMACHINE
-
#include "qhistorystate_p.h"
QT_BEGIN_NAMESPACE
@@ -313,5 +310,3 @@ bool QHistoryState::event(QEvent *e)
*/
QT_END_NAMESPACE
-
-#endif //QT_NO_STATEMACHINE
diff --git a/src/corelib/statemachine/qhistorystate.h b/src/corelib/statemachine/qhistorystate.h
index 89d4d7a9e4..c20053abf6 100644
--- a/src/corelib/statemachine/qhistorystate.h
+++ b/src/corelib/statemachine/qhistorystate.h
@@ -42,10 +42,9 @@
#include <QtCore/qabstractstate.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(statemachine);
-#ifndef QT_NO_STATEMACHINE
+QT_BEGIN_NAMESPACE
class QAbstractTransition;
class QHistoryStatePrivate;
@@ -91,8 +90,6 @@ private:
Q_DECLARE_PRIVATE(QHistoryState)
};
-#endif //QT_NO_STATEMACHINE
-
QT_END_NAMESPACE
#endif
diff --git a/src/corelib/statemachine/qhistorystate_p.h b/src/corelib/statemachine/qhistorystate_p.h
index ae9ed431cb..4a4442d7dd 100644
--- a/src/corelib/statemachine/qhistorystate_p.h
+++ b/src/corelib/statemachine/qhistorystate_p.h
@@ -52,13 +52,12 @@
//
#include "private/qabstractstate_p.h"
-
-#ifndef QT_NO_STATEMACHINE
-
#include <QtCore/qabstracttransition.h>
#include <QtCore/qhistorystate.h>
#include <QtCore/qlist.h>
+QT_REQUIRE_CONFIG(statemachine);
+
QT_BEGIN_NAMESPACE
class QHistoryStatePrivate : public QAbstractStatePrivate
@@ -95,6 +94,4 @@ protected:
QT_END_NAMESPACE
-#endif // QT_NO_STATEMACHINE
-
#endif // QHISTORYSTATE_P_H
diff --git a/src/corelib/statemachine/qsignaleventgenerator_p.h b/src/corelib/statemachine/qsignaleventgenerator_p.h
index 92b1ee3b70..271f6317bd 100644
--- a/src/corelib/statemachine/qsignaleventgenerator_p.h
+++ b/src/corelib/statemachine/qsignaleventgenerator_p.h
@@ -54,6 +54,8 @@
#include <QtCore/private/qglobal_p.h>
#include <QtCore/qobject.h>
+QT_REQUIRE_CONFIG(statemachine);
+
QT_BEGIN_NAMESPACE
class QStateMachine;
diff --git a/src/corelib/statemachine/qsignaltransition.cpp b/src/corelib/statemachine/qsignaltransition.cpp
index c4ba8e5315..3b219bda53 100644
--- a/src/corelib/statemachine/qsignaltransition.cpp
+++ b/src/corelib/statemachine/qsignaltransition.cpp
@@ -38,9 +38,6 @@
****************************************************************************/
#include "qsignaltransition.h"
-
-#ifndef QT_NO_STATEMACHINE
-
#include "qsignaltransition_p.h"
#include "qstate.h"
#include "qstate_p.h"
@@ -287,5 +284,3 @@ void QSignalTransitionPrivate::callOnTransition(QEvent *e)
QT_END_NAMESPACE
-
-#endif //QT_NO_STATEMACHINE
diff --git a/src/corelib/statemachine/qsignaltransition.h b/src/corelib/statemachine/qsignaltransition.h
index d7cf8584da..97c2916d9a 100644
--- a/src/corelib/statemachine/qsignaltransition.h
+++ b/src/corelib/statemachine/qsignaltransition.h
@@ -43,10 +43,9 @@
#include <QtCore/qabstracttransition.h>
#include <QtCore/qmetaobject.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(statemachine);
-#ifndef QT_NO_STATEMACHINE
+QT_BEGIN_NAMESPACE
class QSignalTransitionPrivate;
class Q_CORE_EXPORT QSignalTransition : public QAbstractTransition
@@ -95,8 +94,6 @@ private:
Q_DECLARE_PRIVATE(QSignalTransition)
};
-#endif //QT_NO_STATEMACHINE
-
QT_END_NAMESPACE
#endif
diff --git a/src/corelib/statemachine/qsignaltransition_p.h b/src/corelib/statemachine/qsignaltransition_p.h
index 6820bf3bcb..f270a5be4a 100644
--- a/src/corelib/statemachine/qsignaltransition_p.h
+++ b/src/corelib/statemachine/qsignaltransition_p.h
@@ -53,6 +53,8 @@
#include "private/qabstracttransition_p.h"
+QT_REQUIRE_CONFIG(statemachine);
+
QT_BEGIN_NAMESPACE
class QSignalTransition;
diff --git a/src/corelib/statemachine/qstate.cpp b/src/corelib/statemachine/qstate.cpp
index cae6474c32..48456424cf 100644
--- a/src/corelib/statemachine/qstate.cpp
+++ b/src/corelib/statemachine/qstate.cpp
@@ -38,9 +38,6 @@
****************************************************************************/
#include "qstate_p.h"
-
-#ifndef QT_NO_STATEMACHINE
-
#include "qhistorystate.h"
#include "qhistorystate_p.h"
#include "qabstracttransition.h"
@@ -602,5 +599,3 @@ bool QState::event(QEvent *e)
*/
QT_END_NAMESPACE
-
-#endif //QT_NO_STATEMACHINE
diff --git a/src/corelib/statemachine/qstate.h b/src/corelib/statemachine/qstate.h
index 7a9dc9c132..33f84c2de0 100644
--- a/src/corelib/statemachine/qstate.h
+++ b/src/corelib/statemachine/qstate.h
@@ -44,10 +44,9 @@
#include <QtCore/qlist.h>
#include <QtCore/qmetaobject.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(statemachine);
-#ifndef QT_NO_STATEMACHINE
+QT_BEGIN_NAMESPACE
class QAbstractTransition;
class QSignalTransition;
@@ -130,8 +129,6 @@ private:
Q_DECLARE_PRIVATE(QState)
};
-#endif //QT_NO_STATEMACHINE
-
QT_END_NAMESPACE
#endif
diff --git a/src/corelib/statemachine/qstate_p.h b/src/corelib/statemachine/qstate_p.h
index 913657e53b..7fb40392e7 100644
--- a/src/corelib/statemachine/qstate_p.h
+++ b/src/corelib/statemachine/qstate_p.h
@@ -59,7 +59,7 @@
#include <QtCore/qpointer.h>
#include <QtCore/qvariant.h>
-#ifndef QT_NO_STATEMACHINE
+QT_REQUIRE_CONFIG(statemachine);
QT_BEGIN_NAMESPACE
@@ -124,6 +124,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_STATEMACHINE
-
#endif
diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp
index db395b24dd..433f595611 100644
--- a/src/corelib/statemachine/qstatemachine.cpp
+++ b/src/corelib/statemachine/qstatemachine.cpp
@@ -38,9 +38,6 @@
****************************************************************************/
#include "qstatemachine.h"
-
-#ifndef QT_NO_STATEMACHINE
-
#include "qstate.h"
#include "qstate_p.h"
#include "qstatemachine_p.h"
@@ -3235,5 +3232,3 @@ QT_END_NAMESPACE
#include "qstatemachine.moc"
#include "moc_qstatemachine.cpp"
-
-#endif //QT_NO_STATEMACHINE
diff --git a/src/corelib/statemachine/qstatemachine.h b/src/corelib/statemachine/qstatemachine.h
index 031d9ceee2..4f31252eed 100644
--- a/src/corelib/statemachine/qstatemachine.h
+++ b/src/corelib/statemachine/qstatemachine.h
@@ -48,10 +48,9 @@
#include <QtCore/qset.h>
#include <QtCore/qvariant.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(statemachine);
-#ifndef QT_NO_STATEMACHINE
+QT_BEGIN_NAMESPACE
class QStateMachinePrivate;
class QAbstractAnimation;
@@ -183,8 +182,6 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_killDelayedEventTimer(int, int))
};
-#endif //QT_NO_STATEMACHINE
-
QT_END_NAMESPACE
#endif
diff --git a/src/corelib/statemachine/qstatemachine_p.h b/src/corelib/statemachine/qstatemachine_p.h
index 45634e27fb..9418813afd 100644
--- a/src/corelib/statemachine/qstatemachine_p.h
+++ b/src/corelib/statemachine/qstatemachine_p.h
@@ -63,6 +63,8 @@
#include <QtCore/qvector.h>
#include <private/qfreelist_p.h>
+QT_REQUIRE_CONFIG(statemachine);
+
QT_BEGIN_NAMESPACE
class QEvent;
diff --git a/src/corelib/statemachine/statemachine.pri b/src/corelib/statemachine/statemachine.pri
index 52df10a3bc..ee701ebc37 100644
--- a/src/corelib/statemachine/statemachine.pri
+++ b/src/corelib/statemachine/statemachine.pri
@@ -1,3 +1,5 @@
+!qtConfig(statemachine): return()
+
HEADERS += $$PWD/qstatemachine.h \
$$PWD/qstatemachine_p.h \
$$PWD/qsignaleventgenerator_p.h \
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 815ae7fe33..b94aa826d3 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -608,7 +608,7 @@ void qt_init_tooltip_palette()
#endif
}
-#ifndef QT_NO_STATEMACHINE
+#if QT_CONFIG(statemachine)
void qRegisterGuiStateMachine();
void qUnregisterGuiStateMachine();
#endif
@@ -634,7 +634,7 @@ void QApplicationPrivate::initialize()
if (application_type != QApplicationPrivate::Tty)
(void) QApplication::style(); // trigger creation of application style
-#ifndef QT_NO_STATEMACHINE
+#if QT_CONFIG(statemachine)
// trigger registering of QStateMachine's GUI types
qRegisterGuiStateMachine();
#endif
@@ -862,7 +862,7 @@ QApplication::~QApplication()
QApplicationPrivate::enabledAnimations = QPlatformTheme::GeneralUiEffect;
QApplicationPrivate::widgetCount = false;
-#ifndef QT_NO_STATEMACHINE
+#if QT_CONFIG(statemachine)
// trigger unregistering of QStateMachine's GUI types
qUnregisterGuiStateMachine();
#endif
diff --git a/src/widgets/statemachine/qbasickeyeventtransition.cpp b/src/widgets/statemachine/qbasickeyeventtransition.cpp
index fe2edca613..c833e64822 100644
--- a/src/widgets/statemachine/qbasickeyeventtransition.cpp
+++ b/src/widgets/statemachine/qbasickeyeventtransition.cpp
@@ -39,8 +39,6 @@
#include "qbasickeyeventtransition_p.h"
-#ifndef QT_NO_STATEMACHINE
-
#include <QtGui/qevent.h>
#include <qdebug.h>
#include <private/qabstracttransition_p.h>
@@ -204,5 +202,3 @@ void QBasicKeyEventTransition::onTransition(QEvent *)
QT_END_NAMESPACE
#include "moc_qbasickeyeventtransition_p.cpp"
-
-#endif //QT_NO_STATEMACHINE
diff --git a/src/widgets/statemachine/qbasickeyeventtransition_p.h b/src/widgets/statemachine/qbasickeyeventtransition_p.h
index 576c5beb5d..d3b90f6104 100644
--- a/src/widgets/statemachine/qbasickeyeventtransition_p.h
+++ b/src/widgets/statemachine/qbasickeyeventtransition_p.h
@@ -51,13 +51,11 @@
// We mean it.
//
-#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include <QtCore/qabstracttransition.h>
-
-#ifndef QT_NO_STATEMACHINE
-
#include <QtGui/qevent.h>
+QT_REQUIRE_CONFIG(qeventtransition);
+
QT_BEGIN_NAMESPACE
class QBasicKeyEventTransitionPrivate;
@@ -92,6 +90,4 @@ private:
QT_END_NAMESPACE
-#endif //QT_NO_STATEMACHINE
-
#endif
diff --git a/src/widgets/statemachine/qbasicmouseeventtransition.cpp b/src/widgets/statemachine/qbasicmouseeventtransition.cpp
index 39c69b95f5..f404c33a2f 100644
--- a/src/widgets/statemachine/qbasicmouseeventtransition.cpp
+++ b/src/widgets/statemachine/qbasicmouseeventtransition.cpp
@@ -38,9 +38,6 @@
****************************************************************************/
#include "qbasicmouseeventtransition_p.h"
-
-#ifndef QT_NO_STATEMACHINE
-
#include <QtGui/qevent.h>
#include <QtGui/qpainterpath.h>
#include <qdebug.h>
@@ -209,5 +206,3 @@ void QBasicMouseEventTransition::onTransition(QEvent *)
QT_END_NAMESPACE
#include "moc_qbasicmouseeventtransition_p.cpp"
-
-#endif //QT_NO_STATEMACHINE
diff --git a/src/widgets/statemachine/qbasicmouseeventtransition_p.h b/src/widgets/statemachine/qbasicmouseeventtransition_p.h
index 72320a52dc..d6d37eb03e 100644
--- a/src/widgets/statemachine/qbasicmouseeventtransition_p.h
+++ b/src/widgets/statemachine/qbasicmouseeventtransition_p.h
@@ -51,13 +51,11 @@
// We mean it.
//
-#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include <QtCore/qabstracttransition.h>
-
-#ifndef QT_NO_STATEMACHINE
-
#include <QtGui/qevent.h>
+QT_REQUIRE_CONFIG(qeventtransition);
+
QT_BEGIN_NAMESPACE
class QPainterPath;
@@ -95,6 +93,4 @@ private:
QT_END_NAMESPACE
-#endif //QT_NO_STATEMACHINE
-
#endif
diff --git a/src/widgets/statemachine/qguistatemachine.cpp b/src/widgets/statemachine/qguistatemachine.cpp
index c909048213..8d722a4475 100644
--- a/src/widgets/statemachine/qguistatemachine.cpp
+++ b/src/widgets/statemachine/qguistatemachine.cpp
@@ -38,9 +38,6 @@
****************************************************************************/
#include <QtCore/qstatemachine.h>
-
-#ifndef QT_NO_STATEMACHINE
-
#include <private/qstatemachine_p.h>
#include <QtGui/qevent.h>
#include <QtWidgets/qgraphicssceneevent.h>
@@ -471,5 +468,3 @@ void qUnregisterGuiStateMachine()
Q_DESTRUCTOR_FUNCTION(qUnregisterGuiStateMachine)
QT_END_NAMESPACE
-
-#endif //QT_NO_STATEMACHINE
diff --git a/src/widgets/statemachine/qkeyeventtransition.cpp b/src/widgets/statemachine/qkeyeventtransition.cpp
index 0e9f8458c2..1578f294d5 100644
--- a/src/widgets/statemachine/qkeyeventtransition.cpp
+++ b/src/widgets/statemachine/qkeyeventtransition.cpp
@@ -38,9 +38,6 @@
****************************************************************************/
#include "qkeyeventtransition.h"
-
-#ifndef QT_NO_STATEMACHINE
-
#include "qbasickeyeventtransition_p.h"
#include <QtCore/qstatemachine.h>
#include <private/qeventtransition_p.h>
@@ -175,5 +172,3 @@ void QKeyEventTransition::onTransition(QEvent *event)
QT_END_NAMESPACE
#include "moc_qkeyeventtransition.cpp"
-
-#endif //QT_NO_STATEMACHINE
diff --git a/src/widgets/statemachine/qkeyeventtransition.h b/src/widgets/statemachine/qkeyeventtransition.h
index 1e3f02acd8..23ce3c40be 100644
--- a/src/widgets/statemachine/qkeyeventtransition.h
+++ b/src/widgets/statemachine/qkeyeventtransition.h
@@ -43,10 +43,9 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtCore/qeventtransition.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(qeventtransition);
-#ifndef QT_NO_STATEMACHINE
+QT_BEGIN_NAMESPACE
class QKeyEventTransitionPrivate;
class Q_WIDGETS_EXPORT QKeyEventTransition : public QEventTransition
@@ -75,8 +74,6 @@ private:
Q_DECLARE_PRIVATE(QKeyEventTransition)
};
-#endif //QT_NO_STATEMACHINE
-
QT_END_NAMESPACE
#endif
diff --git a/src/widgets/statemachine/qmouseeventtransition.cpp b/src/widgets/statemachine/qmouseeventtransition.cpp
index 047a9779fe..c58dae55a3 100644
--- a/src/widgets/statemachine/qmouseeventtransition.cpp
+++ b/src/widgets/statemachine/qmouseeventtransition.cpp
@@ -38,9 +38,6 @@
****************************************************************************/
#include "qmouseeventtransition.h"
-
-#ifndef QT_NO_STATEMACHINE
-
#include "qbasicmouseeventtransition_p.h"
#include <QtCore/qstatemachine.h>
#include <QtGui/qpainterpath.h>
@@ -203,5 +200,3 @@ void QMouseEventTransition::onTransition(QEvent *event)
QT_END_NAMESPACE
#include "moc_qmouseeventtransition.cpp"
-
-#endif //QT_NO_STATEMACHINE
diff --git a/src/widgets/statemachine/qmouseeventtransition.h b/src/widgets/statemachine/qmouseeventtransition.h
index 43185b140d..3f40224d8c 100644
--- a/src/widgets/statemachine/qmouseeventtransition.h
+++ b/src/widgets/statemachine/qmouseeventtransition.h
@@ -43,10 +43,9 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtCore/qeventtransition.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(qeventtransition);
-#ifndef QT_NO_STATEMACHINE
+QT_BEGIN_NAMESPACE
class QMouseEventTransitionPrivate;
class QPainterPath;
@@ -79,8 +78,6 @@ private:
Q_DECLARE_PRIVATE(QMouseEventTransition)
};
-#endif //QT_NO_STATEMACHINE
-
QT_END_NAMESPACE
#endif
diff --git a/src/widgets/statemachine/statemachine.pri b/src/widgets/statemachine/statemachine.pri
index 2eb1e05be6..7b6407bde5 100644
--- a/src/widgets/statemachine/statemachine.pri
+++ b/src/widgets/statemachine/statemachine.pri
@@ -1,5 +1,8 @@
-SOURCES += $$PWD/qguistatemachine.cpp
-!contains(DEFINES, QT_NO_STATEMACHINE_EVENTFILTER) {
+
+qtConfig(statemachine): \
+ SOURCES += $$PWD/qguistatemachine.cpp
+
+qtConfig(qeventtransition) {
HEADERS += \
$$PWD/qkeyeventtransition.h \
$$PWD/qmouseeventtransition.h \