Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.cpp	(revision 58849)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIDnDHandler.cpp	(revision 58850)
@@ -283,9 +283,8 @@
 QTextStream *g_pStrmLogQt = NULL; /* Output stream for Qt debug logging. */
 
+# if QT_VERSION >= 0x050000
 /* static */
-void UIDnDHandler::debugOutputQt(QtMsgType type, const char *pszMsg)
-{
-    AssertPtr(pszMsg);
-
+void UIDnDHandler::debugOutputQt(QtMsgType type, const QMessageLogContext &context, const QString &strMessage)
+{
     QString strMsg;
     switch (type)
@@ -307,6 +306,34 @@
 
     if (g_pStrmLogQt)
+        (*g_pStrmLogQt) << strMsg << " " << strMessage << endl;
+}
+# else /* QT_VERSION < 0x050000 */
+/* static */
+void UIDnDHandler::debugOutputQt(QtMsgType type, const char *pszMsg)
+{
+    AssertPtr(pszMsg);
+
+    QString strMsg;
+    switch (type)
+    {
+    case QtWarningMsg:
+        strMsg += "[W]";
+        break;
+    case QtCriticalMsg:
+        strMsg += "[C]";
+        break;
+    case QtFatalMsg:
+        strMsg += "[F]";
+        break;
+    case QtDebugMsg:
+    default:
+        strMsg += "[D]";
+        break;
+    }
+
+    if (g_pStrmLogQt)
         (*g_pStrmLogQt) << strMsg << " " << pszMsg << endl;
 }
+# endif /* QT_VERSION < 0x050000 */
 #endif /* DEBUG_DND_QT */
 
@@ -335,5 +362,9 @@
         g_pStrmLogQt = new QTextStream(pFileDebugQt);
 
+#if QT_VERSION >= 0x050000
+        qInstallMessageHandler(UIDnDHandler::debugOutputQt);
+#else /* QT_VERSION < 0x050000 */
         qInstallMsgHandler(UIDnDHandler::debugOutputQt);
+#endif /* QT_VERSION < 0x050000 */
         qDebug("========================================================================");
     }
