MCPcopy Create free account
hub / github.com/Zalafina/QKeyMapper / keepSelectionEmptyAndScrollToRow

Method keepSelectionEmptyAndScrollToRow

QKeyMapper/qmappingsequenceedit.cpp:1123–1138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1121}
1122
1123void QMappingSequenceEdit::keepSelectionEmptyAndScrollToRow(int row)
1124{
1125 MappingSequenceEditTableWidget *table = ui->mappingSequenceEditTable;
1126 if (table->rowCount() <= 0) {
1127 return;
1128 }
1129
1130 row = qBound(0, row, table->rowCount() - 1);
1131
1132 // Keep selection empty if it was empty before insert.
1133 table->clearSelection();
1134 table->setCurrentCell(row, 0, QItemSelectionModel::NoUpdate);
1135 if (QTableWidgetItem *item = table->item(row, 0)) {
1136 table->scrollToItem(item, QAbstractItemView::EnsureVisible);
1137 }
1138}
1139
1140bool QMappingSequenceEdit::validateOrAllowEmptyMappingKey(QString *trimmedMappingKey, QString *popupMessage) const
1141{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected