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

Method getInsertRowFromSelectionOrAppend

QKeyMapper/qmappingsequenceedit.cpp:1081–1099  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1079}
1080
1081int QMappingSequenceEdit::getInsertRowFromSelectionOrAppend(int insertMode) const
1082{
1083 const MappingSequenceEditTableWidget *table = ui->mappingSequenceEditTable;
1084
1085 QList<QTableWidgetSelectionRange> ranges = table->selectedRanges();
1086 if (ranges.isEmpty()) {
1087 return m_MappingSequenceList.size();
1088 }
1089
1090 const QTableWidgetSelectionRange range = ranges.first();
1091 const int topRow = range.topRow();
1092 const int bottomRow = range.bottomRow();
1093
1094 const int preferredRow = (insertMode == TABLE_INSERT_MODE_BELOW)
1095 ? (bottomRow + 1)
1096 : topRow;
1097
1098 return qBound(0, preferredRow, m_MappingSequenceList.size());
1099}
1100
1101void QMappingSequenceEdit::reselectionRangeAndScroll(int top_row, int bottom_row)
1102{

Callers

nothing calls this directly

Calls 2

isEmptyMethod · 0.80
sizeMethod · 0.80

Tested by

no test coverage detected