Provides a line edit to change backup target names.
More...
#include <backupnamedelegate.h>
|
void | backupTargetNameChanged (int target_id, QString name) const |
| Signals that a mod name has been changed by the user.
|
|
|
| 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.
|
|
| 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.
|
|
|
QSortFilterProxyModel * | proxy_model_ = nullptr |
| Proxy model used to sort or filter the underlying model.
|
|
ModListView * | parent_view_ |
| Convenience pointer to parent view. Points to the same address as this->parent.
|
|
Provides a line edit to change backup target names.
◆ BackupNameDelegate()
BackupNameDelegate::BackupNameDelegate |
( |
ModListProxyModel * | proxy, |
|
|
QObject * | parent ) |
|
explicit |
Constructor.
- Parameters
-
proxy | Proxy model used to sort or filter the underlying model. |
parent | Parent view of this delegate. |
◆ backupTargetNameChanged
void BackupNameDelegate::backupTargetNameChanged |
( |
int | target_id, |
|
|
QString | name ) const |
|
signal |
Signals that a mod name has been changed by the user.
- Parameters
-
mod_id | Target mod id. |
name | New 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
-
parent | View for which to display the line edit. |
option | Style options. |
index | Target 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
-
editor | QLineEdit for which to set data. |
index | Index of the mod. |
◆ setModelData()
void BackupNameDelegate::setModelData |
( |
QWidget * | editor, |
|
|
QAbstractItemModel * | model, |
|
|
const QModelIndex & | index ) const |
|
override |
Emits backupTargetNameChanged with the new mod name.
- Parameters
-
editor | Line edit used to change the name. |
model | Ignored. |
index | Index 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
-
editor | Target editor. |
option | Style options. |
index | Index for the editor. |
The documentation for this class was generated from the following files: