MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / rowChanged

Method rowChanged

src/dialogs/MacroEditorDialog.cpp:68–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68void MacroEditorDialog::rowChanged(const QModelIndex &current, const QModelIndex &previous)
69{
70 Q_UNUSED(previous);
71
72 if (!current.isValid()){
73 ui->editMacroName->setReadOnly(true);
74 ui->editMacroName->clear();
75 ui->keyMacroShortcut->clear();
76 if (auto model = ui->tblMacroSteps->model()) {
77 model->deleteLater();
78 }
79 return;
80 }
81 else {
82 ui->editMacroName->setReadOnly(false);
83
84 Macro *macro = model->macro(current);
85
86 ui->editMacroName->setText(macro->getName());
87
88 // Replace the existing model
89 if (auto model = ui->tblMacroSteps->model()) {
90 model->deleteLater();
91 }
92 ui->tblMacroSteps->setModel(new MacroStepTableModel(macro, this));
93
94 // Resize some stuff now that we have a new model
95 ui->tblMacroSteps->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch);
96 ui->tblMacroSteps->resizeRowsToContents();
97 ui->tblMacroSteps->resizeColumnToContents(0);
98 }
99}
100
101void MacroEditorDialog::macroNameChanged(const QString &text)
102{

Callers

nothing calls this directly

Calls 4

macroMethod · 0.80
setTextMethod · 0.80
clearMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected