Mantid
Loading...
Searching...
No Matches
Public Member Functions | List of all members
MantidQt::API::ScriptRepositoryView::RemoveEntryDelegate Class Reference

Delegate to show the icon to remove the entry from the local and central repository. More...

Inheritance diagram for MantidQt::API::ScriptRepositoryView::RemoveEntryDelegate:

Public Member Functions

bool editorEvent (QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override
 Reacts to the iteraction with the user when he clicks on the buttons displayed at paint. More...
 
void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Draws the column 3 (delete) of ScriptRepositoryView. More...
 
 RemoveEntryDelegate (QObject *parent=nullptr)
 

Detailed Description

Delegate to show the icon to remove the entry from the local and central repository.

Definition at line 49 of file ScriptRepositoryView.h.

Constructor & Destructor Documentation

◆ RemoveEntryDelegate()

MantidQt::API::ScriptRepositoryView::RemoveEntryDelegate::RemoveEntryDelegate ( QObject *  parent = nullptr)

Definition at line 492 of file ScriptRepositoryView.cpp.

Member Function Documentation

◆ editorEvent()

bool MantidQt::API::ScriptRepositoryView::RemoveEntryDelegate::editorEvent ( QEvent *  event,
QAbstractItemModel *  model,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
)
override

Reacts to the iteraction with the user when he clicks on the buttons displayed at paint.

Clicking on the delete icon there is only on available action (to delete the entry). So, it is enough to get the event that the user interact with the pushbutton to decide what to do.

It will filter the event in order to get the Left-Click of mouse. If it gets the click of the mouse, it will trigger the action delete to the model

Parameters
eventThe event given by the framework
modelPointer to the model needed to retrive the status of the entry
indexidentifies the entry (file/folder)
optionProvided by the framewor, and passed on to the base class.
Returns
true if it handles or false to ignore.

Definition at line 561 of file ScriptRepositoryView.cpp.

References index, MantidQt::API::ScriptRepositoryView::model, and MantidQt::API::RepoModel::setData().

◆ paint()

void MantidQt::API::ScriptRepositoryView::RemoveEntryDelegate::paint ( QPainter *  painter,
const QStyleOptionViewItem &  option,
const QModelIndex &  index 
) const
override

Draws the column 3 (delete) of ScriptRepositoryView.

This function is called every time the ScriptRepository needs to draw the widget for the delete column of the file/folder inside the ScriptRepository. It displays a trash icon to indicate user that it is used to remove entries.

Parameters
painterRequired to draw the widget
optionProvided by the framework and has information displaying the widget.
indexIdentifies the entry inside the RepoModel (indirectly the file / folder).

Definition at line 506 of file ScriptRepositoryView.cpp.

References index.


The documentation for this class was generated from the following files: