Changeset 81683 in vbox
- Timestamp:
- Nov 5, 2019 7:09:02 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIFormEditorWidget.cpp
r81326 r81683 483 483 /** Constructs the Form Editor proxy-model passing @a pParent to the base-class. */ 484 484 UIFormEditorProxyModel(QObject *pParent = 0); 485 486 /** Returns the number of children. */ 487 int childCount() const; 488 /** Returns the child item with @a iIndex. */ 489 QITableViewRow *childItem(int iIndex) const; 485 490 486 491 protected: … … 1350 1355 } 1351 1356 1357 int UIFormEditorProxyModel::childCount() const 1358 { 1359 return rowCount(); 1360 } 1361 1362 QITableViewRow *UIFormEditorProxyModel::childItem(int iIndex) const 1363 { 1364 /* Make sure iIndex within the bounds: */ 1365 AssertReturn(iIndex >= 0 && iIndex < rowCount(), 0); 1366 /* Acquire actual index of source model: */ 1367 const QModelIndex i = sourceModel()->index(iIndex, 0); 1368 AssertReturn(i.isValid(), 0); 1369 /* Get packed item pointer: */ 1370 UIFormEditorRow *pItem = static_cast<UIFormEditorRow*>(i.internalPointer()); 1371 AssertReturn(pItem, 0); 1372 return pItem; 1373 } 1374 1352 1375 bool UIFormEditorProxyModel::filterAcceptsRow(int iSourceRow, const QModelIndex &sourceParent) const 1353 1376 { … … 1380 1403 /* Redirect request to model: */ 1381 1404 AssertPtrReturn(model(), 0); 1382 return qobject_cast<UIFormEditor Model*>(model())->childCount();1405 return qobject_cast<UIFormEditorProxyModel*>(model())->childCount(); 1383 1406 } 1384 1407 … … 1387 1410 /* Redirect request to model: */ 1388 1411 AssertPtrReturn(model(), 0); 1389 return qobject_cast<UIFormEditor Model*>(model())->childItem(iIndex);1412 return qobject_cast<UIFormEditorProxyModel*>(model())->childItem(iIndex); 1390 1413 } 1391 1414
Note:
See TracChangeset
for help on using the changeset viewer.