From 7ed5f3b867db5eb5b0bd6dc49828e0e6931b60f9 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 3 Sep 2012 16:56:48 +0200 Subject: don't use QT_{BEGIN,END}_INCLUDE_NAMESPACE needlessly these macros behave counter-intuitively, so don't use them unless the code structure really suggests their use. Change-Id: I58213b39f8a98e4368901217fac14ca49c28b8cf Reviewed-by: hjk --- src/corelib/kernel/qtimer.cpp | 6 ++---- src/gui/opengl/qopenglframebufferobject_p.h | 6 +----- src/opengl/qgl_p.h | 5 +---- src/opengl/qglframebufferobject_p.h | 6 +----- src/opengl/qglpixelbuffer_p.h | 6 ++---- src/widgets/dialogs/qinputdialog.cpp | 5 +---- src/widgets/kernel/qlayout.h | 5 +---- src/widgets/styles/qstylefactory.cpp | 6 ++---- 8 files changed, 11 insertions(+), 34 deletions(-) diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp index 3f7927d867..e9a4abdf5a 100644 --- a/src/corelib/kernel/qtimer.cpp +++ b/src/corelib/kernel/qtimer.cpp @@ -292,10 +292,6 @@ void QSingleShotTimer::timerEvent(QTimerEvent *) qDeleteInEventHandler(this); } -QT_BEGIN_INCLUDE_NAMESPACE -#include "qtimer.moc" -QT_END_INCLUDE_NAMESPACE - /*! \reentrant This static function calls a slot after a given time interval. @@ -416,3 +412,5 @@ int QTimer::remainingTime() const */ QT_END_NAMESPACE + +#include "qtimer.moc" diff --git a/src/gui/opengl/qopenglframebufferobject_p.h b/src/gui/opengl/qopenglframebufferobject_p.h index 23cab8f0af..80276d0c20 100644 --- a/src/gui/opengl/qopenglframebufferobject_p.h +++ b/src/gui/opengl/qopenglframebufferobject_p.h @@ -53,15 +53,11 @@ // We mean it. // -QT_BEGIN_NAMESPACE - -QT_BEGIN_INCLUDE_NAMESPACE - #include #include #include -QT_END_INCLUDE_NAMESPACE +QT_BEGIN_NAMESPACE #ifndef QT_OPENGL_ES #define DEFAULT_FORMAT GL_RGBA8 diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h index c2b16f91e0..b03214aed8 100644 --- a/src/opengl/qgl_p.h +++ b/src/opengl/qgl_p.h @@ -66,6 +66,7 @@ #include "qglpaintdevice_p.h" #include +#include QT_BEGIN_NAMESPACE @@ -73,10 +74,6 @@ class QGLContext; class QGLOverlayWidget; class QPixmap; -QT_BEGIN_INCLUDE_NAMESPACE -#include -QT_END_INCLUDE_NAMESPACE - class QGLFormatPrivate { public: diff --git a/src/opengl/qglframebufferobject_p.h b/src/opengl/qglframebufferobject_p.h index 37d786cf60..bab84916ea 100644 --- a/src/opengl/qglframebufferobject_p.h +++ b/src/opengl/qglframebufferobject_p.h @@ -53,15 +53,11 @@ // We mean it. // -QT_BEGIN_NAMESPACE - -QT_BEGIN_INCLUDE_NAMESPACE - #include #include #include -QT_END_INCLUDE_NAMESPACE +QT_BEGIN_NAMESPACE #ifndef QT_OPENGL_ES #define DEFAULT_FORMAT GL_RGBA8 diff --git a/src/opengl/qglpixelbuffer_p.h b/src/opengl/qglpixelbuffer_p.h index 227d35aabc..105fc5f957 100644 --- a/src/opengl/qglpixelbuffer_p.h +++ b/src/opengl/qglpixelbuffer_p.h @@ -53,13 +53,11 @@ // We mean it. // -QT_BEGIN_NAMESPACE - -QT_BEGIN_INCLUDE_NAMESPACE #include "QtOpenGL/qglpixelbuffer.h" #include #include -QT_END_INCLUDE_NAMESPACE + +QT_BEGIN_NAMESPACE class QEglContext; diff --git a/src/widgets/dialogs/qinputdialog.cpp b/src/widgets/dialogs/qinputdialog.cpp index a5f5d6b7b9..fb7b025483 100644 --- a/src/widgets/dialogs/qinputdialog.cpp +++ b/src/widgets/dialogs/qinputdialog.cpp @@ -158,10 +158,6 @@ private: } }; -QT_BEGIN_INCLUDE_NAMESPACE -#include "qinputdialog.moc" -QT_END_INCLUDE_NAMESPACE - class QInputDialogPrivate : public QDialogPrivate { Q_DECLARE_PUBLIC(QInputDialog) @@ -1395,6 +1391,7 @@ QString QInputDialog::getItem(QWidget *parent, const QString &title, const QStri QT_END_NAMESPACE +#include "qinputdialog.moc" #include "moc_qinputdialog.cpp" #endif // QT_NO_INPUTDIALOG diff --git a/src/widgets/kernel/qlayout.h b/src/widgets/kernel/qlayout.h index 9a13922cb1..a7da8dc4e7 100644 --- a/src/widgets/kernel/qlayout.h +++ b/src/widgets/kernel/qlayout.h @@ -165,14 +165,11 @@ private: }; +QT_END_NAMESPACE //### support old includes -QT_BEGIN_INCLUDE_NAMESPACE #include #include -QT_END_INCLUDE_NAMESPACE - -QT_END_NAMESPACE QT_END_HEADER diff --git a/src/widgets/styles/qstylefactory.cpp b/src/widgets/styles/qstylefactory.cpp index a49f6dcdf1..b981c92505 100644 --- a/src/widgets/styles/qstylefactory.cpp +++ b/src/widgets/styles/qstylefactory.cpp @@ -70,14 +70,12 @@ #include "qwindowsmobilestyle.h" #endif -QT_BEGIN_NAMESPACE - #if !defined(QT_NO_STYLE_MAC) && defined(Q_OS_MAC) -QT_BEGIN_INCLUDE_NAMESPACE # include "qmacstyle_mac.h" -QT_END_INCLUDE_NAMESPACE #endif +QT_BEGIN_NAMESPACE + #ifndef QT_NO_LIBRARY Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, loader, (QStyleFactoryInterface_iid, QLatin1String("/styles"), Qt::CaseInsensitive)) -- cgit v1.2.3