Limo
A simple mod manager
Loading...
Searching...
No Matches
modnamedelegate.h
Go to the documentation of this file.
1
5
6#pragma once
7
8#include "modlistproxymodel.h"
9#include "tablecelldelegate.h"
10#include "ui/modlistview.h"
11#include <QStyledItemDelegate>
12#include <QTableView>
13
14
19{
20 Q_OBJECT
21public:
27 explicit ModNameDelegate(ModListProxyModel* proxy, QObject* parent);
28
36 QWidget* createEditor(QWidget* parent,
37 const QStyleOptionViewItem& option,
38 const QModelIndex& index) const override;
44 void setEditorData(QWidget* editor, const QModelIndex& index) const override;
51 void setModelData(QWidget* editor,
52 QAbstractItemModel* model,
53 const QModelIndex& index) const override;
60 void updateEditorGeometry(QWidget* editor,
61 const QStyleOptionViewItem& option,
62 const QModelIndex& index) const override;
63
64signals:
70 void modNameChanged(int mod_id, QString name) const;
71};
Used to sort or filter the mod list.
Definition modlistproxymodel.h:16
void setEditorData(QWidget *editor, const QModelIndex &index) const override
Sets the line edits data to the name of the mod in the given row.
Definition modnamedelegate.cpp:22
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override
Emits modNameChanged with the new mod name.
Definition modnamedelegate.cpp:29
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Creates a QLineEdit object at the given index in the given view.
Definition modnamedelegate.cpp:13
void modNameChanged(int mod_id, QString name) const
Signals that a mod name has been changed by the user.
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override
Updates the given line edits geometry.
Definition modnamedelegate.cpp:37
ModNameDelegate(ModListProxyModel *proxy, QObject *parent)
Constructor.
Definition modnamedelegate.cpp:9
TableCellDelegate(QSortFilterProxyModel *proxy, QObject *parent)
Constructor.
Definition tablecelldelegate.cpp:7
Header for the ModListProxyModel class.
Header for the ModListView class.
Header for the TableCellDelegate class.