Provides a line edit to change mod names.
More...
#include <modnamedelegate.h>
|
void | modNameChanged (int mod_id, QString name) const |
| Signals that a mod name has been changed by the user.
|
|
|
| ModNameDelegate (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 modNameChanged 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 mod names.
◆ ModNameDelegate()
Constructor.
- Parameters
-
parent | Parent of this object. |
proxy | Proxy model used, or nullptr if non is used. |
◆ createEditor()
QWidget * ModNameDelegate::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.
◆ modNameChanged
void ModNameDelegate::modNameChanged |
( |
int | mod_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. |
◆ setEditorData()
void ModNameDelegate::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 ModNameDelegate::setModelData |
( |
QWidget * | editor, |
|
|
QAbstractItemModel * | model, |
|
|
const QModelIndex & | index ) const |
|
override |
Emits modNameChanged with the new mod name.
- Parameters
-
editor | Line edit used to change the name. |
model | Ignored. |
index | Index for the edited name. |
◆ updateEditorGeometry()
void ModNameDelegate::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: