Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 58864)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 58865)
@@ -4071,9 +4071,18 @@
     QString vmNameOrUuid;
 
+#if QT_VERSION >= 0x050000
+    const QStringList arguments = qApp->arguments();
+    const int argc = arguments.size();
+#else /* QT_VERSION < 0x050000 */
     int argc = qApp->argc();
+#endif /* QT_VERSION < 0x050000 */
     int i = 1;
     while (i < argc)
     {
+#if QT_VERSION >= 0x050000
+        const char *arg = arguments.at(i).toLocal8Bit().constData();
+#else /* QT_VERSION < 0x050000 */
         const char *arg = qApp->argv() [i];
+#endif /* QT_VERSION < 0x050000 */
         /* NOTE: the check here must match the corresponding check for the
          * options to start a VM in main.cpp and hardenedmain.cpp exactly,
@@ -4084,5 +4093,9 @@
             if (++i < argc)
             {
+#if QT_VERSION >= 0x050000
+                vmNameOrUuid = arguments.at(i);
+#else /* QT_VERSION < 0x050000 */
                 vmNameOrUuid = QString (qApp->argv() [i]);
+#endif /* QT_VERSION < 0x050000 */
                 startVM = true;
             }
@@ -4096,5 +4109,9 @@
         {
             if (++i < argc)
+# if QT_VERSION >= 0x050000
+                m_strPidfile = arguments.at(i);
+# else /* QT_VERSION < 0x050000 */
                 m_strPidfile = QString(qApp->argv()[i]);
+# endif /* QT_VERSION < 0x050000 */
         }
 #endif /* VBOX_GUI_WITH_PIDFILE */
@@ -4113,5 +4130,9 @@
             if (++i < argc)
             {
+#if QT_VERSION >= 0x050000
+                RTStrCopy(mSettingsPw, sizeof(mSettingsPw), arguments.at(i).toLocal8Bit().constData());
+#else /* QT_VERSION < 0x050000 */
                 RTStrCopy(mSettingsPw, sizeof(mSettingsPw), qApp->argv() [i]);
+#endif /* QT_VERSION < 0x050000 */
                 mSettingsPwSet = true;
             }
@@ -4122,5 +4143,9 @@
             {
                 size_t cbFile;
+#if QT_VERSION >= 0x050000
+                const char *pszFile = arguments.at(i).toLocal8Bit().constData();
+#else /* QT_VERSION < 0x050000 */
                 char *pszFile = qApp->argv() [i];
+#endif /* QT_VERSION < 0x050000 */
                 bool fStdIn = !::strcmp(pszFile, "stdin");
                 int vrc = VINF_SUCCESS;
@@ -4166,10 +4191,18 @@
         {
             if (++i < argc)
+# if QT_VERSION >= 0x050000
+                m_strFloppyImage = arguments.at(i);
+# else /* QT_VERSION < 0x050000 */
                 m_strFloppyImage = qApp->argv()[i];
+# endif /* QT_VERSION < 0x050000 */
         }
         else if (!::strcmp(arg, "--dvd") || !::strcmp(arg, "--cdrom"))
         {
             if (++i < argc)
+# if QT_VERSION >= 0x050000
+                m_strDvdImage = arguments.at(i);
+# else /* QT_VERSION < 0x050000 */
                 m_strDvdImage = qApp->argv()[i];
+# endif /* QT_VERSION < 0x050000 */
         }
         /* VMM Options: */
@@ -4189,5 +4222,9 @@
         {
             if (++i < argc)
+#if QT_VERSION >= 0x050000
+                mWarpPct = RTStrToUInt32(arguments.at(i).toLocal8Bit().constData());
+#else /* QT_VERSION < 0x050000 */
                 mWarpPct = RTStrToUInt32(qApp->argv() [i]);
+#endif /* QT_VERSION < 0x050000 */
         }
 #ifdef VBOX_WITH_DEBUGGER_GUI
