Index: /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 60495)
+++ /trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk	(revision 60496)
@@ -526,4 +526,5 @@
 	src/extensions/QISplitter.cpp \
 	src/extensions/QIAdvancedToolBar.cpp \
+	src/extensions/QITableView.cpp \
 	src/extradata/UIExtraDataManager.cpp \
 	src/globals/UIActionPool.cpp \
Index: /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITableView.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITableView.cpp	(revision 60495)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITableView.cpp	(revision 60496)
@@ -20,13 +20,117 @@
 #else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
 
+/* Qt includes: */
+# include <QStyledItemDelegate>
+
 /* GUI includes: */
 # include "QITableView.h"
+
+/* Other VBox includes: */
+# include "iprt/assert.h"
 
 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
 
 
+/** QStyledItemDelegate extension used with QITableView. */
+class QITableViewStyledItemDelegate : public QStyledItemDelegate
+{
+    Q_OBJECT;
+
+signals:
+
+    /** Notifies listeners about @a pEditor created for particular model @a index. */
+    void sigEditorCreated(QWidget *pEditor, const QModelIndex &index) const;
+
+public:
+
+    /** Constructs table-view styled-item-delegate on the basis of passed @a pParent. */
+    QITableViewStyledItemDelegate(QObject *pParent);
+
+private:
+
+    /** Returns the widget used to edit the item specified by @a index for editing.
+      * The @a pParent widget and style @a option are used to control how the editor widget appears.
+      * Besides that, we are notifying listener about editor was created for particular model @a index. */
+    virtual QWidget* createEditor(QWidget *pParent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
+};
+
+
+/*********************************************************************************************************************************
+*   Class QITableViewStyledItemDelegate implementation.                                                                          *
+*********************************************************************************************************************************/
+
+QITableViewStyledItemDelegate::QITableViewStyledItemDelegate(QObject *pParent)
+    : QStyledItemDelegate(pParent)
+{
+}
+
+QWidget* QITableViewStyledItemDelegate::createEditor(QWidget *pParent, const QStyleOptionViewItem &option, const QModelIndex &index) const
+{
+    /* Call to base-class: */
+    QWidget *pEditor = QStyledItemDelegate::createEditor(pParent, option, index);
+    /* Notify listeners about editor created: */
+    emit sigEditorCreated(pEditor, index);
+    /* Return editor: */
+    return pEditor;
+}
+
+
+/*********************************************************************************************************************************
+*   Class QITableView implementation.                                                                                            *
+*********************************************************************************************************************************/
+
 QITableView::QITableView(QWidget *pParent)
     : QTableView(pParent)
 {
+    /* Prepare all: */
+    prepare();
+}
+
+void QITableView::makeSureEditorDataCommitted()
+{
+    /* Do we have current editor at all? */
+    QObject *pEditorObject = m_editors.value(currentIndex());
+    if (pEditorObject && pEditorObject->isWidgetType())
+    {
+        /* Cast the editor to widget type: */
+        QWidget *pEditor = qobject_cast<QWidget*>(pEditorObject);
+        AssertPtrReturnVoid(pEditor);
+        {
+            /* Commit the editor data and closes it: */
+            commitData(pEditor);
+            closeEditor(pEditor, QAbstractItemDelegate::SubmitModelCache);
+        }
+    }
+}
+
+void QITableView::prepare()
+{
+    /* Delete old delegate: */
+    delete itemDelegate();
+    /* Create new delegate: */
+    QITableViewStyledItemDelegate *pStyledItemDelegate = new QITableViewStyledItemDelegate(this);
+    AssertPtrReturnVoid(pStyledItemDelegate);
+    {
+        /* Assign newly created delegate to the table: */
+        setItemDelegate(pStyledItemDelegate);
+        /* Connect newly created delegate to the table: */
+        connect(pStyledItemDelegate, SIGNAL(sigEditorCreated(QWidget *, const QModelIndex &)),
+                this, SLOT(sltEditorCreated(QWidget *, const QModelIndex &)));
+    }
+}
+
+void QITableView::sltEditorCreated(QWidget *pEditor, const QModelIndex &index)
+{
+    /* Connect created editor to the table and store it: */
+    connect(pEditor, SIGNAL(destroyed(QObject *)), this, SLOT(sltEditorDestroyed(QObject *)));
+    m_editors[index] = pEditor;
+}
+
+void QITableView::sltEditorDestroyed(QObject *pEditor)
+{
+    /* Clear destroyed editor from the table: */
+    QModelIndex index = m_editors.key(pEditor);
+    AssertReturnVoid(index.isValid());
+    m_editors.remove(index);
 }
 
@@ -39,2 +143,4 @@
 }
 
+#include "QITableView.moc"
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITableView.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITableView.h	(revision 60495)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QITableView.h	(revision 60496)
@@ -37,8 +37,26 @@
     QITableView(QWidget *pParent = 0);
 
+    /** Makes sure current editor data committed. */
+    void makeSureEditorDataCommitted();
+
 protected:
+
+    /** Prepares all. */
+    void prepare();
 
     /** Handles index change from @a previous to @a current. */
     virtual void currentChanged(const QModelIndex &current, const QModelIndex &previous) /* override */;
+
+protected slots:
+
+    /** Stores the created @a pEditor for passed @a index in the map. */
+    void sltEditorCreated(QWidget *pEditor, const QModelIndex &index);
+    /** Clears the destoyed @a pEditor from the map. */
+    void sltEditorDestroyed(QObject *pEditor);
+
+private:
+
+    /** Holds the map of editors stored for passed indexes. */
+    QMap<QModelIndex, QObject*> m_editors;
 };
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsPortForwardingDlg.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsPortForwardingDlg.cpp	(revision 60495)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsPortForwardingDlg.cpp	(revision 60496)
@@ -86,4 +86,7 @@
 void UIGlobalSettingsPortForwardingDlg::accept()
 {
+    /* Make sure both tables have their data committed: */
+    m_pIPv4Table->makeSureEditorDataCommitted();
+    m_pIPv6Table->makeSureEditorDataCommitted();
     /* Validate table: */
     bool fPassed = m_pIPv4Table->validate() && m_pIPv6Table->validate();
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsPortForwardingDlg.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsPortForwardingDlg.cpp	(revision 60495)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsPortForwardingDlg.cpp	(revision 60496)
@@ -70,4 +70,6 @@
 void UIMachineSettingsPortForwardingDlg::accept()
 {
+    /* Make sure table has own data committed: */
+    m_pTable->makeSureEditorDataCommitted();
     /* Validate table: */
     bool fPassed = m_pTable->validate();
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.cpp	(revision 60495)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.cpp	(revision 60496)
@@ -691,4 +691,9 @@
 }
 
+void UIPortForwardingTable::makeSureEditorDataCommitted()
+{
+    m_pTableView->makeSureEditorDataCommitted();
+}
+
 void UIPortForwardingTable::sltAddRule()
 {
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.h	(revision 60495)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.h	(revision 60496)
@@ -139,4 +139,7 @@
     bool isChanged() const { return m_fIsTableDataChanged; }
 
+    /** Makes sure current editor data committed. */
+    void makeSureEditorDataCommitted();
+
 private slots:
 
