MCPcopy Create free account
hub / github.com/clementgallet/libTAS / moveAgainSection

Method moveAgainSection

src/program/ui/InputEditorView.cpp:1057–1078  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1055}
1056
1057void InputEditorView::moveAgainSection(int logicalIndex, int oldVisualIndex, int newVisualIndex)
1058{
1059 /* We want to keep track of the order of inputs, and not keep a mess
1060 * between logical and visual indices. So when a user move a section, we
1061 * move it back and make the change in our list.
1062 */
1063
1064 /* Skip if moving the first two columns and add column */
1065 if ((oldVisualIndex >= InputEditorModel::COLUMN_SPECIAL_SIZE) &&
1066 (newVisualIndex >= InputEditorModel::COLUMN_SPECIAL_SIZE) &&
1067 (oldVisualIndex != inputEditorModel->columnCount() - 1) &&
1068 (newVisualIndex != inputEditorModel->columnCount() - 1))
1069 inputEditorModel->moveInputs(oldVisualIndex-InputEditorModel::COLUMN_SPECIAL_SIZE, newVisualIndex-InputEditorModel::COLUMN_SPECIAL_SIZE);
1070
1071 /* Disconnect before moving back */
1072 disconnect(horizontalHeader(), &QHeaderView::sectionMoved, this, &InputEditorView::moveAgainSection);
1073 horizontalHeader()->moveSection(newVisualIndex, oldVisualIndex);
1074 connect(horizontalHeader(), &QHeaderView::sectionMoved, this, &InputEditorView::moveAgainSection);
1075
1076 /* We probably need to resize columns */
1077 resizeAllColumns();
1078}
1079
1080void InputEditorView::clickSection(int logicalIndex)
1081{

Callers

nothing calls this directly

Calls 2

moveInputsMethod · 0.80
columnCountMethod · 0.45

Tested by

no test coverage detected