Changeset 92328 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 10, 2021 3:29:30 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIShortcutConfigurationEditor.cpp
r88441 r92328 310 310 * @param strObjectName Brings the object name this table has, required for fast referencing. */ 311 311 UIShortcutConfigurationTable(QWidget *pParent, UIShortcutConfigurationModel *pModel, const QString &strObjectName); 312 /** Destructs table. */ 313 virtual ~UIShortcutConfigurationTable() /* override */; 312 314 313 315 protected: … … 327 329 /** Prepares all. */ 328 330 void prepare(); 331 /** Cleanups all. */ 332 void cleanup(); 333 334 /** Holds the item editor factory instance. */ 335 QItemEditorFactory *m_pItemEditorFactory; 329 336 }; 330 337 … … 699 706 const QString &strObjectName) 700 707 : QITableView(pParent) 708 , m_pItemEditorFactory(0) 701 709 { 702 710 /* Set object name: */ … … 707 715 /* Prepare all: */ 708 716 prepare(); 717 } 718 719 UIShortcutConfigurationTable::~UIShortcutConfigurationTable() 720 { 721 /* Cleanup all: */ 722 cleanup(); 709 723 } 710 724 … … 761 775 762 776 /* Create new item editor factory: */ 763 QItemEditorFactory *pNewItemEditorFactory = new QItemEditorFactory;764 if ( pNewItemEditorFactory)777 m_pItemEditorFactory = new QItemEditorFactory; 778 if (m_pItemEditorFactory) 765 779 { 766 780 /* Register UIHotKeyEditor as the UIHotKey editor: */ 767 781 int iHotKeyTypeId = qRegisterMetaType<UIHotKey>(); 768 782 QStandardItemEditorCreator<UIHotKeyEditor> *pHotKeyItemEditorCreator = new QStandardItemEditorCreator<UIHotKeyEditor>(); 769 pNewItemEditorFactory->registerEditor((QVariant::Type)iHotKeyTypeId, pHotKeyItemEditorCreator);783 m_pItemEditorFactory->registerEditor((QVariant::Type)iHotKeyTypeId, pHotKeyItemEditorCreator); 770 784 771 785 /* Register UIHostComboEditor as the UIHostComboWrapper editor: */ 772 786 int iHostComboTypeId = qRegisterMetaType<UIHostComboWrapper>(); 773 787 QStandardItemEditorCreator<UIHostComboEditor> *pHostComboItemEditorCreator = new QStandardItemEditorCreator<UIHostComboEditor>(); 774 pNewItemEditorFactory->registerEditor((QVariant::Type)iHostComboTypeId, pHostComboItemEditorCreator);788 m_pItemEditorFactory->registerEditor((QVariant::Type)iHostComboTypeId, pHostComboItemEditorCreator); 775 789 776 790 /* Assign configured item editor factory to item delegate: */ 777 pStyledItemDelegate->setItemEditorFactory(pNewItemEditorFactory); 778 } 779 } 791 pStyledItemDelegate->setItemEditorFactory(m_pItemEditorFactory); 792 } 793 } 794 } 795 796 void UIShortcutConfigurationTable::cleanup() 797 { 798 /* Cleanup item editor factory: */ 799 delete m_pItemEditorFactory; 800 m_pItemEditorFactory = 0; 780 801 } 781 802 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIAddDiskEncryptionPasswordDialog.cpp
r91029 r92328 163 163 * @param encryptedMedia Brings the lists of medium ids (values) encrypted with passwords with ids (keys). */ 164 164 UIEncryptionDataTable(const EncryptedMediumMap &encryptedMedia); 165 /** Destructs table. */ 166 virtual ~UIEncryptionDataTable() /* override */; 165 167 166 168 /** Returns the shallow copy of the encryption password map … … 175 177 /** Prepares all. */ 176 178 void prepare(); 179 /** Cleanups all. */ 180 void cleanup(); 177 181 178 182 /** Holds the encrypted medium map reference. */ … … 181 185 /** Holds the encryption-data model instance. */ 182 186 UIEncryptionDataModel *m_pModelEncryptionData; 187 188 /** Holds the item editor factory instance. */ 189 QItemEditorFactory *m_pItemEditorFactory; 183 190 }; 184 191 … … 376 383 : m_encryptedMedia(encryptedMedia) 377 384 , m_pModelEncryptionData(0) 378 { 379 /* Prepare: */ 385 , m_pItemEditorFactory(0) 386 { 380 387 prepare(); 388 } 389 390 UIEncryptionDataTable::~UIEncryptionDataTable() 391 { 392 cleanup(); 381 393 } 382 394 … … 414 426 if (pStyledItemDelegate) 415 427 { 416 /* Create item editor factory: */417 QItemEditorFactory *pNewItemEditorFactory = new QItemEditorFactory;418 if ( pNewItemEditorFactory)419 { 420 /* Create item editor creator: */428 /* Create new item editor factory: */ 429 m_pItemEditorFactory = new QItemEditorFactory; 430 if (m_pItemEditorFactory) 431 { 432 /* Register UIPasswordEditor as the QString editor: */ 421 433 QStandardItemEditorCreator<UIPasswordEditor> *pQStringItemEditorCreator = new QStandardItemEditorCreator<UIPasswordEditor>(); 422 434 if (pQStringItemEditorCreator) 423 { 424 /* Register UIPasswordEditor as the QString editor: */ 425 pNewItemEditorFactory->registerEditor(QVariant::String, pQStringItemEditorCreator); 426 } 435 m_pItemEditorFactory->registerEditor(QVariant::String, pQStringItemEditorCreator); 427 436 428 437 /* Assign configured item editor factory to table delegate: */ 429 pStyledItemDelegate->setItemEditorFactory( pNewItemEditorFactory);438 pStyledItemDelegate->setItemEditorFactory(m_pItemEditorFactory); 430 439 } 431 440 … … 454 463 horizontalHeader()->setSectionResizeMode(UIEncryptionDataTableSection_Id, QHeaderView::Interactive); 455 464 horizontalHeader()->setSectionResizeMode(UIEncryptionDataTableSection_Password, QHeaderView::Stretch); 465 } 466 467 void UIEncryptionDataTable::cleanup() 468 { 469 /* Cleanup item editor factory: */ 470 delete m_pItemEditorFactory; 471 m_pItemEditorFactory = 0; 456 472 } 457 473 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFormEditorWidget.cpp
r92151 r92328 1384 1384 , m_pTableView(0) 1385 1385 , m_pTableModel(0) 1386 , m_pItemEditorFactory(0) 1386 1387 { 1387 1388 prepare(); 1389 } 1390 1391 UIFormEditorWidget::~UIFormEditorWidget() 1392 { 1393 cleanup(); 1388 1394 } 1389 1395 … … 1494 1500 1495 1501 /* Create new item editor factory: */ 1496 QItemEditorFactory *pNewItemEditorFactory = new QItemEditorFactory;1497 if ( pNewItemEditorFactory)1502 m_pItemEditorFactory = new QItemEditorFactory; 1503 if (m_pItemEditorFactory) 1498 1504 { 1499 1505 /* Register TextEditor as the TextData editor: */ 1500 1506 int iTextId = qRegisterMetaType<TextData>(); 1501 1507 QStandardItemEditorCreator<TextEditor> *pTextEditorItemCreator = new QStandardItemEditorCreator<TextEditor>(); 1502 pNewItemEditorFactory->registerEditor((QVariant::Type)iTextId, pTextEditorItemCreator);1508 m_pItemEditorFactory->registerEditor((QVariant::Type)iTextId, pTextEditorItemCreator); 1503 1509 1504 1510 /* Register ChoiceEditor as the ChoiceData editor: */ 1505 1511 int iChoiceId = qRegisterMetaType<ChoiceData>(); 1506 1512 QStandardItemEditorCreator<ChoiceEditor> *pChoiceEditorItemCreator = new QStandardItemEditorCreator<ChoiceEditor>(); 1507 pNewItemEditorFactory->registerEditor((QVariant::Type)iChoiceId, pChoiceEditorItemCreator);1513 m_pItemEditorFactory->registerEditor((QVariant::Type)iChoiceId, pChoiceEditorItemCreator); 1508 1514 1509 1515 /* Register RangedIntegerEditor as the RangedIntegerData editor: */ 1510 1516 int iRangedIntegerId = qRegisterMetaType<RangedIntegerData>(); 1511 1517 QStandardItemEditorCreator<RangedIntegerEditor> *pRangedIntegerEditorItemCreator = new QStandardItemEditorCreator<RangedIntegerEditor>(); 1512 pNewItemEditorFactory->registerEditor((QVariant::Type)iRangedIntegerId, pRangedIntegerEditorItemCreator);1518 m_pItemEditorFactory->registerEditor((QVariant::Type)iRangedIntegerId, pRangedIntegerEditorItemCreator); 1513 1519 1514 1520 /* Set newly created item editor factory for table delegate: */ 1515 pStyledItemDelegate->setItemEditorFactory( pNewItemEditorFactory);1521 pStyledItemDelegate->setItemEditorFactory(m_pItemEditorFactory); 1516 1522 } 1517 1523 } … … 1522 1528 } 1523 1529 } 1530 } 1531 1532 void UIFormEditorWidget::cleanup() 1533 { 1534 delete m_pItemEditorFactory; 1535 m_pItemEditorFactory = 0; 1524 1536 } 1525 1537 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFormEditorWidget.h
r92165 r92328 32 32 /* Forward declarations: */ 33 33 class QHeaderView; 34 class QItemEditorFactory; 34 35 class UIFormEditorModel; 35 36 class UIFormEditorView; … … 48 49 * @param pNotificationCenter Brings the notification-center this widget should report to. */ 49 50 UIFormEditorWidget(QWidget *pParent = 0, UINotificationCenter *pNotificationCenter = 0); 51 /** Destructs Form Editor widget. */ 52 virtual ~UIFormEditorWidget() /* override */; 50 53 51 54 /** Returns the notification-center reference. */ … … 80 83 /** Prepares all. */ 81 84 void prepare(); 85 /** Cleanups all. */ 86 void cleanup(); 82 87 83 88 /** Adjusts table column sizes. */ … … 91 96 /** Holds the table-model instance. */ 92 97 UIFormEditorModel *m_pTableModel; 98 99 /** Holds the item editor factory instance. */ 100 QItemEditorFactory *m_pItemEditorFactory; 93 101 }; 94 102 -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.cpp
r92207 r92328 792 792 , m_pTableView(0) 793 793 , m_pToolBar(0) 794 , m_p NewItemEditorFactory(0)794 , m_pItemEditorFactory(0) 795 795 , m_pTableModel(0) 796 796 , m_pActionAdd(0) … … 798 798 , m_pActionRemove(0) 799 799 { 800 /* Prepare: */801 800 prepare(); 802 801 } … … 804 803 UIPortForwardingTable::~UIPortForwardingTable() 805 804 { 806 delete m_pNewItemEditorFactory;805 cleanup(); 807 806 } 808 807 … … 1124 1123 { 1125 1124 /* Create new item editor factory: */ 1126 m_p NewItemEditorFactory = new QItemEditorFactory;1127 if (m_p NewItemEditorFactory)1125 m_pItemEditorFactory = new QItemEditorFactory; 1126 if (m_pItemEditorFactory) 1128 1127 { 1129 1128 /* Register NameEditor as the NameData editor: */ 1130 1129 int iNameId = qRegisterMetaType<NameData>(); 1131 1130 QStandardItemEditorCreator<NameEditor> *pNameEditorItemCreator = new QStandardItemEditorCreator<NameEditor>(); 1132 m_p NewItemEditorFactory->registerEditor((QVariant::Type)iNameId, pNameEditorItemCreator);1131 m_pItemEditorFactory->registerEditor((QVariant::Type)iNameId, pNameEditorItemCreator); 1133 1132 1134 1133 /* Register ProtocolEditor as the KNATProtocol editor: */ 1135 1134 int iProtocolId = qRegisterMetaType<KNATProtocol>(); 1136 1135 QStandardItemEditorCreator<ProtocolEditor> *pProtocolEditorItemCreator = new QStandardItemEditorCreator<ProtocolEditor>(); 1137 m_p NewItemEditorFactory->registerEditor((QVariant::Type)iProtocolId, pProtocolEditorItemCreator);1136 m_pItemEditorFactory->registerEditor((QVariant::Type)iProtocolId, pProtocolEditorItemCreator); 1138 1137 1139 1138 /* Register IPv4Editor/IPv6Editor as the IpData editor: */ … … 1142 1141 { 1143 1142 QStandardItemEditorCreator<IPv4Editor> *pIPv4EditorItemCreator = new QStandardItemEditorCreator<IPv4Editor>(); 1144 m_p NewItemEditorFactory->registerEditor((QVariant::Type)iIpId, pIPv4EditorItemCreator);1143 m_pItemEditorFactory->registerEditor((QVariant::Type)iIpId, pIPv4EditorItemCreator); 1145 1144 } 1146 1145 else 1147 1146 { 1148 1147 QStandardItemEditorCreator<IPv6Editor> *pIPv6EditorItemCreator = new QStandardItemEditorCreator<IPv6Editor>(); 1149 m_p NewItemEditorFactory->registerEditor((QVariant::Type)iIpId, pIPv6EditorItemCreator);1148 m_pItemEditorFactory->registerEditor((QVariant::Type)iIpId, pIPv6EditorItemCreator); 1150 1149 } 1151 1150 … … 1153 1152 int iPortId = qRegisterMetaType<PortData>(); 1154 1153 QStandardItemEditorCreator<PortEditor> *pPortEditorItemCreator = new QStandardItemEditorCreator<PortEditor>(); 1155 m_p NewItemEditorFactory->registerEditor((QVariant::Type)iPortId, pPortEditorItemCreator);1154 m_pItemEditorFactory->registerEditor((QVariant::Type)iPortId, pPortEditorItemCreator); 1156 1155 1157 1156 /* Set newly created item editor factory for table delegate: */ 1158 pStyledItemDelegate->setItemEditorFactory(m_p NewItemEditorFactory);1157 pStyledItemDelegate->setItemEditorFactory(m_pItemEditorFactory); 1159 1158 } 1160 1159 } … … 1212 1211 } 1213 1212 1213 void UIPortForwardingTable::cleanup() 1214 { 1215 delete m_pItemEditorFactory; 1216 m_pItemEditorFactory = 0; 1217 } 1218 1214 1219 1215 1220 #include "UIPortForwardingTable.moc" -
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPortForwardingTable.h
r92207 r92328 211 211 * @param fAllowEmptyGuestIPs Brings whether this table allows empty guest IPs. */ 212 212 UIPortForwardingTable(const UIPortForwardingDataList &rules, bool fIPv6, bool fAllowEmptyGuestIPs); 213 ~UIPortForwardingTable(); 213 /** Destructs Port Forwarding table. */ 214 virtual ~UIPortForwardingTable() /* override */; 214 215 /** Returns the list of port forwarding rules. */ 215 216 UIPortForwardingDataList rules() const; … … 273 274 /** Prepares toolbar. */ 274 275 void prepareToolbar(); 276 /** Cleanups all. */ 277 void cleanup(); 275 278 276 279 /** Holds the list of port forwarding rules. */ … … 294 297 QIToolBar *m_pToolBar; 295 298 /** Holds the item editor factory instance. */ 296 QItemEditorFactory *m_p NewItemEditorFactory;299 QItemEditorFactory *m_pItemEditorFactory; 297 300 298 301 /** Holds the table-model instance. */
Note:
See TracChangeset
for help on using the changeset viewer.