mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-06-12 13:17:41 +02:00
Use custom signals to record previous name
Signed-off-by: Yihe Li <winmikedows@hotmail.com>
This commit is contained in:
@ -397,6 +397,7 @@ void ListViewDelegate::setModelData(QWidget* editor, QAbstractItemModel* model,
|
||||
// Prevent instance names longer than 128 chars
|
||||
text.truncate(128);
|
||||
if (text.size() != 0) {
|
||||
emit textChanged(model->data(index).toString(), text);
|
||||
model->setData(index, text);
|
||||
}
|
||||
}
|
||||
|
@ -33,6 +33,9 @@ class ListViewDelegate : public QStyledItemDelegate {
|
||||
void setEditorData(QWidget* editor, const QModelIndex& index) const override;
|
||||
void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override;
|
||||
|
||||
signals:
|
||||
void textChanged(QString before, QString after) const;
|
||||
|
||||
private slots:
|
||||
void editingDone();
|
||||
};
|
||||
|
Reference in New Issue
Block a user