| 236 | } |
| 237 | |
| 238 | void 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; |
nothing calls this directly
no test coverage detected