diff --git a/src/plugins/help/centralwidget.h b/src/plugins/help/centralwidget.h
index 3be4fb7099f157d91f97cdccbc569fb049bfb6d1..ae77a3832cdcc915b03554ca93133918e8c0779a 100644
--- a/src/plugins/help/centralwidget.h
+++ b/src/plugins/help/centralwidget.h
@@ -48,10 +48,10 @@ class QToolButton;
 class QTabWidget;
 class QHelpEngine;
 class QFocusEvent;
-class HelpViewer;
-
 QT_END_NAMESPACE
 
+class HelpViewer;
+
 namespace Help {
 namespace Internal {
 class PrintHelper;
diff --git a/src/plugins/help/contentstoolwindow.h b/src/plugins/help/contentstoolwindow.h
index 993ab390827e5d40cca80613e8d9bf8cead36dad..d62eb27097d4567c19e8ce53512583ce61ac859e 100644
--- a/src/plugins/help/contentstoolwindow.h
+++ b/src/plugins/help/contentstoolwindow.h
@@ -43,6 +43,7 @@ class ContentsToolWindow;
 class ContentsToolWidget : public QTreeWidget
 {
     Q_OBJECT
+
 public:
     ContentsToolWidget();
 
diff --git a/src/plugins/help/helpfindsupport.h b/src/plugins/help/helpfindsupport.h
index e7aedeb8bf7ae36f25bb78311e072fdcf96b77d7..1a5da5490cb40c0778e985d92c888fcfb35025db 100644
--- a/src/plugins/help/helpfindsupport.h
+++ b/src/plugins/help/helpfindsupport.h
@@ -34,9 +34,8 @@
 
 #include <find/ifindsupport.h>
 
-QT_BEGIN_NAMESPACE
+
 class HelpViewer;
-QT_END_NAMESPACE
 
 namespace Help {
 namespace Internal {
diff --git a/src/plugins/help/helpplugin.h b/src/plugins/help/helpplugin.h
index 590421a46a1fc4baabb262f35bbd590d96033d30..45b895cac8bca6bf981501962a3b45810744fa1c 100644
--- a/src/plugins/help/helpplugin.h
+++ b/src/plugins/help/helpplugin.h
@@ -44,13 +44,13 @@ class QHelpEngine;
 class QShortcut;
 class QToolBar;
 class QUrl;
+QT_END_NAMESPACE
 
 class IndexWindow;
 class ContentWindow;
 class BookmarkManager;
 class BookmarkWidget;
 class HelpViewer;
-QT_END_NAMESPACE
 
 
 namespace Core {
diff --git a/src/shared/help/bookmarkmanager.cpp b/src/shared/help/bookmarkmanager.cpp
index 22f6a6a2215cb9e4cf1f4922544a93a9d1e9a598..5f25bce77ca4e201cc43141b8251474593018fcc 100644
--- a/src/shared/help/bookmarkmanager.cpp
+++ b/src/shared/help/bookmarkmanager.cpp
@@ -48,7 +48,6 @@
 #include <QtGui/QDialogButtonBox>
 #include <QtGui/QSortFilterProxyModel>
 
-QT_BEGIN_NAMESPACE
 
 BookmarkDialog::BookmarkDialog(BookmarkManager *manager, const QString &title,
                                const QString &url, QWidget *parent)
@@ -858,5 +857,3 @@ void BookmarkManager::readBookmarksRecursive(const QStandardItem *item,
             readBookmarksRecursive(child, stream, (depth +1));
     }
 }
-
-QT_END_NAMESPACE
diff --git a/src/shared/help/bookmarkmanager.h b/src/shared/help/bookmarkmanager.h
index 0aff1efa8de7cc59356ed761e40eaf03a0a094b0..00f93f670c88fee6ca3b441bc9633c3db0acc218 100644
--- a/src/shared/help/bookmarkmanager.h
+++ b/src/shared/help/bookmarkmanager.h
@@ -55,6 +55,8 @@ class QHelpEngineCore;
 class QAbstractItemModel;
 class QSortFilterProxyModel;
 
+QT_END_NAMESPACE
+
 class BookmarkManager;
 
 class BookmarkDialog : public QDialog
@@ -190,6 +192,4 @@ private:
     QHelpEngineCore *helpEngine;
 };
 
-QT_END_NAMESPACE
-
 #endif
diff --git a/src/shared/help/contentwindow.cpp b/src/shared/help/contentwindow.cpp
index 21b13e3ad7ece574cba1e558717157f432f262c4..1e69effb365c969a0e63771f2e10071242d6f43e 100644
--- a/src/shared/help/contentwindow.cpp
+++ b/src/shared/help/contentwindow.cpp
@@ -37,8 +37,6 @@
 #include <QtHelp/QHelpEngine>
 #include <QtHelp/QHelpContentWidget>
 
-QT_BEGIN_NAMESPACE
-
 ContentWindow::ContentWindow(QHelpEngine *helpEngine)
     : m_helpEngine(helpEngine)
     , m_contentWidget(0)
@@ -157,5 +155,3 @@ void ContentWindow::itemClicked(const QModelIndex &index)
     if (itm)
         emit linkActivated(itm->url());
 }
-
-QT_END_NAMESPACE
diff --git a/src/shared/help/contentwindow.h b/src/shared/help/contentwindow.h
index 07b5227733d7e69f17355dbb89dc45245abdc467..86a21197473e5ff0da3be52b2e38467864e7a94d 100644
--- a/src/shared/help/contentwindow.h
+++ b/src/shared/help/contentwindow.h
@@ -39,6 +39,8 @@ QT_BEGIN_NAMESPACE
 class QHelpEngine;
 class QHelpContentWidget;
 
+QT_END_NAMESPACE
+
 class ContentWindow : public QWidget
 {
     Q_OBJECT
@@ -69,6 +71,4 @@ private:
     int m_expandDepth;
 };
 
-QT_END_NAMESPACE
-
 #endif // CONTENTWINDOW_H
diff --git a/src/shared/help/helpviewer.cpp b/src/shared/help/helpviewer.cpp
index 83efcb56cfcef787f83df541a8a176fb9ad7f1f2..62585d7ac0cd52eac8984f5f0c243bf409256dd9 100644
--- a/src/shared/help/helpviewer.cpp
+++ b/src/shared/help/helpviewer.cpp
@@ -49,7 +49,6 @@
 #include <QNetworkReply>
 #include <QNetworkRequest>
 
-QT_BEGIN_NAMESPACE
 
 #if !defined(QT_NO_WEBKIT)
 
@@ -526,5 +525,3 @@ void HelpViewer::wheelEvent(QWheelEvent *e)
 }
 
 #endif  // !defined(QT_NO_WEBKIT)
-
-QT_END_NAMESPACE
diff --git a/src/shared/help/helpviewer.h b/src/shared/help/helpviewer.h
index 74e100dbd5e96cab3e498f6071be6180793db304..8ed876032b40b632d71a818bf49c0581cdd5acaa 100644
--- a/src/shared/help/helpviewer.h
+++ b/src/shared/help/helpviewer.h
@@ -49,11 +49,13 @@ class QKeyEvent;
 class QMouseEvent;
 class QContextMenuEvent;
 
+QT_END_NAMESPACE
+
 namespace Help {
-    namespace Internal {
+namespace Internal {
         class CentralWidget;
-}
-}
+} // namespace Internal
+} // namespace Help
 
 #if !defined(QT_NO_WEBKIT)
 
@@ -159,6 +161,4 @@ private:
 
 #endif
 
-QT_END_NAMESPACE
-
 #endif
diff --git a/src/shared/help/indexwindow.cpp b/src/shared/help/indexwindow.cpp
index d96d463c45f384c3fef8969fe2c9d3bfaba2d700..fd01473e1eba5cf4a50b980e85246e945efd38e0 100644
--- a/src/shared/help/indexwindow.cpp
+++ b/src/shared/help/indexwindow.cpp
@@ -42,8 +42,6 @@
 #include <QtHelp/QHelpEngine>
 #include <QtHelp/QHelpIndexWidget>
 
-QT_BEGIN_NAMESPACE
-
 IndexWindow::IndexWindow(QHelpEngine *helpEngine, QWidget *parent)
     : QWidget(parent)
     , m_searchLineEdit(0)
@@ -200,5 +198,3 @@ void IndexWindow::focusInEvent(QFocusEvent *e)
         m_searchLineEdit->setFocus();
     }
 }
-
-QT_END_NAMESPACE
diff --git a/src/shared/help/indexwindow.h b/src/shared/help/indexwindow.h
index 56dd6181f08eafda0dd3066aa0457f6c5001027e..6cb8b86932402d7e386c674753682443bab6c4e6 100644
--- a/src/shared/help/indexwindow.h
+++ b/src/shared/help/indexwindow.h
@@ -39,6 +39,8 @@ QT_BEGIN_NAMESPACE
 class QHelpIndexWidget;
 class QHelpEngine;
 
+QT_END_NAMESPACE
+
 class IndexWindow : public QWidget
 {
     Q_OBJECT
@@ -73,6 +75,4 @@ private:
     QHelpEngine *m_helpEngine;
 };
 
-QT_END_NAMESPACE
-
 #endif // INDEXWINDOW_H