diff --git a/src/plugins/analyzerbase/startremotedialog.h b/src/plugins/analyzerbase/startremotedialog.h
index 4c3f932b8536ad52ada9b01ac1eb0ad3cb6027ee..b3f92e77427627bef895b3a1330abaa520f3c4a0 100644
--- a/src/plugins/analyzerbase/startremotedialog.h
+++ b/src/plugins/analyzerbase/startremotedialog.h
@@ -37,23 +37,12 @@
 
 #include <QtGui/QDialog>
 
-QT_BEGIN_NAMESPACE
+namespace Utils { class SshConnectionParameters; }
 
 namespace Analyzer {
-namespace Internal {
-namespace Ui {
-class StartRemoteDialog;
-} // namespace Ui
-} // namespace Internal
-} // namespace Analyzer
-
-QT_END_NAMESPACE
 
-namespace Utils {
-class SshConnectionParameters;
-}
+namespace Internal { namespace Ui { class StartRemoteDialog; } }
 
-namespace Analyzer {
 
 class ANALYZER_EXPORT StartRemoteDialog : public QDialog
 {
diff --git a/src/plugins/coreplugin/actionmanager/commandmappings.h b/src/plugins/coreplugin/actionmanager/commandmappings.h
index 217b5098d4ba8413c2b6f00e740a9119d9147264..9bac557c6bc6d81a40c054a52261a60699f25bfb 100644
--- a/src/plugins/coreplugin/actionmanager/commandmappings.h
+++ b/src/plugins/coreplugin/actionmanager/commandmappings.h
@@ -41,13 +41,6 @@ QT_BEGIN_NAMESPACE
 class QLineEdit;
 class QTreeWidget;
 class QTreeWidgetItem;
-namespace Core {
-namespace Internal {
-namespace Ui {
-class CommandMappings;
-} // namespace Ui
-} // namespace Internal
-} // namespace Core
 QT_END_NAMESPACE
 
 namespace Core {
@@ -56,6 +49,8 @@ class Command;
 
 namespace Internal {
 
+namespace Ui { class CommandMappings; }
+
 class ActionManagerPrivate;
 class MainWindow;
 
diff --git a/src/plugins/coreplugin/variablechooser.h b/src/plugins/coreplugin/variablechooser.h
index 5db5b051649b88cc6a090c7c40a996d37320ef66..23905533a7ac35c00f388202ac6dfc480d7d24e4 100644
--- a/src/plugins/coreplugin/variablechooser.h
+++ b/src/plugins/coreplugin/variablechooser.h
@@ -43,23 +43,14 @@ class QLineEdit;
 class QTextEdit;
 class QPlainTextEdit;
 class QListWidgetItem;
-
-namespace Core {
-namespace Internal {
-namespace Ui {
-class VariableChooser;
-} // namespace Ui
-} // namespace Internal
-} // namespace Core
-
 QT_END_NAMESPACE
 
-namespace Utils {
-class IconButton;
-} // namespace Utils
+namespace Utils { class IconButton; }
 
 namespace Core {
 
+namespace Internal { namespace Ui { class VariableChooser; } }
+
 class CORE_EXPORT VariableChooser : public QWidget
 {
     Q_OBJECT
@@ -90,4 +81,5 @@ private:
 };
 
 } // namespace Core
+
 #endif // VARIABLECHOOSER_H
diff --git a/src/plugins/cpptools/completionsettingspage.h b/src/plugins/cpptools/completionsettingspage.h
index d7cccaf9fb115c0d51c4332228751b1557be18e1..627125a4c81bc18ce0537262abd5592cfa3e4ee5 100644
--- a/src/plugins/cpptools/completionsettingspage.h
+++ b/src/plugins/cpptools/completionsettingspage.h
@@ -36,18 +36,10 @@
 #include <texteditor/completionsettings.h>
 #include <texteditor/texteditoroptionspage.h>
 
-QT_BEGIN_NAMESPACE
 namespace CppTools {
 namespace Internal {
-namespace Ui {
-class CompletionSettingsPage;
-} // namespace Ui
-} // namespace Internal
-} // namespace CppTools
-QT_END_NAMESPACE
 
-namespace CppTools {
-namespace Internal {
+namespace Ui { class CompletionSettingsPage; }
 
 // TODO: Move this class to the text editor plugin
 
diff --git a/src/plugins/cpptools/cppcodestylesettings.h b/src/plugins/cpptools/cppcodestylesettings.h
index f96d43a8248d7def069523268dc597c2cf106f05..992b8784902cc7380e4a1bcc4d3bf31d96fdbb28 100644
--- a/src/plugins/cpptools/cppcodestylesettings.h
+++ b/src/plugins/cpptools/cppcodestylesettings.h
@@ -88,11 +88,10 @@ public:
     void fromMap(const QString &prefix, const QVariantMap &map);
 
     bool equals(const CppCodeStyleSettings &rhs) const;
+    bool operator==(const CppCodeStyleSettings &s) const { return equals(s); }
+    bool operator!=(const CppCodeStyleSettings &s) const { return !equals(s); }
 };
 
-inline bool operator==(const CppCodeStyleSettings &s1, const CppCodeStyleSettings &s2) { return s1.equals(s2); }
-inline bool operator!=(const CppCodeStyleSettings &s1, const CppCodeStyleSettings &s2) { return !s1.equals(s2); }
-
 } // namespace CppTools
 
 Q_DECLARE_METATYPE(CppTools::CppCodeStyleSettings)
diff --git a/src/plugins/cpptools/cppfilesettingspage.h b/src/plugins/cpptools/cppfilesettingspage.h
index d160777f2188ab1eedb861727683064349f5c311..94526e879d253b468e3a0cb804e0b9d484a9b100 100644
--- a/src/plugins/cpptools/cppfilesettingspage.h
+++ b/src/plugins/cpptools/cppfilesettingspage.h
@@ -34,27 +34,20 @@
 #define CPPSETTINGSPAGE_H
 
 #include <coreplugin/dialogs/ioptionspage.h>
+
 #include <QtCore/QPointer>
 #include <QtCore/QSharedPointer>
 #include <QtGui/QWidget>
 
 QT_BEGIN_NAMESPACE
-
-namespace CppTools {
-namespace Internal {
-namespace Ui {
-class CppFileSettingsPage;
-} // namespace Ui
-} // namespace Internal
-} // namespace CppTools
-
 class QSettings;
-
 QT_END_NAMESPACE
 
 namespace CppTools {
 namespace Internal {
 
+namespace Ui { class CppFileSettingsPage; }
+
 struct CppFileSettings
 {
     CppFileSettings();
@@ -73,11 +66,10 @@ struct CppFileSettings
     static QString licenseTemplate(const QString &file = QString(), const QString &className = QString());
 
     bool equals(const CppFileSettings &rhs) const;
+    bool operator==(const CppFileSettings &s) const { return equals(s); }
+    bool operator!=(const CppFileSettings &s) const { return !equals(s); }
 };
 
-inline bool operator==(const CppFileSettings &s1, const CppFileSettings &s2) { return s1.equals(s2); }
-inline bool operator!=(const CppFileSettings &s1, const CppFileSettings &s2) { return !s1.equals(s2); }
-
 class CppFileSettingsWidget : public QWidget
 {
     Q_OBJECT
@@ -98,7 +90,7 @@ private:
     inline QString licenseTemplatePath() const;
     inline void setLicenseTemplatePath(const QString &);
 
-    Internal::Ui::CppFileSettingsPage *m_ui;
+    Ui::CppFileSettingsPage *m_ui;
 };
 
 class CppFileSettingsPage : public Core::IOptionsPage
diff --git a/src/plugins/debugger/debuggerdialogs.h b/src/plugins/debugger/debuggerdialogs.h
index c8c726779afd0529ad5b9be2f78627425ad48734..cd7de0b1d874946df189a713bd24b7179900ad90 100644
--- a/src/plugins/debugger/debuggerdialogs.h
+++ b/src/plugins/debugger/debuggerdialogs.h
@@ -39,14 +39,17 @@
 #include <QtGui/QVBoxLayout>
 
 QT_BEGIN_NAMESPACE
-
 class QModelIndex;
 class QPushButton;
 class QLineEdit;
 class QDialogButtonBox;
+QT_END_NAMESPACE
+
+namespace ProjectExplorer { class Abi; }
 
 namespace Debugger {
 namespace Internal {
+
 namespace Ui {
 class AttachCoreDialog;
 class AttachExternalDialog;
@@ -55,17 +58,6 @@ class StartRemoteDialog;
 class AttachToQmlPortDialog;
 class StartRemoteEngineDialog;
 } // namespace Ui
-} // namespace Internal
-} // namespace Debugger
-
-QT_END_NAMESPACE
-
-namespace ProjectExplorer {
-class Abi;
-}
-
-namespace Debugger {
-namespace Internal {
 
 class ProcessListFilterModel;
 
diff --git a/src/plugins/genericprojectmanager/genericmakestep.h b/src/plugins/genericprojectmanager/genericmakestep.h
index bcbfe406977ad5585e8daff324ce262c07504e50..b3e0d4085bacbfe00f29ca3aa203dd81a7e6535d 100644
--- a/src/plugins/genericprojectmanager/genericmakestep.h
+++ b/src/plugins/genericprojectmanager/genericmakestep.h
@@ -36,17 +36,7 @@
 #include <projectexplorer/abstractprocessstep.h>
 
 QT_BEGIN_NAMESPACE
-
 class QListWidgetItem;
-
-namespace GenericProjectManager {
-namespace Internal {
-namespace Ui {
-class GenericMakeStep;
-} // namespace Ui
-} // namespace Internal
-} // namespace GenericProjectManager
-
 QT_END_NAMESPACE
 
 namespace GenericProjectManager {
@@ -55,10 +45,12 @@ namespace Internal {
 class GenericBuildConfiguration;
 class GenericMakeStepConfigWidget;
 class GenericMakeStepFactory;
+namespace Ui { class GenericMakeStep; }
 
 class GenericMakeStep : public ProjectExplorer::AbstractProcessStep
 {
     Q_OBJECT
+
     friend class GenericMakeStepConfigWidget; // TODO remove again?
     friend class GenericMakeStepFactory;
 
diff --git a/src/plugins/genericprojectmanager/genericproject.h b/src/plugins/genericprojectmanager/genericproject.h
index 636c20bd8ed129d990cd9546852ebcd5d11e6603..0eb608cbc5d3089481381e1ed712f90534744420 100644
--- a/src/plugins/genericprojectmanager/genericproject.h
+++ b/src/plugins/genericprojectmanager/genericproject.h
@@ -61,6 +61,7 @@ class ToolChain;
 
 namespace GenericProjectManager {
 namespace Internal {
+
 class GenericBuildConfiguration;
 class GenericProject;
 class GenericTarget;
diff --git a/src/plugins/genericprojectmanager/genericprojectplugin.h b/src/plugins/genericprojectmanager/genericprojectplugin.h
index b75cd03ed06b10cf5dd26d784f44fc6edc31a661..2dd0692ac3c692c1499859f304896f8f3a7d4312 100644
--- a/src/plugins/genericprojectmanager/genericprojectplugin.h
+++ b/src/plugins/genericprojectmanager/genericprojectplugin.h
@@ -39,8 +39,8 @@
 #include <QtGui/QAction>
 
 namespace ProjectExplorer {
-    class Project;
-    class Node;
+class Project;
+class Node;
 }
 
 namespace GenericProjectManager {
@@ -48,7 +48,7 @@ namespace Internal {
 
 class ProjectFilesFactory;
 
-class GenericProjectPlugin: public ExtensionSystem::IPlugin
+class GenericProjectPlugin : public ExtensionSystem::IPlugin
 {
     Q_OBJECT
 
diff --git a/src/plugins/madde/maemodeployconfigurationwidget.h b/src/plugins/madde/maemodeployconfigurationwidget.h
index 0cae54b9e3fa19372a1f4f75ad3a576bfa9e65f6..75e606e87c709d141f646003bd374a1da6e1e0a6 100644
--- a/src/plugins/madde/maemodeployconfigurationwidget.h
+++ b/src/plugins/madde/maemodeployconfigurationwidget.h
@@ -35,18 +35,6 @@
 
 #include <projectexplorer/deployconfiguration.h>
 
-QT_BEGIN_NAMESPACE
-
-namespace Madde {
-namespace Internal {
-namespace Ui {
-class MaemoDeployConfigurationWidget;
-} // namespace Ui
-} // namespace Internal
-} // namespace Madde
-
-QT_END_NAMESPACE
-
 namespace RemoteLinux {
 class DeployableFilesPerProFile;
 class RemoteLinuxDeployConfigurationWidget;
@@ -54,7 +42,10 @@ class RemoteLinuxDeployConfigurationWidget;
 
 namespace Madde {
 namespace Internal {
+
 class Qt4MaemoDeployConfiguration;
+namespace Ui { class MaemoDeployConfigurationWidget; }
+
 
 class MaemoDeployConfigurationWidget : public ProjectExplorer::DeployConfigurationWidget
 {
diff --git a/src/plugins/madde/maemopackagecreationwidget.h b/src/plugins/madde/maemopackagecreationwidget.h
index fde0d40e8cc92eae2b2ccb19dfe9008a8d47ce9d..d2c373dddd132b1069f8caa64cf6bdc976aa8df5 100644
--- a/src/plugins/madde/maemopackagecreationwidget.h
+++ b/src/plugins/madde/maemopackagecreationwidget.h
@@ -34,25 +34,16 @@
 
 #include <projectexplorer/buildstep.h>
 
-QT_BEGIN_NAMESPACE
-
 namespace Madde {
 namespace Internal {
-namespace Ui {
-class MaemoPackageCreationWidget;
-} // namespace Ui
-} // namespace Internal
-} // namespace Madde
-
-QT_END_NAMESPACE
 
-namespace Madde {
-namespace Internal {
+namespace Ui { class MaemoPackageCreationWidget; }
 class AbstractMaemoPackageCreationStep;
 
 class MaemoPackageCreationWidget : public ProjectExplorer::BuildStepConfigWidget
 {
     Q_OBJECT
+
 public:
     MaemoPackageCreationWidget(AbstractMaemoPackageCreationStep *step);
     ~MaemoPackageCreationWidget();
diff --git a/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.h b/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.h
index 6b2295a156107ae4c992f43095f670a79fbb5e4b..93be0224a1aaacab804831177f600f035f12ed36 100644
--- a/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.h
+++ b/src/plugins/madde/maemopublishingbuildsettingspagefremantlefree.h
@@ -29,28 +29,21 @@
 ** Nokia at qt-info@nokia.com.
 **
 **************************************************************************/
+
 #ifndef MAEMOPUBLISHINGBUILDSETTINGSPAGEFREMANTLEFREE_H
 #define MAEMOPUBLISHINGBUILDSETTINGSPAGEFREMANTLEFREE_H
 
 #include <QtCore/QList>
 #include <QtGui/QWizardPage>
 
-QT_BEGIN_NAMESPACE
-namespace Madde {
-namespace Internal {
-namespace Ui {
-class MaemoPublishingWizardPageFremantleFree;
-} // namespace Ui
-} // namespace Internal
-} // namespace Madde
-QT_END_NAMESPACE
-
 namespace ProjectExplorer { class Project; }
 namespace Qt4ProjectManager { class Qt4BuildConfiguration; }
 
 namespace Madde {
 namespace Internal {
+
 class MaemoPublisherFremantleFree;
+namespace Ui { class MaemoPublishingWizardPageFremantleFree; }
 
 class MaemoPublishingBuildSettingsPageFremantleFree : public QWizardPage
 {
diff --git a/src/plugins/madde/maemopublishingfileselectiondialog.h b/src/plugins/madde/maemopublishingfileselectiondialog.h
index cd7df261acc038d401eb937277b1b9013b1f1f08..96d2f505a2656b5a7a8f7df2fef9771f09dc5dd4 100644
--- a/src/plugins/madde/maemopublishingfileselectiondialog.h
+++ b/src/plugins/madde/maemopublishingfileselectiondialog.h
@@ -35,18 +35,10 @@
 #include <QtCore/QStringList>
 #include <QtGui/QDialog>
 
-QT_BEGIN_NAMESPACE
 namespace Madde {
 namespace Internal {
-namespace Ui {
-class MaemoPublishingFileSelectionDialog;
-} // namespace Ui
-} // namespace Internal
-} // namespace Madde
-QT_END_NAMESPACE
 
-namespace Madde {
-namespace Internal {
+namespace Ui { class MaemoPublishingFileSelectionDialog; }
 
 class MaemoPublishingFileSelectionDialog : public QDialog
 {
diff --git a/src/plugins/madde/maemopublishingresultpagefremantlefree.h b/src/plugins/madde/maemopublishingresultpagefremantlefree.h
index c4c9753aaea59f02024a5efac5785479c973eba9..1370abc5a8dbc6ad7fdd9dff22b7515bff2d9980 100644
--- a/src/plugins/madde/maemopublishingresultpagefremantlefree.h
+++ b/src/plugins/madde/maemopublishingresultpagefremantlefree.h
@@ -29,26 +29,17 @@
 ** Nokia at qt-info@nokia.com.
 **
 **************************************************************************/
+
 #ifndef MAEMOPUBLISHINGRESULTPAGEFREMANTLEFREE_H
 #define MAEMOPUBLISHINGRESULTPAGEFREMANTLEFREE_H
 
 #include "maemopublisherfremantlefree.h"
 #include <QtGui/QWizardPage>
 
-QT_BEGIN_NAMESPACE
-
 namespace Madde {
 namespace Internal {
-namespace Ui {
-class MaemoPublishingResultPageFremantleFree;
-} // namespace Ui
-} // namespace Internal
-} // namespace Madde
 
-QT_END_NAMESPACE
-
-namespace Madde {
-namespace Internal {
+namespace Ui { class MaemoPublishingResultPageFremantleFree; }
 
 class MaemoPublishingResultPageFremantleFree : public QWizardPage
 {
diff --git a/src/plugins/madde/maemopublishinguploadsettingspagefremantlefree.h b/src/plugins/madde/maemopublishinguploadsettingspagefremantlefree.h
index c3c546b63fe85061d3dde5cb67f25ba62ac8412f..b054a426c14ce3b868edacda3357312eaf365a77 100644
--- a/src/plugins/madde/maemopublishinguploadsettingspagefremantlefree.h
+++ b/src/plugins/madde/maemopublishinguploadsettingspagefremantlefree.h
@@ -29,24 +29,17 @@
 ** Nokia at qt-info@nokia.com.
 **
 **************************************************************************/
+
 #ifndef MAEMOPUBLISHINGUPLOADSETTINGSWIZARDPAGE_H
 #define MAEMOPUBLISHINGUPLOADSETTINGSWIZARDPAGE_H
 
 #include <QtGui/QWizardPage>
 
-QT_BEGIN_NAMESPACE
 namespace Madde {
 namespace Internal {
-namespace Ui {
-class MaemoPublishingUploadSettingsPageFremantleFree;
-} // namespace Ui
-} // namespace Internal
-} // namespace Madde
-QT_END_NAMESPACE
 
-namespace Madde {
-namespace Internal {
 class MaemoPublisherFremantleFree;
+namespace Ui { class MaemoPublishingUploadSettingsPageFremantleFree; }
 
 class MaemoPublishingUploadSettingsPageFremantleFree : public QWizardPage
 {
diff --git a/src/plugins/madde/maemoqemusettingswidget.h b/src/plugins/madde/maemoqemusettingswidget.h
index b54ec1d82d82545eaf9bed590e8fc04fbb7d6ba8..a12bf1ee3f45fb6bfb0123da9b4a3d9f607bf822 100644
--- a/src/plugins/madde/maemoqemusettingswidget.h
+++ b/src/plugins/madde/maemoqemusettingswidget.h
@@ -34,20 +34,10 @@
 
 #include <QtGui/QWidget>
 
-QT_BEGIN_NAMESPACE
-
 namespace Madde {
 namespace Internal {
-namespace Ui {
-class MaemoQemuSettingsWidget;
-} // namespace Ui
-} // namespace Internal
-} // namespace Madde
 
-QT_END_NAMESPACE
-
-namespace Madde {
-namespace Internal {
+namespace Ui { class MaemoQemuSettingsWidget; }
 
 class MaemoQemuSettingsWidget : public QWidget
 {
diff --git a/src/plugins/qmljseditor/qmljscomponentnamedialog.h b/src/plugins/qmljseditor/qmljscomponentnamedialog.h
index 4ea91267dabb7fd172a6e8a59e55c03b15897e43..b67496836258373d1d0938e362fc07740fb78029 100644
--- a/src/plugins/qmljseditor/qmljscomponentnamedialog.h
+++ b/src/plugins/qmljseditor/qmljscomponentnamedialog.h
@@ -35,20 +35,10 @@
 
 #include <QtGui/QDialog>
 
-QT_BEGIN_NAMESPACE
-
 namespace QmlJSEditor {
 namespace Internal {
-namespace Ui {
-    class ComponentNameDialog;
-} // namespace Ui
-} // namespace Internal
-} // namespace QmlJSEditor
 
-QT_END_NAMESPACE
-
-namespace QmlJSEditor {
-namespace Internal {
+namespace Ui { class ComponentNameDialog; }
 
 class ComponentNameDialog : public QDialog
 {
diff --git a/src/plugins/qt4projectmanager/makestep.h b/src/plugins/qt4projectmanager/makestep.h
index 86d034130dbc2b81379e69bea8cea98fb7441225..7cac6229c44df93506a080b81201b79dd7400bdb 100644
--- a/src/plugins/qt4projectmanager/makestep.h
+++ b/src/plugins/qt4projectmanager/makestep.h
@@ -39,18 +39,6 @@
 #include <projectexplorer/buildstep.h>
 #include <projectexplorer/task.h>
 
-QT_BEGIN_NAMESPACE
-
-namespace Qt4ProjectManager {
-namespace Internal {
-namespace Ui {
-class MakeStep;
-} // namespace Ui
-} // namespace Internal
-} // namespace Qt4ProjectManager
-
-QT_END_NAMESPACE
-
 namespace ProjectExplorer {
 class BuildStep;
 class GnuMakeParser;
@@ -59,10 +47,13 @@ class Project;
 }
 
 namespace Qt4ProjectManager {
+
 class Qt4BuildConfiguration;
 
 namespace Internal {
 
+namespace Ui { class MakeStep; }
+
 class MakeStepFactory : public ProjectExplorer::IBuildStepFactory
 {
     Q_OBJECT
diff --git a/src/plugins/qt4projectmanager/qmakestep.h b/src/plugins/qt4projectmanager/qmakestep.h
index 6ab8b831e95d6863ab6abb116c90cfcfef7ede50..131d2d3ece14d7a7c8362e635ed8fd10b3ec4e0d 100644
--- a/src/plugins/qt4projectmanager/qmakestep.h
+++ b/src/plugins/qt4projectmanager/qmakestep.h
@@ -38,18 +38,6 @@
 
 #include <QtCore/QStringList>
 
-QT_BEGIN_NAMESPACE
-
-namespace Qt4ProjectManager {
-namespace Internal {
-namespace Ui {
-class QMakeStep;
-} // namespace Ui
-} // namespace Internal
-} // namespace Qt4ProjectManager
-
-QT_END_NAMESPACE
-
 namespace ProjectExplorer {
 class BuildStep;
 class IBuildStepFactory;
@@ -62,6 +50,8 @@ class Qt4Project;
 
 namespace Internal {
 
+namespace Ui { class QMakeStep; }
+
 class QMakeStepFactory : public ProjectExplorer::IBuildStepFactory
 {
     Q_OBJECT
diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publishingbuildsettingspageovi.h b/src/plugins/qt4projectmanager/qt-s60/s60publishingbuildsettingspageovi.h
index 7b5977e63a4e64fc0e7f6b1c442efa74d30e6e95..b117085fdb7263c6042f796c2724c4e271e467f1 100644
--- a/src/plugins/qt4projectmanager/qt-s60/s60publishingbuildsettingspageovi.h
+++ b/src/plugins/qt4projectmanager/qt-s60/s60publishingbuildsettingspageovi.h
@@ -35,18 +35,6 @@
 
 #include <QtGui/QWizardPage>
 
-QT_BEGIN_NAMESPACE
-
-namespace Qt4ProjectManager {
-namespace Internal {
-namespace Ui {
-class S60PublishingBuildSettingsPageOvi;
-} // namespace Ui
-} // namespace Internal
-} // namespace Qt4ProjectManager
-
-QT_END_NAMESPACE
-
 namespace ProjectExplorer {
 class Project;
 class BuildConfiguration;
@@ -55,13 +43,19 @@ class ToolChain;
 
 namespace Qt4ProjectManager {
 namespace Internal {
+
+namespace Ui { class S60PublishingBuildSettingsPageOvi; }
+
 class S60PublisherOvi;
 
+
 class S60PublishingBuildSettingsPageOvi : public QWizardPage
 {
     Q_OBJECT
+
 public:
-    explicit S60PublishingBuildSettingsPageOvi(S60PublisherOvi *publisher, const ProjectExplorer::Project *project, QWidget *parent = 0);
+    explicit S60PublishingBuildSettingsPageOvi(S60PublisherOvi *publisher,
+        const ProjectExplorer::Project *project, QWidget *parent = 0);
     ~S60PublishingBuildSettingsPageOvi();
 
     virtual bool isComplete() const;
@@ -80,7 +74,7 @@ private:
 private:
     ProjectExplorer::BuildConfiguration *m_bc;
     ProjectExplorer::ToolChain *m_toolchain;
-    Ui::S60PublishingBuildSettingsPageOvi * m_ui;
+    Ui::S60PublishingBuildSettingsPageOvi *m_ui;
     S60PublisherOvi * const m_publisher;
 };
 
diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.h b/src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.h
index 764315c298322ac60476eaebebe3ef93e529ddea..95f0342ccb8056ff2d5ef929d0c277c43c9b7cd3 100644
--- a/src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.h
+++ b/src/plugins/qt4projectmanager/qt-s60/s60publishingresultspageovi.h
@@ -35,25 +35,17 @@
 
 #include <QWizardPage>
 
-QT_BEGIN_NAMESPACE
-
 namespace Qt4ProjectManager {
 namespace Internal {
-namespace Ui {
-class S60PublishingResultsPageOvi;
-} // namespace Ui
-} // namespace Internal
-} // namespace Qt4ProjectManager
-
-QT_END_NAMESPACE
 
-namespace Qt4ProjectManager {
-namespace Internal {
 class S60PublisherOvi;
 
+namespace Ui { class S60PublishingResultsPageOvi; }
+
 class S60PublishingResultsPageOvi : public QWizardPage
 {
     Q_OBJECT
+
 public:
     explicit S60PublishingResultsPageOvi(S60PublisherOvi *publisher, QWidget *parent = 0);
     ~S60PublishingResultsPageOvi();
diff --git a/src/plugins/qt4projectmanager/qt-s60/s60publishingsissettingspageovi.h b/src/plugins/qt4projectmanager/qt-s60/s60publishingsissettingspageovi.h
index a6362b68026ebce92260045ba66a906f8ec69d9b..3da6ca41123b2833f3689413f872ac69593bec56 100644
--- a/src/plugins/qt4projectmanager/qt-s60/s60publishingsissettingspageovi.h
+++ b/src/plugins/qt4projectmanager/qt-s60/s60publishingsissettingspageovi.h
@@ -36,25 +36,18 @@
 #include <QtGui/QWizardPage>
 
 QT_BEGIN_NAMESPACE
-
-namespace Qt4ProjectManager {
-namespace Internal {
-namespace Ui {
-class S60PublishingSisSettingsPageOvi;
-} // namespace Ui
-} // namespace Internal
-} // namespace Qt4ProjectManager
-
 class QLabel;
-
 QT_END_NAMESPACE
 
 namespace ProjectExplorer { class Project; }
 
 namespace Qt4ProjectManager {
 namespace Internal {
+
 class S60PublisherOvi;
 
+namespace Ui { class S60PublishingSisSettingsPageOvi; }
+
 class S60PublishingSisSettingsPageOvi : public QWizardPage
 {
     Q_OBJECT
@@ -75,7 +68,8 @@ private slots:
     void displayNameChanged();
 
 private:
-    void reflectSettingState(bool settingState, QLabel *okLabel, QLabel *errorLabel, QLabel *errorReasonLabel, const QString &errorReason);
+    void reflectSettingState(bool settingState, QLabel *okLabel,
+        QLabel *errorLabel, QLabel *errorReasonLabel, const QString &errorReason);
     void showWarningsForUnenforcableChecks();
 
     Ui::S60PublishingSisSettingsPageOvi *ui;
diff --git a/src/plugins/remotelinux/linuxdeviceconfigurationssettingswidget.h b/src/plugins/remotelinux/linuxdeviceconfigurationssettingswidget.h
index 734e8ffd9680c8a64dbe703bdc77eb8e2f886300..feef8a03a5231acdb1a9d915e5bbe715091e5baa 100644
--- a/src/plugins/remotelinux/linuxdeviceconfigurationssettingswidget.h
+++ b/src/plugins/remotelinux/linuxdeviceconfigurationssettingswidget.h
@@ -39,18 +39,8 @@
 #include <QtGui/QWidget>
 
 QT_BEGIN_NAMESPACE
-
 class QLineEdit;
 class QSignalMapper;
-
-namespace RemoteLinux {
-namespace Internal {
-namespace Ui {
-class LinuxDeviceConfigurationsSettingsWidget;
-} // namespace Ui
-} // namespace Internal
-} // namespace RemoteLinux
-
 QT_END_NAMESPACE
 
 namespace RemoteLinux {
@@ -59,6 +49,7 @@ class LinuxDeviceConfiguration;
 class LinuxDeviceConfigurations;
 
 namespace Internal {
+namespace Ui { class LinuxDeviceConfigurationsSettingsWidget; }
 class NameValidator;
 
 class LinuxDeviceConfigurationsSettingsWidget : public QWidget
diff --git a/src/plugins/remotelinux/linuxdevicefactoryselectiondialog.h b/src/plugins/remotelinux/linuxdevicefactoryselectiondialog.h
index 48067132e1c4c94ac42f11976646276d4f9d5343..e598e36b8de910b6505aa318a9c0469e57a00c39 100644
--- a/src/plugins/remotelinux/linuxdevicefactoryselectiondialog.h
+++ b/src/plugins/remotelinux/linuxdevicefactoryselectiondialog.h
@@ -29,28 +29,18 @@
 ** Nokia at qt-info@nokia.com.
 **
 **************************************************************************/
+
 #ifndef LINUXDEVICEFACTORYSELECTIONDIALOG_H
 #define LINUXDEVICEFACTORYSELECTIONDIALOG_H
 
 #include <QtCore/QList>
 #include <QtGui/QDialog>
 
-QT_BEGIN_NAMESPACE
-
-namespace RemoteLinux {
-namespace Internal {
-namespace Ui {
-class LinuxDeviceFactorySelectionDialog;
-} // namespace Ui
-} // namespace Internal
-} // namespace RemoteLinux
-
-QT_END_NAMESPACE
-
 namespace RemoteLinux {
 class ILinuxDeviceConfigurationFactory;
 
 namespace Internal {
+namespace Ui { class LinuxDeviceFactorySelectionDialog; }
 
 class LinuxDeviceFactorySelectionDialog : public QDialog
 {
diff --git a/src/plugins/remotelinux/profilesupdatedialog.h b/src/plugins/remotelinux/profilesupdatedialog.h
index 72248bb8cb82480ba535e28d3caed364757f9775..8e0ace51161c1abf2d6012421c86bf2d6d6f332c 100644
--- a/src/plugins/remotelinux/profilesupdatedialog.h
+++ b/src/plugins/remotelinux/profilesupdatedialog.h
@@ -29,6 +29,7 @@
 ** Nokia at qt-info@nokia.com.
 **
 **************************************************************************/
+
 #ifndef PROFILESUPDATEDIALOG_H
 #define PROFILESUPDATEDIALOG_H
 
@@ -37,22 +38,11 @@
 #include <QtCore/QString>
 #include <QtGui/QDialog>
 
-QT_BEGIN_NAMESPACE
-
-namespace RemoteLinux {
-namespace Internal {
-namespace Ui {
-class ProFilesUpdateDialog;
-} // namespace Ui
-} // namespace Internal
-} // namespace RemoteLinux
-
-QT_END_NAMESPACE
-
 namespace RemoteLinux {
 class DeployableFilesPerProFile;
 
 namespace Internal {
+namespace Ui { class ProFilesUpdateDialog; }
 
 class ProFilesUpdateDialog : public QDialog
 {
diff --git a/src/plugins/texteditor/codestyleselectorwidget.h b/src/plugins/texteditor/codestyleselectorwidget.h
index 37bb33ea246154235b60965c5b5552adc4d738b6..e07b40454b3867d57bda649a368536190852a152 100644
--- a/src/plugins/texteditor/codestyleselectorwidget.h
+++ b/src/plugins/texteditor/codestyleselectorwidget.h
@@ -38,25 +38,17 @@
 #include <QtGui/QWidget>
 
 QT_BEGIN_NAMESPACE
-
 class QHBoxLayout;
 class QComboBox;
 class QLabel;
 class QCheckBox;
 class QPushButton;
-
-namespace TextEditor {
-namespace Internal {
-namespace Ui {
-class CodeStyleSelectorWidget;
-} // namespace Ui
-} // namespace Internal
-} // namespace TextEditor
-
 QT_END_NAMESPACE
 
 namespace TextEditor {
 
+namespace Internal { namespace Ui { class CodeStyleSelectorWidget; } }
+
 class ICodeStylePreferences;
 class ICodeStylePreferencesFactory;
 
@@ -70,8 +62,6 @@ public:
     void setCodeStyle(TextEditor::ICodeStylePreferences *codeStyle);
     QString searchKeywords() const;
 
-signals:
-
 private slots:
     void slotComboBoxActivated(int index);
     void slotCurrentDelegateChanged(TextEditor::ICodeStylePreferences *delegate);
diff --git a/src/plugins/texteditor/tabsettingswidget.h b/src/plugins/texteditor/tabsettingswidget.h
index 4194cfd052612beab382da8a1c7320d8eb2d3c2e..a8d616fa17b1bd616e9956281e5613c83116e6ba 100644
--- a/src/plugins/texteditor/tabsettingswidget.h
+++ b/src/plugins/texteditor/tabsettingswidget.h
@@ -35,22 +35,12 @@
 
 #include "texteditor_global.h"
 
-QT_BEGIN_NAMESPACE
-
-namespace TextEditor {
-namespace Internal {
-namespace Ui {
-class TabSettingsWidget;
-} // namespace Ui
-} // namespace Internal
-} // namespace TextEditor
-
-QT_END_NAMESPACE
-
 #include <QtGui/QWidget>
 
 namespace TextEditor {
 
+namespace Internal { namespace Ui { class TabSettingsWidget; } }
+
 class TabSettings;
 
 class TEXTEDITOR_EXPORT TabSettingsWidget : public QWidget
diff --git a/src/plugins/vcsbase/basecheckoutwizardpage.h b/src/plugins/vcsbase/basecheckoutwizardpage.h
index 79faa6cb686726d30574ca3ee97224a1701aa0d3..b50dbcdd71cb32731841f3efdbb7e84affc4cf96 100644
--- a/src/plugins/vcsbase/basecheckoutwizardpage.h
+++ b/src/plugins/vcsbase/basecheckoutwizardpage.h
@@ -37,24 +37,22 @@
 
 #include <QtGui/QWizardPage>
 
-QT_BEGIN_NAMESPACE
-
 namespace VCSBase {
+
 namespace Internal {
 namespace Ui {
 class BaseCheckoutWizardPage;
 } // namespace Ui
 } // namespace Internal
-} // namespace VCSBase
-QT_END_NAMESPACE
-
-namespace VCSBase {
 
 struct BaseCheckoutWizardPagePrivate;
 
-class VCSBASE_EXPORT BaseCheckoutWizardPage : public QWizardPage {
+class VCSBASE_EXPORT BaseCheckoutWizardPage : public QWizardPage
+{
     Q_OBJECT
-    Q_PROPERTY(bool isBranchSelectorVisible READ isBranchSelectorVisible WRITE setBranchSelectorVisible)
+    Q_PROPERTY(bool isBranchSelectorVisible READ isBranchSelectorVisible
+        WRITE setBranchSelectorVisible)
+
 public:
     BaseCheckoutWizardPage(QWidget *parent = 0);
     ~BaseCheckoutWizardPage();
@@ -85,21 +83,21 @@ protected:
     void setDirectoryVisible(bool v);
     void setBranchSelectorVisible(bool v);
 
-    /* Determine a checkout directory name from
-     * repository URL, that is, "protocol:/project" -> "project". */
+    // Determine a checkout directory name from
+    // repository URL, that is, "protocol:/project" -> "project".
     virtual QString directoryFromRepository(const QString &r) const;
 
-    /* Return list of branches of that repository, defaults to empty. */
+    // Return list of branches of that repository, defaults to empty.
     virtual QStringList branches(const QString &repository, int *current);
 
-    /* Add additional controls */
+    // Add additional controls.
     void addLocalControl(QWidget *w);
     void addLocalControl(QString &description, QWidget *w);
 
     void addRepositoryControl(QWidget *w);
     void addRepositoryControl(QString &description, QWidget *w);
 
-    /* Override validity information */
+    // Override validity information.
     virtual bool checkIsValid() const;
 
 private slots:
diff --git a/src/plugins/vcsbase/commonsettingspage.h b/src/plugins/vcsbase/commonsettingspage.h
index c13f556c3de448e686da704614da1c4b0a00b161..c4b729dc4d1b367780e290b177b9d1892620a0fe 100644
--- a/src/plugins/vcsbase/commonsettingspage.h
+++ b/src/plugins/vcsbase/commonsettingspage.h
@@ -40,20 +40,10 @@
 #include <QtCore/QPointer>
 #include <QtGui/QWidget>
 
-QT_BEGIN_NAMESPACE
-
 namespace VCSBase {
 namespace Internal {
-namespace Ui {
-class CommonSettingsPage;
-} // namespace Ui
-} // namespace Internal
-} // namespace VCSBase
 
-QT_END_NAMESPACE
-
-namespace VCSBase {
-namespace Internal {
+namespace Ui { class CommonSettingsPage; }
 
 class CommonSettingsWidget : public QWidget
 {
@@ -96,7 +86,7 @@ signals:
 private:
     void updateNickNames();
 
-    CommonSettingsWidget* m_widget;
+    CommonSettingsWidget *m_widget;
     CommonVcsSettings m_settings;
     QString m_searchKeyWords;
 };
diff --git a/src/plugins/vcsbase/nicknamedialog.h b/src/plugins/vcsbase/nicknamedialog.h
index 0f1dc9e6ae37ede6b36f23ac1b23a4b47ee6ef1c..9558fb1e5ab3e79ca9003ddb9c26ffb229d8da8d 100644
--- a/src/plugins/vcsbase/nicknamedialog.h
+++ b/src/plugins/vcsbase/nicknamedialog.h
@@ -36,27 +36,21 @@
 #include <QtGui/QDialog>
 
 QT_BEGIN_NAMESPACE
-
-namespace VCSBase {
-namespace Internal {
-namespace Ui {
-class NickNameDialog;
-} // namespace Ui
-} // namespace Internal
-} // namespace VCSBase
-
 class QSortFilterProxyModel;
 class QStandardItemModel;
 class QModelIndex;
 class QPushButton;
-
 QT_END_NAMESPACE
 
 namespace VCSBase {
 namespace Internal {
 
-class NickNameDialog : public QDialog {
+namespace Ui { class NickNameDialog; }
+
+class NickNameDialog : public QDialog
+{
     Q_OBJECT
+
 public:
     explicit NickNameDialog(QStandardItemModel *model, QWidget *parent = 0);
     virtual ~NickNameDialog();
@@ -82,7 +76,6 @@ private:
     Ui::NickNameDialog *m_ui;
     QStandardItemModel *m_model;
     QSortFilterProxyModel *m_filterModel;
-
 };
 
 } // namespace Internal