MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / mouseReleaseEvent

Method mouseReleaseEvent

DSView/pv/view/viewport.cpp:1187–1243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1185}
1186
1187void Viewport::mouseReleaseEvent(QMouseEvent *event)
1188{
1189 assert(event);
1190
1191 if (_type != TIME_VIEW){
1192 update(UpdateEventType::UPDATE_EV_MS_UP);
1193 return;
1194 }
1195
1196 int mode = _view.session().get_device()->get_work_mode();
1197
1198 if (mode == LOGIC){
1199 onLogicMouseRelease(event);
1200 }
1201 else if (mode == DSO){
1202 onDsoMouseRelease(event);
1203 }
1204 else if (mode == ANALOG){
1205 onAnalogMouseRelease(event);
1206 }
1207
1208 if (_action_type == CURS_MOVE) {
1209 if (_curs_moved && event->button() == Qt::LeftButton) {
1210 set_action(NO_ACTION);
1211 _view.get_ruler()->rel_grabbed_cursor();
1212 _view.cursor_moved();
1213 _curs_moved = false;
1214 }
1215 if (_xcurs_moved && event->button() == Qt::LeftButton) {
1216 set_action(NO_ACTION);
1217 auto &xcursor_list = _view.get_xcursorList();
1218 auto i = xcursor_list.begin();
1219
1220 while (i != xcursor_list.end()) {
1221 (*i)->rel_grabbed();
1222 i++;
1223 }
1224
1225 _xcurs_moved = false;
1226 }
1227 }
1228
1229 /*
1230 // This code block prevents the cursor from moving.
1231 if (mode == LOGIC && event->button() == Qt::LeftButton){
1232 int clickX = _mouse_down_point.x();
1233 const int64_t index = _view.pixel2index(clickX);
1234 const int64_t total = _view.session().get_ring_sample_count();
1235 if (index > total){
1236 _measure_type = MeasureType::NO_MEASURE;
1237 set_action(NO_ACTION);
1238 }
1239 }
1240 */
1241
1242 update(UpdateEventType::UPDATE_EV_MS_UP);
1243}
1244

Callers

nothing calls this directly

Calls 7

get_work_modeMethod · 0.80
get_deviceMethod · 0.80
sessionMethod · 0.80
rel_grabbed_cursorMethod · 0.80
get_rulerMethod · 0.80
rel_grabbedMethod · 0.80
endMethod · 0.45

Tested by

no test coverage detected