Skip to content

Remove SessionModel mechanism (Major change)

Ammar Nejati requested to merge maskItems_rm_SessionModel into main

Removal of SessionModel which is entangled to SessionItem is the last major step in the plan to remove the SessionItem mechanism (parent-child hierarchy). See issue #393 (closed).

MaskContainerItem and MaskContainerModel classes are created to replace MaskItems functionality. The discarded class MaskItems was itself derived from SessionModel.

ProjectionContainerItem (container for projections) is derived from MaskContainerItem.

In the current implementation, MaskContainerModel is derived from QAbstractListModel which is the simplest class in the complexity hierarchy of Qt Model/View classes (derivatives of QAbstractItemModel). This class is needed in the GUI to connect the MaskContainerItem (which holds a set of masks) to other widgets.

The other classes in the GUI module are adapted to this change (esp. the signature of functions and class members).

In particular, MaskGraphicsScene class is completely refactored accordingly.

The remnants of SessionItem are removed from IntensityDataItem:

  • replaced T_MASKS with a simple MaskContainerItem member
  • replaced T_PROJECTIONS with a simple ProjectionContainerItem member

Some functions are simplified:

  • PolygonView::addView: rm ununsed argument row
  • IShape2DView::addView: rm ununsed argument row

The test TestMapperForItem.AboutToRemoveChild is disabled since it relies on the original SessionModel/SessionItem mechanism.

This resolves #393 (closed)

Known bugs:

  • The mechanism for sending forward/backward leads to SEGFAULTs (see MaskEditorActions::changeMaskStackingOrder).
  • "Mask properties" sometimes does not display the properties for the selected mask.
Edited by Mikhail Svechnikov

Merge request reports