Index: /trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetails.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetails.cpp	(revision 88505)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetails.cpp	(revision 88506)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2012-2020 Oracle Corporation
+ * Copyright (C) 2012-2021 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -29,8 +29,8 @@
 UIDetails::UIDetails(QWidget *pParent /* = 0 */)
     : QWidget(pParent)
+    , m_pMainLayout(0)
     , m_pDetailsModel(0)
     , m_pDetailsView(0)
 {
-    /* Prepare: */
     prepare();
 }
@@ -44,32 +44,57 @@
 void UIDetails::prepare()
 {
-    /* Create main-layout: */
-    QVBoxLayout *pMainLayout = new QVBoxLayout(this);
-    if (pMainLayout)
+    /* Prepare everything: */
+    prepareContents();
+    prepareConnections();
+
+    /* Configure context-sensitive help: */
+    uiCommon().setHelpKeyword(this, "vm-details-tool");
+
+    /* Init model finally: */
+    initModel();
+}
+
+void UIDetails::prepareContents()
+{
+    /* Prepare main-layout: */
+    m_pMainLayout = new QVBoxLayout(this);
+    if (m_pMainLayout)
     {
-        pMainLayout->setContentsMargins(0, 0, 0, 0);
-        pMainLayout->setSpacing(0);
+        m_pMainLayout->setContentsMargins(0, 0, 0, 0);
+        m_pMainLayout->setSpacing(0);
 
-        /* Create details-model: */
-        m_pDetailsModel = new UIDetailsModel(this);
-        if (m_pDetailsModel)
-        {
-            /* Create details-view: */
-            m_pDetailsView = new UIDetailsView(this);
-            if (m_pDetailsView)
-            {
-                m_pDetailsView->setScene(m_pDetailsModel->scene());
-                m_pDetailsView->show();
-                setFocusProxy(m_pDetailsView);
+        /* Prepare model: */
+        prepareModel();
+    }
+}
 
-                /* Add into layout: */
-                pMainLayout->addWidget(m_pDetailsView);
-            }
+void UIDetails::prepareModel()
+{
+    /* Prepare model: */
+    m_pDetailsModel = new UIDetailsModel(this);
+    if (m_pDetailsModel)
+        prepareView();
+}
 
-            /* Init model: */
-            m_pDetailsModel->init();
-        }
+void UIDetails::prepareView()
+{
+    AssertPtrReturnVoid(m_pDetailsModel);
+    AssertPtrReturnVoid(m_pMainLayout);
+
+    /* Prepare view: */
+    m_pDetailsView = new UIDetailsView(this);
+    if (m_pDetailsView)
+    {
+        m_pDetailsView->setScene(m_pDetailsModel->scene());
+        m_pDetailsView->show();
+        setFocusProxy(m_pDetailsView);
+
+        /* Add into layout: */
+        m_pMainLayout->addWidget(m_pDetailsView);
     }
+}
 
+void UIDetails::prepareConnections()
+{
     /* Extra-data events connections: */
     connect(gEDataManager, &UIExtraDataManager::sigDetailsCategoriesChange,
@@ -78,5 +103,5 @@
             m_pDetailsModel, &UIDetailsModel::sltHandleExtraDataOptionsChange);
 
-    /* Setup details-model connections: */
+    /* Model connections: */
     connect(m_pDetailsModel, &UIDetailsModel::sigRootItemMinimumWidthHintChanged,
             m_pDetailsView, &UIDetailsView::sltMinimumWidthHintChanged);
@@ -88,9 +113,11 @@
             m_pDetailsModel, &UIDetailsModel::sltHandleToggleFinished);
 
-    /* Setup details-view connections: */
+    /* View connections: */
     connect(m_pDetailsView, &UIDetailsView::sigResized,
             m_pDetailsModel, &UIDetailsModel::sltHandleViewResize);
+}
 
-    /* For context sensitive help: */
-    uiCommon().setHelpKeyword(this, "vm-details-tool");
+void UIDetails::initModel()
+{
+    m_pDetailsModel->init();
 }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetails.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetails.h	(revision 88505)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/manager/details/UIDetails.h	(revision 88506)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2012-2020 Oracle Corporation
+ * Copyright (C) 2012-2021 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -27,4 +27,5 @@
 /* Forward declartions: */
 class QString;
+class QVBoxLayout;
 class UIDetailsModel;
 class UIDetailsView;
@@ -38,16 +39,19 @@
 signals:
 
-    /** Notifies listeners about link click.
-      * @param  strCategory  Brings link category.
-      * @param  strControl   Brings control name.
-      * @param  uId        Brings machine ID. */
-    void sigLinkClicked(const QString &strCategory,
-                        const QString &strControl,
-                        const QUuid &uId);
-
-    /** Notifies listeners about toggling started. */
-    void sigToggleStarted();
-    /** Notifies listeners about toggling finished. */
-    void sigToggleFinished();
+    /** @name General stuff.
+      * @{ */
+        /** Notifies listeners about link click.
+          * @param  strCategory  Brings link category.
+          * @param  strControl   Brings control name.
+          * @param  uId        Brings machine ID. */
+        void sigLinkClicked(const QString &strCategory,
+                            const QString &strControl,
+                            const QUuid &uId);
+    
+        /** Notifies listeners about toggling started. */
+        void sigToggleStarted();
+        /** Notifies listeners about toggling finished. */
+        void sigToggleFinished();
+    /** @} */
 
 public:
@@ -55,22 +59,43 @@
     /** Constructs Details pane passing @a pParent to the base-class. */
     UIDetails(QWidget *pParent = 0);
-
-    /** Return the Details-model instance. */
-    UIDetailsModel *model() const { return m_pDetailsModel; }
-    /** Return the Details-view instance. */
-    UIDetailsView *view() const { return m_pDetailsView; }
-
-    /** Replaces current model @a items. */
-    void setItems(const QList<UIVirtualMachineItem*> &items);
+    
+    /** @name General stuff.
+      * @{ */
+        /** Return the Details-model instance. */
+        UIDetailsModel *model() const { return m_pDetailsModel; }
+        /** Return the Details-view instance. */
+        UIDetailsView *view() const { return m_pDetailsView; }
+    
+        /** Replaces current model @a items. */
+        void setItems(const QList<UIVirtualMachineItem*> &items);
+    /** @} */
 
 private:
 
-    /** Prepares all. */
-    void prepare();
+    /** @name Prepare/Cleanup cascade.
+      * @{ */
+        /** Prepares all. */
+        void prepare();
+        /** Prepares contents. */
+        void prepareContents();
+        /** Prepares model. */
+        void prepareModel();
+        /** Prepares view. */
+        void prepareView();
+        /** Prepares connections. */
+        void prepareConnections();
+        /** Inits model. */
+        void initModel();
+    /** @} */
 
-    /** Holds the details model instance. */
-    UIDetailsModel *m_pDetailsModel;
-    /** Holds the details view instance. */
-    UIDetailsView  *m_pDetailsView;
+    /** @name General stuff.
+      * @{ */
+        /** Holds the main layout instance. */
+        QVBoxLayout    *m_pMainLayout;
+        /** Holds the details model instance. */
+        UIDetailsModel *m_pDetailsModel;
+        /** Holds the details view instance. */
+        UIDetailsView  *m_pDetailsView;
+    /** @} */
 };
 
