MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / mouseReleaseEvent

Method mouseReleaseEvent

DSView/pv/view/header.cpp:238–300  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236}
237
238void Header::mouseReleaseEvent(QMouseEvent *event)
239{
240 assert(event);
241
242 _mouse_is_down = false;
243
244 // judge for color / name / trigger / move
245 int action;
246 const auto mTrace = get_mTrace(action, event->pos());
247
248 if (mTrace){
249 if (action == Trace::COLOR && _colorFlag) {
250 _context_trace = mTrace;
251 changeColor(event);
252 _view.set_all_update(true);
253 }
254 else if (action == Trace::NAME && _nameFlag) {
255 _context_trace = mTrace;
256 changeName(event);
257 }
258 }
259
260 // Make view index by Y value;
261 int mode = _view.session().get_device()->get_work_mode();
262 if (_moveFlag && mode == LOGIC)
263 {
264 std::vector<Trace*> traces;
265
266 for (auto s : _view.session().get_decode_signals()){
267 traces.push_back(s);
268 }
269
270 for (auto s : _view.session().get_signals()){
271 traces.push_back(s);
272 }
273
274 sort(traces.begin(), traces.end(), View::compare_trace_y);
275
276 int index = 0;
277 for (auto t : traces){
278 t->set_view_index(index++);
279 }
280 }
281
282 if (_moveFlag) {
283 _drag_traces.clear();
284 _view.signals_changed(mTrace);
285 _view.set_all_update(true);
286
287 std::vector<Trace*> traces;
288 _view.get_traces(ALL_VIEW, traces);
289
290 for(auto t : traces){
291 t->select(false);
292 }
293 }
294
295 _colorFlag = false;

Callers

nothing calls this directly

Calls 11

set_all_updateMethod · 0.80
get_work_modeMethod · 0.80
get_deviceMethod · 0.80
sessionMethod · 0.80
set_view_indexMethod · 0.80
get_tracesMethod · 0.80
selectMethod · 0.80
normalize_layoutMethod · 0.80
endMethod · 0.45
clearMethod · 0.45
signals_changedMethod · 0.45

Tested by

no test coverage detected