Limo
A simple mod manager
Loading...
Searching...
No Matches
BackupNameDelegate Class Reference

Provides a line edit to change backup target names. More...

#include <backupnamedelegate.h>

Inheritance diagram for BackupNameDelegate:
Collaboration diagram for BackupNameDelegate:

Signals

void backupTargetNameChanged (int target_id, QString name) const
 Signals that a mod name has been changed by the user.
 

Public Member Functions

 BackupNameDelegate (ModListProxyModel *proxy, QObject *parent)
 Constructor.
 
QWidget * createEditor (QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Creates a QLineEdit object at the given index in the given view.
 
void setEditorData (QWidget *editor, const QModelIndex &index) const override
 Sets the line edits data to the name of the mod in the given row.
 
void setModelData (QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
 Emits backupTargetNameChanged with the new mod name.
 
void updateEditorGeometry (QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override
 Updates the given line edits geometry.
 
- Public Member Functions inherited from TableCellDelegate
 TableCellDelegate (QSortFilterProxyModel *proxy, QObject *parent)
 Constructor.
 
void paint (QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &view_index) const override
 Paints the cells background and text or icon.
 

Additional Inherited Members

- Protected Attributes inherited from TableCellDelegate
QSortFilterProxyModel * proxy_model_ = nullptr
 Proxy model used to sort or filter the underlying model.
 
ModListViewparent_view_
 Convenience pointer to parent view. Points to the same address as this->parent.
 

Detailed Description

Provides a line edit to change backup target names.

Constructor & Destructor Documentation

◆ BackupNameDelegate()

BackupNameDelegate::BackupNameDelegate ( ModListProxyModel * proxy,
QObject * parent )
explicit

Constructor.

Parameters
proxyProxy model used to sort or filter the underlying model.
parentParent view of this delegate.

Member Function Documentation

◆ backupTargetNameChanged

void BackupNameDelegate::backupTargetNameChanged ( int target_id,
QString name ) const
signal

Signals that a mod name has been changed by the user.

Parameters
mod_idTarget mod id.
nameNew name.

◆ createEditor()

QWidget * BackupNameDelegate::createEditor ( QWidget * parent,
const QStyleOptionViewItem & option,
const QModelIndex & index ) const
override

Creates a QLineEdit object at the given index in the given view.

Parameters
parentView for which to display the line edit.
optionStyle options.
indexTarget index for the line edit.
Returns
The new QLineEdit.

◆ setEditorData()

void BackupNameDelegate::setEditorData ( QWidget * editor,
const QModelIndex & index ) const
override

Sets the line edits data to the name of the mod in the given row.

Parameters
editorQLineEdit for which to set data.
indexIndex of the mod.

◆ setModelData()

void BackupNameDelegate::setModelData ( QWidget * editor,
QAbstractItemModel * model,
const QModelIndex & index ) const
override

Emits backupTargetNameChanged with the new mod name.

Parameters
editorLine edit used to change the name.
modelIgnored.
indexIndex for the edited name.

◆ updateEditorGeometry()

void BackupNameDelegate::updateEditorGeometry ( QWidget * editor,
const QStyleOptionViewItem & option,
const QModelIndex & index ) const
override

Updates the given line edits geometry.

Parameters
editorTarget editor.
optionStyle options.
indexIndex for the editor.

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