diff --git a/src/plugins/qmldesigner/components/propertyeditor/contextpanewidgetimage.h b/src/plugins/qmldesigner/components/propertyeditor/contextpanewidgetimage.h
index 8f155fa967f1a8f80abc05ed9c6a9db76351ed72..ed16f5a97a82eba2a8e766f64ba9f953d31f20da 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/contextpanewidgetimage.h
+++ b/src/plugins/qmldesigner/components/propertyeditor/contextpanewidgetimage.h
@@ -3,10 +3,11 @@
 
 #include <QWidget>
 
+QT_BEGIN_NAMESPACE
 namespace Ui {
     class ContextPaneWidgetImage;
 }
-
+QT_END_NAMESPACE
 
 namespace QmlJS {
     class PropertyReader;
diff --git a/src/plugins/qmldesigner/components/propertyeditor/contextpanewidgetrectangle.h b/src/plugins/qmldesigner/components/propertyeditor/contextpanewidgetrectangle.h
index 595117f342d91fe3465921f8e47de3efbc4e634c..6dd3d7594f48bb403463f30b25995f4a9da8b65d 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/contextpanewidgetrectangle.h
+++ b/src/plugins/qmldesigner/components/propertyeditor/contextpanewidgetrectangle.h
@@ -3,9 +3,11 @@
 
 #include <QWidget>
 
+QT_BEGIN_NAMESPACE
 namespace Ui {
     class ContextPaneWidgetRectangle;
 }
+QT_END_NAMESPACE
 
 namespace QmlJS {
     class PropertyReader;