| 1055 | } |
| 1056 | |
| 1057 | void 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 | |
| 1080 | void InputEditorView::clickSection(int logicalIndex) |
| 1081 | { |
nothing calls this directly
no test coverage detected