Mantid
|
Delegate to show the icon to remove the entry from the local and central repository. More...
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) | |
Delegate to show the icon to remove the entry from the local and central repository.
Definition at line 49 of file ScriptRepositoryView.h.
MantidQt::API::ScriptRepositoryView::RemoveEntryDelegate::RemoveEntryDelegate | ( | QObject * | parent = nullptr | ) |
Definition at line 492 of file ScriptRepositoryView.cpp.
|
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
event | The event given by the framework |
model | Pointer to the model needed to retrive the status of the entry |
index | identifies the entry (file/folder) |
option | Provided by the framewor, and passed on to the base class. |
Definition at line 561 of file ScriptRepositoryView.cpp.
References index, MantidQt::API::ScriptRepositoryView::model, and MantidQt::API::RepoModel::setData().
|
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.
painter | Required to draw the widget |
option | Provided by the framework and has information displaying the widget. |
index | Identifies the entry inside the RepoModel (indirectly the file / folder). |
Definition at line 506 of file ScriptRepositoryView.cpp.
References index.