Changeset 92207 in vbox for trunk/src/VBox
- Timestamp:
- Nov 4, 2021 8:19:14 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 148038
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/widgets
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.cpp
r87432 r92207 792 792 , m_pTableView(0) 793 793 , m_pToolBar(0) 794 , m_pNewItemEditorFactory(0) 794 795 , m_pTableModel(0) 795 796 , m_pActionAdd(0) … … 799 800 /* Prepare: */ 800 801 prepare(); 802 } 803 804 UIPortForwardingTable::~UIPortForwardingTable() 805 { 806 delete m_pNewItemEditorFactory; 801 807 } 802 808 … … 1118 1124 { 1119 1125 /* Create new item editor factory: */ 1120 QItemEditorFactory *pNewItemEditorFactory = new QItemEditorFactory;1121 if ( pNewItemEditorFactory)1126 m_pNewItemEditorFactory = new QItemEditorFactory; 1127 if (m_pNewItemEditorFactory) 1122 1128 { 1123 1129 /* Register NameEditor as the NameData editor: */ 1124 1130 int iNameId = qRegisterMetaType<NameData>(); 1125 1131 QStandardItemEditorCreator<NameEditor> *pNameEditorItemCreator = new QStandardItemEditorCreator<NameEditor>(); 1126 pNewItemEditorFactory->registerEditor((QVariant::Type)iNameId, pNameEditorItemCreator);1132 m_pNewItemEditorFactory->registerEditor((QVariant::Type)iNameId, pNameEditorItemCreator); 1127 1133 1128 1134 /* Register ProtocolEditor as the KNATProtocol editor: */ 1129 1135 int iProtocolId = qRegisterMetaType<KNATProtocol>(); 1130 1136 QStandardItemEditorCreator<ProtocolEditor> *pProtocolEditorItemCreator = new QStandardItemEditorCreator<ProtocolEditor>(); 1131 pNewItemEditorFactory->registerEditor((QVariant::Type)iProtocolId, pProtocolEditorItemCreator);1137 m_pNewItemEditorFactory->registerEditor((QVariant::Type)iProtocolId, pProtocolEditorItemCreator); 1132 1138 1133 1139 /* Register IPv4Editor/IPv6Editor as the IpData editor: */ … … 1136 1142 { 1137 1143 QStandardItemEditorCreator<IPv4Editor> *pIPv4EditorItemCreator = new QStandardItemEditorCreator<IPv4Editor>(); 1138 pNewItemEditorFactory->registerEditor((QVariant::Type)iIpId, pIPv4EditorItemCreator);1144 m_pNewItemEditorFactory->registerEditor((QVariant::Type)iIpId, pIPv4EditorItemCreator); 1139 1145 } 1140 1146 else 1141 1147 { 1142 1148 QStandardItemEditorCreator<IPv6Editor> *pIPv6EditorItemCreator = new QStandardItemEditorCreator<IPv6Editor>(); 1143 pNewItemEditorFactory->registerEditor((QVariant::Type)iIpId, pIPv6EditorItemCreator);1149 m_pNewItemEditorFactory->registerEditor((QVariant::Type)iIpId, pIPv6EditorItemCreator); 1144 1150 } 1145 1151 … … 1147 1153 int iPortId = qRegisterMetaType<PortData>(); 1148 1154 QStandardItemEditorCreator<PortEditor> *pPortEditorItemCreator = new QStandardItemEditorCreator<PortEditor>(); 1149 pNewItemEditorFactory->registerEditor((QVariant::Type)iPortId, pPortEditorItemCreator);1155 m_pNewItemEditorFactory->registerEditor((QVariant::Type)iPortId, pPortEditorItemCreator); 1150 1156 1151 1157 /* Set newly created item editor factory for table delegate: */ 1152 pStyledItemDelegate->setItemEditorFactory( pNewItemEditorFactory);1158 pStyledItemDelegate->setItemEditorFactory(m_pNewItemEditorFactory); 1153 1159 } 1154 1160 } -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.h
r91509 r92207 36 36 class QAction; 37 37 class QHBoxLayout; 38 class QItemEditorFactory; 38 39 class QIDialogButtonBox; 39 40 class QITableView; 40 41 class UIPortForwardingModel; 41 42 class QIToolBar; 42 43 43 44 44 /** QString subclass used to distinguish name data from simple QString. */ … … 211 211 * @param fAllowEmptyGuestIPs Brings whether this table allows empty guest IPs. */ 212 212 UIPortForwardingTable(const UIPortForwardingDataList &rules, bool fIPv6, bool fAllowEmptyGuestIPs); 213 213 ~UIPortForwardingTable(); 214 214 /** Returns the list of port forwarding rules. */ 215 215 UIPortForwardingDataList rules() const; … … 293 293 /** Holds the tool-bar instance. */ 294 294 QIToolBar *m_pToolBar; 295 /** Holds the item editor factory instance. */ 296 QItemEditorFactory *m_pNewItemEditorFactory; 295 297 296 298 /** Holds the table-model instance. */
Note:
See TracChangeset
for help on using the changeset viewer.