Index: /trunk/src/VBox/Frontends/VirtualBox4/include/QIMessageBox.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/include/QIMessageBox.h	(revision 7368)
+++ /trunk/src/VBox/Frontends/VirtualBox4/include/QIMessageBox.h	(revision 7369)
@@ -20,11 +20,9 @@
 #define __QIMessageBox_h__
 
-#include <qdialog.h>
-#include <q3vbox.h>
-#include <qmessagebox.h>
-#include <qcheckbox.h>
-#include <q3textedit.h>
-//Added by qt3to4:
-#include <QLabel>
+/* Qt includes */
+#include <QDialog>
+#include <QMessageBox>
+#include <QCheckBox>
+#include <QTextEdit>
 
 class QIRichLabel;
@@ -68,5 +66,5 @@
     void setButtonText (int aButton, const QString &aText);
 
-    QString flagText() const { return mFlagCB->isShown() ? mFlagCB->text() : QString::null; }
+    QString flagText() const { return mFlagCB->isVisible() ? mFlagCB->text() : QString::null; }
     void setFlagText (const QString &aText);
 
@@ -74,13 +72,13 @@
     void setFlagChecked (bool aChecked) { mFlagCB->setChecked (aChecked); }
 
-    QString detailsText () const { return mDetailsText->text(); }
+    QString detailsText () const { return mDetailsText->toHtml(); }
     void setDetailsText (const QString &aText);
 
-    bool isDetailsShown() const { return mDetailsVBox->isShown(); }
+    bool isDetailsShown() const { return mDetailsVBox->isVisible(); }
     void setDetailsShown (bool aShown);
 
 private:
 
-    QPushButton *createButton (QWidget *aParent, int aButton);
+    QPushButton *createButton (int aButton);
 
 private slots:
@@ -102,8 +100,7 @@
     QIRichLabel *mTextLabel;
     QPushButton *mButton0PB, *mButton1PB, *mButton2PB;
-    Q3VBox *mMessageVBox;
     QCheckBox *mFlagCB, *mFlagCB_Main, *mFlagCB_Details;
-    Q3VBox *mDetailsVBox;
-    Q3TextEdit *mDetailsText;
+    QWidget *mDetailsVBox;
+    QTextEdit *mDetailsText;
     QSpacerItem *mSpacer;
 };
Index: /trunk/src/VBox/Frontends/VirtualBox4/include/QIStateIndicator.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/include/QIStateIndicator.h	(revision 7368)
+++ /trunk/src/VBox/Frontends/VirtualBox4/include/QIStateIndicator.h	(revision 7369)
@@ -20,13 +20,9 @@
 #define __QIStateIndicator_h__
 
-#include <q3frame.h>
-#include <qpixmap.h>
+/* Qt includes */
+#include <QFrame>
+#include <QHash>
 
-#include <q3intdict.h>
-//Added by qt3to4:
-#include <QMouseEvent>
-#include <QContextMenuEvent>
-
-class QIStateIndicator : public Q3Frame
+class QIStateIndicator : public QFrame
 {
     Q_OBJECT
@@ -34,7 +30,6 @@
 public:
 
-    QIStateIndicator (int aState,
-                      QWidget *aParent, const char *aName = 0,
-                      Qt::WFlags aFlags = 0);
+    QIStateIndicator (int aState, QWidget *aParent);
+    ~QIStateIndicator();
 
     virtual QSize sizeHint() const;
@@ -59,4 +54,5 @@
 protected:
 
+    virtual void paintEvent (QPaintEvent *event);
     virtual void drawContents (QPainter *aPainter);
 
@@ -85,5 +81,5 @@
     };
 
-    Q3IntDict <Icon> mStateIcons;
+    QHash <int, Icon *> mStateIcons;
 };
 
Index: /trunk/src/VBox/Frontends/VirtualBox4/include/QIStatusBar.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/include/QIStatusBar.h	(revision 7368)
+++ /trunk/src/VBox/Frontends/VirtualBox4/include/QIStatusBar.h	(revision 7369)
@@ -20,7 +20,6 @@
 #define __QIStatusBar_h__
 
-#include <qstatusbar.h>
-//Added by qt3to4:
-#include <QPaintEvent>
+/* Qt includes */
+#include <QStatusBar>
 
 class QPaintEvent;
@@ -32,5 +31,5 @@
 public:
 
-    QIStatusBar (QWidget *parent = 0, const char *name = 0);
+    QIStatusBar (QWidget *parent = 0);
 
 protected:
Index: /trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleWnd.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleWnd.h	(revision 7368)
+++ /trunk/src/VBox/Frontends/VirtualBox4/include/VBoxConsoleWnd.h	(revision 7369)
@@ -30,4 +30,5 @@
 //Added by qt3to4:
 #include <QContextMenuEvent>
+#include <q3hbox.h>
 #include <QLabel>
 #include <Q3PopupMenu>
Index: /trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h	(revision 7368)
+++ /trunk/src/VBox/Frontends/VirtualBox4/include/VBoxGlobal.h	(revision 7369)
@@ -733,5 +733,5 @@
  *  This class provides enable/disable menu items.
  */
-class VBoxSwitchMenu : public Q3PopupMenu
+class VBoxSwitchMenu : public QMenu
 {
     Q_OBJECT
@@ -747,10 +747,9 @@
     void processAboutToShow();
 
-    void processActivated (int);
+//    void processActivated (int);
 
 private:
 
     QAction *mAction;
-    QString  mTip;
     bool     mInverted;
 };
Index: /trunk/src/VBox/Frontends/VirtualBox4/include/VBoxProblemReporter.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/include/VBoxProblemReporter.h	(revision 7368)
+++ /trunk/src/VBox/Frontends/VirtualBox4/include/VBoxProblemReporter.h	(revision 7369)
@@ -23,7 +23,6 @@
 #include "QIMessageBox.h"
 
-#include <qobject.h>
-
-class Q3Process;
+/* Qt icludes */
+#include <QObject>
 
 class VBoxProblemReporter : public QObject
Index: /trunk/src/VBox/Frontends/VirtualBox4/src/QIMessageBox.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/src/QIMessageBox.cpp	(revision 7368)
+++ /trunk/src/VBox/Frontends/VirtualBox4/src/QIMessageBox.cpp	(revision 7369)
@@ -18,18 +18,11 @@
 
 #include "QIMessageBox.h"
-//Added by qt3to4:
-#include <Q3HBoxLayout>
-#include <q3mimefactory.h>
-#include <Q3VBoxLayout>
 #include "VBoxDefs.h"
 #include "QIRichLabel.h"
 
-#include <qpixmap.h>
-#include <qlabel.h>
-#include <qpushbutton.h>
-#include <q3hbox.h>
-#include <qlayout.h>
-
-#include <qfontmetrics.h>
+/* Qt includes */
+#include <QHBoxLayout>
+#include <QPushButton>
+#include <QLabel>
 
 /** @class QIMessageBox
@@ -54,5 +47,5 @@
                         Qt::WStyle_Title | Qt::WStyle_SysMenu)
 {
-    setCaption (aCaption);
+    setWindowTitle (aCaption);
 
     mButton0 = aButton0;
@@ -60,17 +53,17 @@
     mButton2 = aButton2;
 
-    Q3VBoxLayout *layout = new Q3VBoxLayout (this);
-    /* setAutoAdd() behavior is really poor (it messes up with the order
-     * of widgets), never use it: layout->setAutoAdd (true); */
+    QVBoxLayout *layout = new QVBoxLayout (this);
     layout->setMargin (11);
     layout->setSpacing (10);
-    layout->setResizeMode (QLayout::SetMinimumSize);
-
-    Q3HBox *main = new Q3HBox (this);
-    main->setMargin (0);
-    main->setSpacing (10);
+    layout->setSizeConstraint (QLayout::SetMinimumSize);
+
+    QWidget *main = new QWidget();
+
+    QHBoxLayout *hLayout = new QHBoxLayout (main);
+    hLayout->setContentsMargins (0, 0, 0, 0);
+    hLayout->setSpacing (10);
     layout->addWidget (main);
 
-    mIconLabel = new QLabel (main);
+    mIconLabel = new QLabel();
 	if (aIcon < GuruMeditation)
         mIconLabel->setPixmap (QMessageBox::standardIcon ((QMessageBox::Icon) aIcon));
@@ -79,23 +72,31 @@
     mIconLabel->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::Minimum);
     mIconLabel->setAlignment (Qt::AlignHCenter | Qt::AlignTop);
-
-    mMessageVBox = new Q3VBox (main);
-    mMessageVBox->setMargin (0);
-    mMessageVBox->setSpacing (10);
-
-    mTextLabel = new QIRichLabel (aText, mMessageVBox);
+    hLayout->addWidget (mIconLabel);
+
+    QVBoxLayout* messageVBoxLayout = new QVBoxLayout();
+    messageVBoxLayout->setContentsMargins (0, 0, 0, 0);
+    messageVBoxLayout->setSpacing (10);
+    hLayout->addLayout (messageVBoxLayout);
+
+    mTextLabel = new QIRichLabel (aText, NULL);
     mTextLabel->setAlignment (Qt::AlignLeft | Qt::AlignTop | Qt::TextExpandTabs | Qt::TextWordWrap);
-    mTextLabel->setSizePolicy (QSizePolicy::Preferred, QSizePolicy::Preferred, true);
+    QSizePolicy sp (QSizePolicy::Preferred, QSizePolicy::Preferred);
+    sp.setHeightForWidth (true);
+    mTextLabel->setSizePolicy (sp);
     mTextLabel->setMinimumWidth (mTextLabel->sizeHint().width());
-
-    mFlagCB_Main = new QCheckBox (mMessageVBox);
+    messageVBoxLayout->addWidget (mTextLabel);
+
+    mFlagCB_Main = new QCheckBox();
     mFlagCB_Main->hide();
-
-    mDetailsVBox = new Q3VBox (this);
-    mDetailsVBox->setMargin (0);
-    mDetailsVBox->setSpacing (10);
+    messageVBoxLayout->addWidget (mFlagCB_Main);
+
+    mDetailsVBox = new QWidget();
     layout->addWidget (mDetailsVBox);
 
-    mDetailsText = new Q3TextEdit (mDetailsVBox);
+    QVBoxLayout* detailsVBoxLayout = new QVBoxLayout(mDetailsVBox);
+    detailsVBoxLayout->setContentsMargins (0, 0, 0, 0);
+    detailsVBoxLayout->setSpacing (10);
+
+    mDetailsText = new QTextEdit();
     {
         /* calculate the minimum size dynamically, approx. for 40 chars and
@@ -105,32 +106,41 @@
     }
     mDetailsText->setReadOnly (true);
-    mDetailsText->setWrapPolicy (Q3TextEdit::AtWordOrDocumentBoundary);
     mDetailsText->setSizePolicy (QSizePolicy::Expanding,
                                  QSizePolicy::MinimumExpanding);
-
-    mFlagCB_Details = new QCheckBox (mDetailsVBox);
+    detailsVBoxLayout->addWidget (mDetailsText);
+
+    mFlagCB_Details = new QCheckBox();
     mFlagCB_Details->hide();
+    detailsVBoxLayout->addWidget (mFlagCB_Details);
 
     mSpacer = new QSpacerItem (0, 0);
     layout->addItem (mSpacer);
 
-    Q3HBoxLayout *buttons = new Q3HBoxLayout (new QWidget (this));
-    layout->addWidget (buttons->mainWidget());
-    buttons->setAutoAdd (true);
-    buttons->setSpacing (5);
+    QHBoxLayout *buttonsHLayout = new QHBoxLayout();
+    buttonsHLayout->setSpacing (5);
+    layout->addLayout (buttonsHLayout);
 
     mButtonEsc = 0;
 
-    mButton0PB = createButton (buttons->mainWidget(), aButton0);
+    mButton0PB = createButton (aButton0);
     if (mButton0PB)
+    {
+        buttonsHLayout->addWidget (mButton0PB);
         connect (mButton0PB, SIGNAL (clicked()), SLOT (done0()));
-    mButton1PB = createButton (buttons->mainWidget(), aButton1);
+    }
+    mButton1PB = createButton (aButton1);
     if (mButton1PB)
+    {
+        buttonsHLayout->addWidget (mButton1PB);
         connect (mButton1PB, SIGNAL (clicked()), SLOT (done1()));
-    mButton2PB = createButton (buttons->mainWidget(), aButton2);
+    }
+    mButton2PB = createButton (aButton2);
     if (mButton2PB)
+    {
+        buttonsHLayout->addWidget (mButton2PB);
         connect (mButton2PB, SIGNAL (clicked()), SLOT (done2()));
-
-    buttons->setAlignment (Qt::AlignHCenter);
+    }
+
+    buttonsHLayout->setAlignment (Qt::AlignHCenter);
 
     /* this call is a must -- it initializes mFlagCB and mSpacer */
@@ -219,5 +229,5 @@
  */
 
-QPushButton *QIMessageBox::createButton (QWidget *aParent, int aButton)
+QPushButton *QIMessageBox::createButton (int aButton)
 {
     if (aButton == 0)
@@ -237,5 +247,5 @@
     }
 
-    QPushButton *b = new QPushButton (text, aParent);
+    QPushButton *b = new QPushButton (text);
 
     if (aButton & Default)
@@ -291,19 +301,19 @@
     if (aShown)
     {
-        mFlagCB_Details->setShown (mFlagCB_Main->isShown());
+        mFlagCB_Details->setVisible (mFlagCB_Main->isVisible());
         mFlagCB_Details->setChecked (mFlagCB_Main->isChecked());
         mFlagCB_Details->setText (mFlagCB_Main->text());
         if (mFlagCB_Main->hasFocus())
             mFlagCB_Details->setFocus();
-        mFlagCB_Main->setShown (false);
+        mFlagCB_Main->setVisible (false);
         mFlagCB = mFlagCB_Details;
         mSpacer->changeSize (0, 0, QSizePolicy::Minimum, QSizePolicy::Minimum);
     }
 
-    mDetailsVBox->setShown (aShown);
+    mDetailsVBox->setVisible (aShown);
 
     if (!aShown)
     {
-        mFlagCB_Main->setShown (mFlagCB_Details->isShown());
+        mFlagCB_Main->setVisible (mFlagCB_Details->isVisible());
         mFlagCB_Main->setChecked (mFlagCB_Details->isChecked());
         mFlagCB_Main->setText (mFlagCB_Details->text());
Index: /trunk/src/VBox/Frontends/VirtualBox4/src/QIStateIndicator.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/src/QIStateIndicator.cpp	(revision 7368)
+++ /trunk/src/VBox/Frontends/VirtualBox4/src/QIStateIndicator.cpp	(revision 7369)
@@ -19,10 +19,6 @@
 #include "QIStateIndicator.h"
 
-#include <qpainter.h>
-//Added by qt3to4:
-#include <QPixmap>
-#include <QMouseEvent>
-#include <Q3Frame>
-#include <QContextMenuEvent>
+/* Qt includes */
+#include <QPainter>
 
 /** @clas QIStateIndicator
@@ -40,11 +36,10 @@
  */
 QIStateIndicator::QIStateIndicator (int aState,
-                                    QWidget *aParent, const char *aName,
-                                    Qt::WFlags aFlags)
-    : Q3Frame (aParent, aName, aFlags | Qt::WStaticContents | Qt::WMouseNoMask)
+                                    QWidget *aParent)
+    : QFrame (aParent)
+//    : QFrame (aParent, aName, aFlags | Qt::WStaticContents | Qt::WMouseNoMask)
 {
     mState = aState;
     mSize = QSize (0, 0);
-    mStateIcons.setAutoDelete (true);
 
     setSizePolicy (QSizePolicy (QSizePolicy::Fixed, QSizePolicy::Fixed));
@@ -53,6 +48,11 @@
      * drawContents(), so try to set the correct bacground origin for the
      * case when a pixmap is used as a widget background. */
-    if (aParent)
-        setBackgroundOrigin (aParent->backgroundOrigin());
+//    if (aParent)
+//        setBackgroundOrigin (aParent->backgroundOrigin());
+}
+
+QIStateIndicator::~QIStateIndicator()
+{
+    qDeleteAll (mStateIcons);
 }
 
@@ -92,5 +92,11 @@
 {
     mState = aState;
-    repaint (false);
+    repaint();
+}
+
+void QIStateIndicator::paintEvent (QPaintEvent * /*event*/)
+{
+    QPainter painter(this);
+    drawContents(&painter);
 }
 
@@ -98,58 +104,56 @@
 {
     Icon *icon = mStateIcons [mState];
-    if (!icon)
+    if (icon)
     {
-        erase();
-    }
-    else
-    {
+#warning port me
+        /* I didn't see any benefits of caching the icon
+         * background drawing in Qt4. This is already done 
+         * by Qt itself. Also there is no "NoAutoErase" 
+         * anymore. Disable this for now. */
 //        if (testAttribute (Qt::WNoAutoErase))
-#warning port me
-        if(0)
-        {
-            QColor bgColor = paletteBackgroundColor();
-            const QPixmap *bgPixmap = paletteBackgroundPixmap();
-            QPoint bgOff = backgroundOffset();
-
-            bool bgOffChanged = icon->bgOff != bgOff;
-            bool bgPixmapChanged = icon->bgPixmap != bgPixmap ||
-                (icon->bgPixmap != NULL &&
-                 icon->bgPixmap->serialNumber() != bgPixmap->serialNumber());
-            bool bgColorChanged = icon->bgColor != bgColor;
-
-            /* re-precompose the pixmap if any of these have changed */
-            if (icon->cached.isNull() ||
-                bgOffChanged || bgPixmapChanged || bgColorChanged)
-            {
-                int w = icon->pixmap.width();
-                int h = icon->pixmap.height();
-                if (icon->cached.isNull())
-                    icon->cached = QPixmap (w, h);
-
-                if (bgPixmap || bgOffChanged || bgPixmapChanged)
-                {
-                    QPainter p (&icon->cached);
-                    p.drawTiledPixmap (QRect (0, 0, w, h), *bgPixmap, bgOff);
-                }
-                else
-                {
-                    icon->cached.fill (bgColor);
-                }
-                /* paint the icon on top of the widget background sample */
-#warning port me
+//        {
+//            QColor bgColor = paletteBackgroundColor();
+//            const QPixmap *bgPixmap = paletteBackgroundPixmap();
+//            QPoint bgOff = backgroundOffset();
+//
+//            bool bgOffChanged = icon->bgOff != bgOff;
+//            bool bgPixmapChanged = icon->bgPixmap != bgPixmap ||
+//                (icon->bgPixmap != NULL &&
+//                 icon->bgPixmap->serialNumber() != bgPixmap->serialNumber());
+//            bool bgColorChanged = icon->bgColor != bgColor;
+//
+//            /* re-precompose the pixmap if any of these have changed */
+//            if (icon->cached.isNull() ||
+//                bgOffChanged || bgPixmapChanged || bgColorChanged)
+//            {
+//                int w = icon->pixmap.width();
+//                int h = icon->pixmap.height();
+//                if (icon->cached.isNull())
+//                    icon->cached = QPixmap (w, h);
+//
+//                if (bgPixmap || bgOffChanged || bgPixmapChanged)
+//                {
+//                    QPainter p (&icon->cached);
+//                    p.drawTiledPixmap (QRect (0, 0, w, h), *bgPixmap, bgOff);
+//                }
+//                else
+//                {
+//                    icon->cached.fill (bgColor);
+//                }
+//                /* paint the icon on top of the widget background sample */
 //                bitBlt (&icon->cached, 0, 0, &icon->pixmap,
 //                        0, 0, w, h, CopyROP, false);
-                /* store the new values */
-                icon->bgColor = bgColor;
-                icon->bgPixmap = bgPixmap;
-                icon->bgOff = bgOff;
-            }
-            /* draw the precomposed pixmap */
-            aPainter->drawPixmap (contentsRect(), icon->cached);
-        }
-        else
-        {
+//                /* store the new values */
+//                icon->bgColor = bgColor;
+//                icon->bgPixmap = bgPixmap;
+//                icon->bgOff = bgOff;
+//            }
+//            /* draw the precomposed pixmap */
+//            aPainter->drawPixmap (contentsRect(), icon->cached);
+//        }
+//        else
+//        {
             aPainter->drawPixmap (contentsRect(), icon->pixmap);
-        }
+//        }
     }
 }
@@ -167,5 +171,5 @@
         aEv->accept();
     else
-        Q3Frame::mousePressEvent (aEv);
+        QFrame::mousePressEvent (aEv);
 }
 #endif /* Q_WS_MAC */
Index: /trunk/src/VBox/Frontends/VirtualBox4/src/QIStatusBar.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/src/QIStatusBar.cpp	(revision 7368)
+++ /trunk/src/VBox/Frontends/VirtualBox4/src/QIStatusBar.cpp	(revision 7369)
@@ -19,8 +19,7 @@
 #include "QIStatusBar.h"
 
-#include <qpainter.h>
-#include <qsizegrip.h>
-//Added by qt3to4:
-#include <QPaintEvent>
+/* Qt includes */
+#include <QPainter>
+//#include <qsizegrip.h>
 
 /** @clas QIStatusLine
@@ -31,6 +30,6 @@
  */
 
-QIStatusBar::QIStatusBar (QWidget *parent, const char *name) :
-    QStatusBar (parent, name)
+QIStatusBar::QIStatusBar (QWidget *parent) :
+    QStatusBar (parent)
 {
     connect (
@@ -44,20 +43,25 @@
  *  widgets.
  */
-void QIStatusBar::paintEvent (QPaintEvent *)
+void QIStatusBar::paintEvent (QPaintEvent *e)
 {
-    QPainter p (this);
-
-#ifndef QT_NO_SIZEGRIP
+    QStatusBar::paintEvent (e);
+    return;
+#warning port me: is this needed anymore?
+//    QPainter p (this);
+//
+//#ifndef QT_NO_SIZEGRIP
     // this will work provided that QStatusBar::setSizeGripEnabled() names
     // its resizer child as specified (at least Qt 3.3.x does this).
-    QSizeGrip *resizer = (QSizeGrip *) child ("QStatusBar::resizer", "QSizeGrip");
-    int psx = (resizer && resizer->isVisible()) ? resizer->x() : width() - 12;
-#else
-    int psx = width() - 12;
-#endif
-
-    if (!message.isEmpty()) {
-        p.setPen (colorGroup().foreground());
-        p.drawText (6, 0, psx, height(), Qt::AlignVCenter | Qt::TextSingleLine, message);
-    }
+//#warning port me: check this
+//    QSizeGrip *resizer = (QSizeGrip *) child ("QStatusBar::resizer", "QSizeGrip");
+//    int psx = (resizer && resizer->isVisible()) ? resizer->x() : width() - 12;
+//#else
+//    int psx = width() - 12;
+//#endif
+//
+//    if (!message.isEmpty()) 
+//    {
+//        p.setPen (colorGroup().foreground());
+//        p.drawText (6, 0, psx, height(), Qt::AlignVCenter | Qt::TextSingleLine, message);
+//    }
 }
Index: /trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp	(revision 7368)
+++ /trunk/src/VBox/Frontends/VirtualBox4/src/VBoxConsoleWnd.cpp	(revision 7369)
@@ -159,5 +159,5 @@
 
     /* ensure status bar is created */
-    new QIStatusBar (this, "statusBar");
+    new QIStatusBar (this);
 
     ///// Actions ///////////////////////////////////////////////////////////
@@ -418,30 +418,30 @@
     indicatorBox->setSpacing (5);
     /* i/o devices */
-    hd_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox, "hd_light", Qt::WNoAutoErase);
+    hd_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox);
     hd_light->setStateIcon (KDeviceActivity_Idle, QPixmap (":/hd_16px.png"));
     hd_light->setStateIcon (KDeviceActivity_Reading, QPixmap (":/hd_read_16px.png"));
     hd_light->setStateIcon (KDeviceActivity_Writing, QPixmap (":/hd_write_16px.png"));
     hd_light->setStateIcon (KDeviceActivity_Null, QPixmap (":/hd_disabled_16px.png"));
-    cd_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox, "cd_light", Qt::WNoAutoErase);
+    cd_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox);
     cd_light->setStateIcon (KDeviceActivity_Idle, QPixmap (":/cd_16px.png"));
     cd_light->setStateIcon (KDeviceActivity_Reading, QPixmap (":/cd_read_16px.png"));
     cd_light->setStateIcon (KDeviceActivity_Writing, QPixmap (":/cd_write_16px.png"));
     cd_light->setStateIcon (KDeviceActivity_Null, QPixmap (":/cd_disabled_16px.png"));
-    fd_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox, "fd_light", Qt::WNoAutoErase);
+    fd_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox);
     fd_light->setStateIcon (KDeviceActivity_Idle, QPixmap (":/fd_16px.png"));
     fd_light->setStateIcon (KDeviceActivity_Reading, QPixmap (":/fd_read_16px.png"));
     fd_light->setStateIcon (KDeviceActivity_Writing, QPixmap (":/fd_write_16px.png"));
     fd_light->setStateIcon (KDeviceActivity_Null, QPixmap (":/fd_disabled_16px.png"));
-    net_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox, "net_light", Qt::WNoAutoErase);
+    net_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox);
     net_light->setStateIcon (KDeviceActivity_Idle, QPixmap (":/nw_16px.png"));
     net_light->setStateIcon (KDeviceActivity_Reading, QPixmap (":/nw_read_16px.png"));
     net_light->setStateIcon (KDeviceActivity_Writing, QPixmap (":/nw_write_16px.png"));
     net_light->setStateIcon (KDeviceActivity_Null, QPixmap (":/nw_disabled_16px.png"));
-    usb_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox, "usb_light", Qt::WNoAutoErase);
+    usb_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox);
     usb_light->setStateIcon (KDeviceActivity_Idle, QPixmap (":/usb_16px.png"));
     usb_light->setStateIcon (KDeviceActivity_Reading, QPixmap (":/usb_read_16px.png"));
     usb_light->setStateIcon (KDeviceActivity_Writing, QPixmap (":/usb_write_16px.png"));
     usb_light->setStateIcon (KDeviceActivity_Null, QPixmap (":/usb_disabled_16px.png"));
-    sf_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox, "sf_light", Qt::WNoAutoErase);
+    sf_light = new QIStateIndicator (KDeviceActivity_Idle, indicatorBox);
     sf_light->setStateIcon (KDeviceActivity_Idle, QPixmap (":/shared_folder_16px.png"));
     sf_light->setStateIcon (KDeviceActivity_Reading, QPixmap (":/shared_folder_read_16px.png"));
@@ -465,5 +465,5 @@
 
     /* mouse */
-    mouse_state = new QIStateIndicator (0, indicatorBox, "mouse_state", Qt::WNoAutoErase);
+    mouse_state = new QIStateIndicator (0, indicatorBox);
     mouse_state->setStateIcon (0, QPixmap (":/mouse_disabled_16px.png"));
     mouse_state->setStateIcon (1, QPixmap (":/mouse_16px.png"));
@@ -474,5 +474,5 @@
     hostkey_hbox = new Q3HBox (indicatorBox, "hostkey_hbox");
     hostkey_hbox->setSpacing (3);
-    hostkey_state = new QIStateIndicator (0, hostkey_hbox, "hostkey_state");
+    hostkey_state = new QIStateIndicator (0, hostkey_hbox);
     hostkey_state->setStateIcon (0, QPixmap (":/hostkey_16px.png"));
     hostkey_state->setStateIcon (1, QPixmap (":/hostkey_captured_16px.png"));
@@ -3249,5 +3249,5 @@
     /* If seamless mode should be enabled then check if it is enabled
      * currently and re-enable it if open-view procedure is finished */
-    if (vmSeamlessAction->isOn() && mIsOpenViewFinished && aSeamlessSupported)
+    if (vmSeamlessAction->isChecked() && mIsOpenViewFinished && aSeamlessSupported)
         toggleFullscreenMode (true, true);
 
@@ -3422,16 +3422,19 @@
 #endif
 
-VBoxSFDialog::VBoxSFDialog (QWidget  *aParent, CSession &aSession)
-    : QDialog (aParent, "VBoxSFDialog", true /* modal */,
-               Qt::WType_Dialog | Qt::WShowModal)
-    , mSettings (0), mSession (aSession)
-{
+VBoxSFDialog::VBoxSFDialog (QWidget *aParent, CSession &aSession)
+    : QDialog (aParent)
+    , mSettings (0)
+    , mSession (aSession)
+{
+    setModal (true);
     /* Setup Dialog's options */
-    setCaption (tr ("Shared Folders"));
-    setIcon (QPixmap (":/select_file_16px.png"));
+    setWindowTitle (tr ("Shared Folders"));
+    setWindowIcon (QIcon (":/select_file_16px.png"));
     setSizeGripEnabled (true);
 
     /* Setup main dialog's layout */
-    Q3VBoxLayout *mainLayout = new Q3VBoxLayout (this, 10, 10, "mainLayout");
+    QVBoxLayout *mainLayout = new QVBoxLayout (this);
+    mainLayout->setContentsMargins (10, 10, 10, 10);
+    mainLayout->setSpacing (10);
 
     /* Setup settings layout */
@@ -3444,13 +3447,15 @@
 
     /* Setup button's layout */
-    Q3HBoxLayout *buttonLayout = new Q3HBoxLayout (mainLayout, 10, "buttonLayout");
-    QPushButton *pbHelp = new QPushButton (tr ("Help"), this, "pbHelp");
+    QHBoxLayout *buttonLayout = new QHBoxLayout();
+    buttonLayout->setSpacing (10);
+    mainLayout->addLayout (buttonLayout);
+    QPushButton *pbHelp = new QPushButton (tr ("Help"));
     QSpacerItem *spacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum);
-    QPushButton *pbOk = new QPushButton (tr ("&OK"), this, "pbOk");
-    QPushButton *pbCancel = new QPushButton (tr ("Cancel"), this, "pbCancel");
+    QPushButton *pbOk = new QPushButton (tr ("&OK"));
+    QPushButton *pbCancel = new QPushButton (tr ("Cancel"));
     connect (pbHelp, SIGNAL (clicked()), &vboxProblem(), SLOT (showHelpHelpDialog()));
     connect (pbOk, SIGNAL (clicked()), this, SLOT (accept()));
     connect (pbCancel, SIGNAL (clicked()), this, SLOT (reject()));
-    pbHelp->setAccel (Qt::Key_F1);
+    pbHelp->setShortcut (Qt::Key_F1);
     buttonLayout->addWidget (pbHelp);
     buttonLayout->addItem (spacer);
Index: /trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp	(revision 7368)
+++ /trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobal.cpp	(revision 7369)
@@ -28,6 +28,4 @@
 //Added by qt3to4:
 #include <QDesktopWidget>
-#include <Q3CString>
-#include <q3mimefactory.h>
 #include <QTranslator>
 #include <Q3VBoxLayout>
@@ -51,4 +49,11 @@
 #include <qlabel.h>
 #include <qtoolbutton.h>
+#include <qfileinfo.h>
+#include <qdir.h>
+#include <qmutex.h>
+#include <qregexp.h>
+#include <qlocale.h>
+#include <QProcess>
+#include <QList>
 
 #ifdef Q_WS_X11
@@ -58,12 +63,4 @@
 #endif
 
-#include <qfileinfo.h>
-#include <qdir.h>
-#include <qmutex.h>
-#include <qregexp.h>
-#include <qlocale.h>
-#include <q3process.h>
-
-#include <QList>
 
 #if defined (Q_WS_MAC)
@@ -3677,8 +3674,8 @@
     for (size_t i = 0; i < ELEMENTS (commands); ++ i)
     {
-        QStringList args = QStringList::split (':', commands [i]);
+        QStringList args = QString(commands [i]).split (':');
         args += aURL;
-        Q3Process cmd (args);
-        if (cmd.start())
+        QString command = args.takeFirst();
+        if (QProcess::startDetached (command, args))
             return true;
     }
@@ -3701,5 +3698,5 @@
     {
         ConstStr255Param hint (0x0);
-        Q3CString cs = aURL.local8Bit();
+        QByteArray cs = aURL.toLocal8Bit();
         const char* data = cs.data();
         long length = cs.length();
@@ -4262,32 +4259,30 @@
 VBoxSwitchMenu::VBoxSwitchMenu (QWidget *aParent, QAction *aAction,
                                 bool aInverted)
-    : Q3PopupMenu (aParent), mAction (aAction), mInverted (aInverted)
+    : QMenu (aParent), mAction (aAction), mInverted (aInverted)
 {
     /* this menu works only with toggle action */
-    Assert (aAction->isToggleAction());
+    Assert (aAction->isCheckable());
     connect (this, SIGNAL (aboutToShow()),
              this, SLOT   (processAboutToShow()));
-    connect (this, SIGNAL (activated (int)),
-             this, SLOT   (processActivated (int)));
+//    connect (this, SIGNAL (activated (int)),
+//             this, SLOT   (processActivated (int)));
 }
 
 void VBoxSwitchMenu::setToolTip (const QString &aTip)
 {
-    mTip = aTip;
+    mAction->setToolTip (aTip);
 }
 
 void VBoxSwitchMenu::processAboutToShow()
 {
-    clear();
-    QString text = mAction->isOn() ^ mInverted ? tr ("Disable") : tr ("Enable");
-    int id = insertItem (text);
-    setItemEnabled (id, mAction->isEnabled());
-    QToolTip::add (this, tr ("%1 %2").arg (text).arg (mTip));
-}
-
-void VBoxSwitchMenu::processActivated (int /*aIndex*/)
-{
-    mAction->setOn (!mAction->isOn());
-}
+    QString text = mAction->isChecked() ^ mInverted ? tr ("Disable") : tr ("Enable");
+    mAction->setText (text);
+}
+
+#warning port me: no longer needed?
+//void VBoxSwitchMenu::processActivated (int /*aIndex*/)
+//{
+//    mAction->toggle();
+//}
 
 #ifdef Q_WS_X11
Index: /trunk/src/VBox/Frontends/VirtualBox4/src/VBoxProblemReporter.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox4/src/VBoxProblemReporter.cpp	(revision 7368)
+++ /trunk/src/VBox/Frontends/VirtualBox4/src/VBoxProblemReporter.cpp	(revision 7369)
@@ -27,17 +27,11 @@
 #include "QIHotKeyEdit.h"
 
-#include <qmessagebox.h>
-#include <q3progressdialog.h>
-#include <qcursor.h>
-#include <q3process.h>
-#include <qeventloop.h>
-#include <qregexp.h>
+/* Qt includes */
+#include <QProgressDialog>
+#include <QProcess>
+#include <QFileInfo>
 #ifdef Q_WS_MAC
-# include <qpushbutton.h>
+# include <QPushButton>
 #endif
-//Added by qt3to4:
-#include <QTimerEvent>
-#include <Q3CString>
-#include <QCloseEvent>
 
 #include <iprt/err.h>
@@ -63,12 +57,11 @@
  *        is destroyed.
  */
-class VBoxProgressDialog : public Q3ProgressDialog
+class VBoxProgressDialog : public QProgressDialog
 {
 public:
 
     VBoxProgressDialog (CProgress &aProgress, const QString &aTitle,
-                        int aMinDuration = 2000, QWidget *aCreator = 0,
-                        const char *aName = 0)
-        : Q3ProgressDialog (aCreator, aName, true,
+                        int aMinDuration = 2000, QWidget *aCreator = 0)
+        : QProgressDialog (aCreator, 
                            Qt::WStyle_Customize | Qt::WStyle_DialogBorder | Qt::WStyle_Title)
         , mProgress (aProgress)
@@ -79,4 +72,5 @@
         , mEnded (false)
     {
+        setModal (true);
         if (mOpCount > 1)
             setLabelText (QString (sOpDescTpl)
@@ -87,10 +81,10 @@
                           .arg (mProgress.GetOperationDescription()));
         setCancelButtonText (QString::null);
-        setTotalSteps (100);
-        setCaption (QString ("%1: %2")
+        setMaximum (100);
+        setWindowTitle (QString ("%1: %2")
                     .arg (aTitle, mProgress.GetDescription()));
         setMinimumDuration (aMinDuration);
         setCancelEnabled (false);
-        setProgress (0);
+        setValue (0);
     }
 
@@ -104,10 +98,10 @@
     virtual void timerEvent (QTimerEvent *e);
 
-    virtual void reject() { if (mCalcelEnabled) Q3ProgressDialog::reject(); };
+    virtual void reject() { if (mCalcelEnabled) QProgressDialog::reject(); };
 
     virtual void closeEvent (QCloseEvent *e)
     {
         if (mCalcelEnabled)
-            Q3ProgressDialog::closeEvent (e);
+            QProgressDialog::closeEvent (e);
         else
             e->ignore();
@@ -135,5 +129,9 @@
 #warning port me
         /* start a refresh timer */
-//        startTimer (aRefreshInterval);
+        startTimer (aRefreshInterval);
+        // todo: Ok here I have no clue what this mean.
+        // I never saw someone calling the eventloop directly.
+        // Very inconventient. I will investigate this later.
+        // For now it seems to working correctly.
 //        mLoopLevel = qApp->eventLoop()->loopLevel();
 //        /* enter the modal loop */
@@ -142,5 +140,5 @@
 //        mLoopLevel = -1;
 //        mEnded = false;
-        return result();
+        return exec();
     }
     return Rejected;
@@ -158,10 +156,14 @@
         if (mProgress.isOk())
         {
-            setProgress (100);
-            setResult (Accepted);
+            setValue (100);
+            accepted();
+//            setResult (Accepted);
         }
         else
-            setResult (Rejected);
-        mEnded = justEnded = true;
+            rejected();
+//            setResult (Rejected);
+        //
+//        mEnded = justEnded = true;
+        return;
     }
 
@@ -199,5 +201,5 @@
             .arg (mCurOp).arg (mOpCount));
     }
-    setProgress (mProgress.GetPercent());
+    setValue (mProgress.GetPercent());
 }
 
@@ -300,6 +302,6 @@
     {
         vbox = vboxGlobal().virtualBox();
-        msgs = QStringList::split (',', vbox.GetExtraData (VBoxDefs::GUI_SuppressMessages));
-        if (msgs.findIndex (aAutoConfirmId) >= 0) {
+        msgs = vbox.GetExtraData (VBoxDefs::GUI_SuppressMessages).split (',');
+        if (msgs.contains (aAutoConfirmId)) {
             int rc = AutoConfirmed;
             if (aButton1 & QIMessageBox::Default)
@@ -418,5 +420,5 @@
 
     VBoxProgressDialog progressDlg (aProgress, aTitle, aMinDuration,
-                                    aParent, "progressDlg");
+                                    aParent);
 
     /* run the dialog with the 100 ms refresh interval */
@@ -443,16 +445,16 @@
     if (vboxGlobal().isVMConsoleProcess())
     {
-        if (vboxGlobal().consoleWnd().isShown())
+        if (vboxGlobal().consoleWnd().isVisible())
             return &vboxGlobal().consoleWnd();
     }
     else
     {
-        if (vboxGlobal().selectorWnd().isShown())
+        if (vboxGlobal().selectorWnd().isVisible())
             return &vboxGlobal().selectorWnd();
     }
 #else
-    if (vboxGlobal().consoleWnd().isShown())
+    if (vboxGlobal().consoleWnd().isVisible())
         return &vboxGlobal().consoleWnd();
-    if (vboxGlobal().selectorWnd().isShown())
+    if (vboxGlobal().selectorWnd().isVisible())
         return &vboxGlobal().selectorWnd();
 #endif
@@ -964,6 +966,6 @@
         /* this should be in sync with VBoxVMListBoxItem::recache() */
         QFileInfo fi (machine.GetSettingsFilePath());
-        name = fi.extension().lower() == "xml" ?
-               fi.baseName (true) : fi.fileName();
+        name = fi.suffix().toLower() == "xml" ?
+               fi.completeBaseName() : fi.fileName();
         msg = tr ("<p>Are you sure you want to unregister the inaccessible "
                   "virtual machine <b>%1</b>?</p>"
@@ -1844,5 +1846,5 @@
     //  - add common buttons like Retry/Save/PowerOff/whatever
 
-    Q3CString autoConfimId = "showRuntimeError.";
+    QByteArray autoConfimId = "showRuntimeError.";
 
     CConsole console = aConsole;
@@ -1874,5 +1876,5 @@
     }
 
-    autoConfimId += errorID.utf8();
+    autoConfimId += errorID.toUtf8();
 
     QString formatted;
@@ -2091,13 +2093,11 @@
     Assert(RT_SUCCESS(rc));
     rc = RTPathAppPrivateArch (szViewerPath, sizeof (szViewerPath));
-
-    QString fullProgPath = QString(szDocsPath);
-    Q3Process kchmViewer (QString(szViewerPath) + "/kchmviewer");
-    kchmViewer.addArgument (fullProgPath + "/VirtualBox.chm");
-    kchmViewer.launch (QString(""));
+    Assert(RT_SUCCESS(rc));
+
+    QProcess::startDetached (QString(szViewerPath) + "/kchmviewer", 
+                             QStringList (QString(szDocsPath) + "/VirtualBox.chm"));
 #elif defined (Q_WS_MAC)
-    Q3Process openApp (QString("/usr/bin/open"));
-    openApp.addArgument (qApp->applicationDirPath() + "/UserManual.pdf");
-    openApp.launch (QString(""));
+    QProcess::startDetached ("/usr/bin/open", 
+                             QStringList (qApp->applicationDirPath() + "/UserManual.pdf"));
 #endif
 #endif /* VBOX_OSE */
