--- a/core/dplugins/generic/tools/htmlgallery/generator/gallerytheme.cpp
+++ b/core/dplugins/generic/tools/htmlgallery/generator/gallerytheme.cpp
@@ -13,6 +13,9 @@
  *
  * ============================================================ */
 
+#ifdef QT_NO_CAST_FROM_ASCII
+#undef QT_NO_CAST_FROM_ASCII
+#endif
 #include "gallerytheme.h"
 
 // Qt includes
--- a/core/libs/dplugins/webservices/o2/src/o0baseauth.cpp
+++ b/core/libs/dplugins/webservices/o2/src/o0baseauth.cpp
@@ -1,3 +1,6 @@
+#ifdef QT_NO_CAST_FROM_ASCII
+#undef QT_NO_CAST_FROM_ASCII
+#endif
 #include <QDataStream>
 #include <QDebug>
 #include <QUrlQuery>
