MCPcopy Create free account
hub / github.com/Project-LemonLime/Project_LemonLime / whenItemSelectionChanged

Method whenItemSelectionChanged

src/exttestcasetable.cpp:160–255  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160void ExtTestCaseTable::whenItemSelectionChanged() {
161 if (noDfs)
162 return;
163
164 noDfs = true;
165
166 isCanModify = false;
167 isCanAddSub = true;
168 isCanAddCase = false;
169 isCanRemove = false;
170 isCanUp = false;
171 isCanDown = false;
172 isCanMerge = false;
173 isCanSplit = false;
174
175 haveSub.clear();
176 resSub.clear();
177
178 auto setLists = selectedRanges();
179
180 int minRow = std::numeric_limits<int>::max(), maxRow = -1;
181
182 for (const auto &i : std::as_const(setLists)) {
183 minRow = qMin(minRow, i.topRow());
184 maxRow = qMax(maxRow, i.bottomRow());
185 }
186
187 selectMi = minRow;
188 selectMx = maxRow;
189
190 if (minRow > maxRow) {
191 noDfs = false;
192 return;
193 }
194
195 {
196 QTableWidgetSelectionRange range(minRow, 1, maxRow, columnCount() - 1);
197 setRangeSelected(range, true);
198 }
199
200 int subCnt = 0;
201
202 QList<int> subSize;
203 haveSub.clear();
204 resSub.clear();
205
206 for (int i = 0, j = 0; i < rowCount(); i = j + 1, subCnt++) {
207 j = i + rowSpan(i, 0) - 1;
208 subSize.append(j - i + 1);
209
210 if (minRow <= i && j <= maxRow) {
211 QTableWidgetSelectionRange range(i, 0, j, columnCount() - 1);
212 setRangeSelected(range, true);
213 haveSub.append(subCnt);
214 } else if (j < minRow || i > maxRow)
215 continue;
216 else {
217 haveSub.append(subCnt);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected