ImFusion SDK 4.3
DataWidget Class Reference

#include <ImFusion/GUI/DataWidget.h>

Graphical user interface for the DataModel/DataItemModel. More...

+ Inheritance diagram for DataWidget:

Detailed Description

Graphical user interface for the DataModel/DataItemModel.

This class provides a Qt-based GUI representing the underlying DataModel. Furthermore, manages the visibility of its contents in a DisplayWidgetMulti, and can instantiate Algorithms in the parent ApplicationController. Internally, it uses the DataDisplayModel to augment the input DataItemModel with the visibility information from the display and the DataWidgetMenu to show a context menu for the selected datasets.

You can configure convenience functionality such as the "quick selection" functionality that synchronizes item selection with visibility in the display, or the automatic linking of poses or windowing. Finally, you can customize the visual appearance by providing a custom DataWidgetItemDelegate.

See also
DataModel, DataItemModel, DefaultDataWidgetItemDelegate, DataWidgetMenu

Public Slots

void showContextMenu (const QPoint &pos)
 Opens a context menu at pos.
 
void setShowThumbnails (bool enable, bool storeInGlobalSettings=true)
 Sets if data thumbnails should be displayed or not.
 
void enableQuickSelection (bool enable, bool storeInGlobalSettings=true)
 Enables quick selection i.e. the data visibility changes together with the selection.
 
void setAutoLinkWindowing (bool enable, bool storeInGlobalSettings=true)
 Enables automatic creation of LinkWindowing links per modality.
 
void setAutoLinkPose (bool enable, bool storeInGlobalSettings=true)
 Enables automatic creation of LinkPose links when grouping Data.
 
void setEnableDeleteKeyboardShortcut (bool enable)
 Enables deleting the selected data when the user presses the <delete> key.
 
void setDataGroupingOption (DataGroupingModel::GroupingOption option, bool storeInGlobalSettings=true)
 Sets the grouping-option for grouping of data by patientID/seriesID in the TreeView. Optionally stores the option in the global settings.
 
- Public Slots inherited from ExpandableGroupBox
void expand ()
 Expands the group box.
 
void collapse ()
 Collapses the group box.
 
void setExpanded (bool expanded)
 Expands or collapses the group box (default: expanded)
 
void setResizable (bool isResizable)
 Makes the group box vertical resizable (default: disabled)
 
void setTitle (const QString &title)
 Sets the title of the group box.
 
void setIcon (const QIcon &icon)
 Sets the icon of the group box.
 
void clearAndDeleteLater ()
 
void setVisible (bool visible) override
 
void addAction (QAction *action)
 Adds a new action to the right side of the expand/collapse button.
 
void removeAction (QAction *action)
 Removes an action that was previously added with addAction.
 
std::vector< QAction * > actions ()
 Lists all actions.
 
void addPage (QWidget *widget)
 Calls setWidget if no containing widget is set, does nothing otherwise (required by the Qt designer plugin)
 

Public Member Functions

 DataWidget (DataItemModel &dataItemModel, DisplayWidgetMulti &display, ApplicationController &appCtrl, QMainWindow *mainWindow=nullptr)
 Creates the widget using data from dataItemModel.
 
 DataWidget (MainWindowBase *main)
 Creates the widget from main's data model, display, and with main as application controller and main window.
 
DataList selectedData () const
 Convenience method to retrieve the currently selected data.
 
const QItemSelectionModel * selectionModel () const
 Returns the selection model used by the tree view displaying the DataModel.
 
QItemSelectionModel * selectionModel ()
 
DataFilterModelfilterModel ()
 Returns the filter model used by the tree view displaying the DataModel.
 
DataDisplayModeldisplayModel ()
 Returns the wrapper model to augment the input DataItemModel with dataset visibility information.
 
void setItemDelegate (std::unique_ptr< DataWidgetItemDelegate > itemDelegate)
 Assigns a new item delegate defining how to render the individual items in the tree view.
 
bool eventFilter (QObject *o, QEvent *e) override
 
QSize minimumSizeHint () const override
 Prescribes a minimum size for the widget when resized.
 
bool isAutoLinkPoseEnabled () const
 
void updateThumbnail (Data *data)
 Re-creates the thumbnails of the given data.
 
bool linkWindowing (const std::vector< SharedImageSet * > &images)
 Links the windowing properties of the given images.
 
bool unlinkWindowing (const std::vector< SharedImageSet * > &images)
 Unlinks the windowing properties of the given images.
 
DataGroupgroupData (const DataList &data)
 Groups the given data and adds "Group Data" to the history of AlgorithmController.
 
QModelIndex index (const Data *data, int column=DataDisplayModel::COLUMN_DATA) const
 Finds the index of the data in the DataModel.
 
void deleteData (const DataList &data)
 Deletes the given data from the DataModel.
 
void moveDataUp (Data *data)
 Moves the data down by one position and add "Move Data" to the history of AlgorithmController.
 
void moveDataDown (Data *data)
 Moves the data up by one position and add "Move Data" to the history of AlgorithmController.
 
void moveDataTo (const DataList &data, Data *newParent)
 Re-parents all datasets in data so that they appear underneath newParent.
 
void expandItem (const Data *data)
 Expands the tree view for the given dataset.
 
void collapseItem (const Data *data)
 Collapses the tree view for the given dataset.
 
bool isItemExpanded (const Data *data)
 Returns whether the tree view item for the given dataset is currently expanded or not.
 
- Public Member Functions inherited from ExpandableGroupBox
 ExpandableGroupBox (QWidget *parent=0)
 Creates an empty group box.
 
QSize sizeHint () const override
 
void setWidget (QWidget *widget)
 Sets the contained widget.
 
QWidget * widget ()
 Returns the contained widget if any or nullptr otherwise.
 
QString title () const
 
QIcon icon () const
 
bool isExpanded () const
 
bool isResizable () const
 
void setCollapsible (bool collapsible)
 Sets if box is collapsible.
 
bool isCollapsible ()
 Returns if box is collapsible.
 
void setDraggable (bool value)
 Sets the flag whether the box is draggable with the mouse when clicking on the top button.
 
bool isDraggable () const
 Returns the flag whether the box is draggable with the mouse when clicking on the top button.
 
int count () const
 Returns 1 if widget is set, 0 otherwise (required by the Qt designer plugin)
 
int currentIndex () const
 Returns 0 (required by the Qt designer plugin)
 
- Public Member Functions inherited from SignalReceiver
 SignalReceiver ()=default
 Default constructor.
 
 SignalReceiver (const SignalReceiver &other)
 Copy constructor, does not copy any existing signal connections from other.
 
SignalReceiveroperator= (SignalReceiver rhs)
 Assignment operator, disconnects all existing connections, does not copy any existing signal connections from rhs.
 
virtual ~SignalReceiver ()
 Virtual destructor disconnects from all connected signals.
 

Additional Inherited Members

- Signals inherited from ExpandableGroupBox
void expansionChanged (bool expanded)
 
void resizableChanged (bool isResizable)
 
void titleChanged (QString title)
 
void iconChanged (QIcon icon)
 
void actionAdded (QAction *action)
 
void actionRemoved (QAction *action)
 
- Protected Member Functions inherited from SignalReceiver
void disconnectAll ()
 Disconnects all existing connections.
 
- Properties inherited from ExpandableGroupBox
QString title
 
QIcon icon
 
bool expanded
 
bool resizable
 

Constructor & Destructor Documentation

◆ DataWidget() [1/2]

DataWidget ( DataItemModel & dataItemModel,
DisplayWidgetMulti & display,
ApplicationController & appCtrl,
QMainWindow * mainWindow = nullptr )

Creates the widget using data from dataItemModel.

Parameters
dataItemModelInput data model to show.
displayDisplay widget to apply dataset visibility changes to.
appCtrlParent ApplicationController to launch algorithms in.
mainWindowOptional QMainWindow, only used for showing image information in the status bar.

◆ DataWidget() [2/2]

Creates the widget from main's data model, display, and with main as application controller and main window.

Does not use the annotation model (because it is not guaranteed to be valid at this point).

Member Function Documentation

◆ updateThumbnail()

void updateThumbnail ( Data * data)

Re-creates the thumbnails of the given data.

If the data is nullptr all thumbnails are re-created.

◆ linkWindowing()

bool linkWindowing ( const std::vector< SharedImageSet * > & images)

Links the windowing properties of the given images.

Each image can only be in a single linking group. E.g. it is not possible to first link A and B, and afterwards B and C. Returns true if a new link between the images could be created.

◆ unlinkWindowing()

bool unlinkWindowing ( const std::vector< SharedImageSet * > & images)

Unlinks the windowing properties of the given images.

Removes each image in the list from a linked group. The given images can be in different linked groups. Empty or single item groups are removed automatically. Returns true if at least one link was removed.

◆ groupData()

DataGroup * groupData ( const DataList & data)

Groups the given data and adds "Group Data" to the history of AlgorithmController.

Contrary to DataModel::group, the grouping will be reproduced by a workspace.

◆ deleteData()

void deleteData ( const DataList & data)

Deletes the given data from the DataModel.

Only data that MainWindowBase allows to be deleted gets deleted. This might open a dialog to ask the user for confirmation (see MainWindowBase::canBeDeleted). Contrary to DataModel::remove, the deletion will be reproduced by a workspace.

◆ moveDataUp()

void moveDataUp ( Data * data)

Moves the data down by one position and add "Move Data" to the history of AlgorithmController.

Contrary to DataModel::move, the grouping will be reproduced by a workspace.

◆ moveDataDown()

void moveDataDown ( Data * data)

Moves the data up by one position and add "Move Data" to the history of AlgorithmController.

Contrary to DataModel::move, the grouping will be reproduced by a workspace.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close