Skip to content
Snippets Groups Projects
Commit bc608b59 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

correctly react to changed name

parent a3d17dd6
Branches
Tags
1 merge request!2397InstrumentsSet and SamplesSet based on SetWithModel, which owns a QListModel
Pipeline #132151 failed
......@@ -153,9 +153,8 @@ void InstrumentView::createWidgetsForCurrentInstrument()
g->body()->setLayout(formLayout);
layout->addWidget(g);
auto* nameEdit = new QLineEdit(g);
nameEdit->setText(t->name());
connect(nameEdit, &QLineEdit::textEdited, [this] { m_qlistview->repaint(); });
auto* nameEdit = new QLineEdit(t->name(), g);
connect(nameEdit, &QLineEdit::textEdited, [t](const QString &text) { t->setName(text); });
formLayout->addRow("Name:", nameEdit);
auto* descriptionEdit = new QTextEdit(g);
......@@ -164,7 +163,8 @@ void InstrumentView::createWidgetsForCurrentInstrument()
descriptionEdit->setAcceptRichText(false);
descriptionEdit->setTabChangesFocus(true);
descriptionEdit->setPlainText(t->description());
connect(descriptionEdit, &QTextEdit::textChanged, [this] { m_qlistview->repaint(); });
connect(descriptionEdit, &QTextEdit::textChanged, [t, descriptionEdit]
{ t->setDescription(descriptionEdit->toPlainText()); });
formLayout->addRow("Description:", descriptionEdit);
//... All remaining content depends on instrument type
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment