10#include <QStyledItemDelegate>
37 const QStyleOptionViewItem& option,
38 const QModelIndex& index)
const override;
45 void setEditorData(QWidget* editor,
const QModelIndex& index)
const override;
54 QAbstractItemModel* model,
55 const QModelIndex& index)
const override;
63 const QStyleOptionViewItem& option,
64 const QModelIndex& index)
const override;
72 void paint(QPainter* painter,
73 const QStyleOptionViewItem& option,
74 const QModelIndex& view_index)
const override;
Used to sort or filter the mod list.
Definition modlistproxymodel.h:16
Displays mod data in the form of a mod list using a ModListModel.
Definition modlistview.h:21
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
Emits modVersionChanged if the mod version has been edited or activeGroupMemberChanged if the editor ...
Definition versionboxdelegate.cpp:48
void setEditorData(QWidget *editor, const QModelIndex &index) const override
Initializes either the line edit with the mods version or the combo box with the versions of all mods...
Definition versionboxdelegate.cpp:46
void activeGroupMemberChanged(int group, int new_id) const
Signals that the active member of a group has changed.
bool is_backup_delegate_
Indicates if this is used to manage the backup list.
Definition versionboxdelegate.h:85
void setIsBackupDelegate(bool is_backup)
Sets if this is used to handle the backup list.
Definition versionboxdelegate.cpp:173
ModListView * parent_view_
Convenience pointer to parent view. Points to the same address as this->parent.
Definition versionboxdelegate.h:87
ModListProxyModel * proxy_model_
Proxy model used to sort or filter the underlying model.
Definition versionboxdelegate.h:83
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Creates either a QLineEdit or a QComboBox depending on whether or not the mod belongs to a group.
Definition versionboxdelegate.cpp:19
void backupNameEdited(int target, int backup, QString name) const
Signals that the name of a backup has been edited by the user.
void modVersionChanged(int mod_id, QString version) const
Signals that the version string of a mod has changed.
void activeBackupChanged(int target, int backup) const
Signals that the active backup for the current backup target has changed.
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Updates the given editors geometry.
Definition versionboxdelegate.cpp:103
VersionBoxDelegate(ModListProxyModel *proxy, QObject *parent)
Constructor.
Definition versionboxdelegate.cpp:14
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &view_index) const override
If the target index references a mod in a group: Paints an editable combo box at the given index into...
Definition versionboxdelegate.cpp:110
Header for the ModListProxyModel class.
Header for the ModListView class.