--- src/libs/utils/environment.cpp.orig	2012-08-08 15:47:06.000000000 +0200
+++ src/libs/utils/environment.cpp	2012-09-22 16:10:03.000000000 +0200
@@ -110,6 +110,7 @@
                 m_values.insert(s.left(i), s.mid(i+1));
         }
     }
+    prependOrSetPath(QLatin1String("@@PREFIX@@/bin"));
 }
 
 QStringList Environment::toStringList() const
--- src/plugins/qtsupport/baseqtversion.cpp.orig	2012-08-08 15:47:06.000000000 +0200
+++ src/plugins/qtsupport/baseqtversion.cpp	2012-09-22 13:42:33.000000000 +0200
@@ -747,10 +747,14 @@
     default:
         Q_ASSERT(false);
     }
-    foreach (const QString &possibleCommand, possibleCommands) {
-        const QString fullPath = baseDir + possibleCommand;
-        if (QFileInfo(fullPath).isFile())
-            return QDir::cleanPath(fullPath);
+    QStringList baseDirs(baseDir);
+    baseDirs << QLatin1String("@@QT_APPS_DIR@@/");
+    foreach (const QString &currBaseDir, baseDirs) {
+        foreach (const QString &possibleCommand, possibleCommands) {
+            const QString fullPath = currBaseDir + possibleCommand;
+            if (QFileInfo(fullPath).isFile())
+                return QDir::cleanPath(fullPath);
+        }
     }
     return QString();
 }
