Skip to content

Commit

Permalink
Move to next cell if user presses Enter on a property
Browse files Browse the repository at this point in the history
  • Loading branch information
iwbnwif committed Nov 16, 2024
1 parent c7ab11f commit 8070f2a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion qucs/components/componentdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,11 +512,22 @@ ComponentDialog::~ComponentDialog()
}
}

// -------------------------------------------------------------------------
// Intercept key presses and move to next row if user presses enter in the
// property table.
void ComponentDialog::keyPressEvent(QKeyEvent* e)
{
qDebug() << "Dialog key event" << e->key();

QDialog::keyPressEvent(e);
if (e->key() == Qt::Key_Return && propertyTable->hasFocus()) {
int row = propertyTable->currentRow();
if (row < propertyTable->rowCount())
propertyTable->setCurrentCell(row + 1, 1);
else
slotOKButton();
}
else
QDialog::keyPressEvent(e);
}

// -------------------------------------------------------------------------
Expand Down

0 comments on commit 8070f2a

Please sign in to comment.