| 461 | } |
| 462 | |
| 463 | void InputEditorView::mouseMoveEvent(QMouseEvent *event) |
| 464 | { |
| 465 | /* Check if the mouse press event was valid */ |
| 466 | if (mouseColumn < 0) { |
| 467 | return QTableView::mouseMoveEvent(event); |
| 468 | } |
| 469 | |
| 470 | /* We are not interested in the first columns or the add column */ |
| 471 | if (mouseColumn < InputEditorModel::COLUMN_SPECIAL_SIZE) { |
| 472 | return QTableView::mouseMoveEvent(event); |
| 473 | } |
| 474 | if (mouseColumn == inputEditorModel->columnCount() - 1) { |
| 475 | return QTableView::mouseMoveEvent(event); |
| 476 | } |
| 477 | |
| 478 | if (!(event->buttons() & Qt::LeftButton)) { |
| 479 | return QTableView::mouseMoveEvent(event); |
| 480 | } |
| 481 | |
| 482 | /* Get the table cell under the mouse position */ |
| 483 | const QModelIndex index = indexAt(event->pos()); |
| 484 | if (!index.isValid()) { |
| 485 | return QTableView::mouseMoveEvent(event); |
| 486 | } |
| 487 | |
| 488 | event->accept(); |
| 489 | |
| 490 | /* Check if we need to toggle this input */ |
| 491 | if ((index.row() >= mouseMinRow) && (index.row() <= mouseMaxRow)) |
| 492 | return; |
| 493 | |
| 494 | if (index.row() < mouseMinRow) { |
| 495 | mouseMinRow = index.row(); |
| 496 | } |
| 497 | else { |
| 498 | mouseMaxRow = index.row(); |
| 499 | } |
| 500 | |
| 501 | inputEditorModel->startPaint(mouseColumn, mouseMinRow, mouseMaxRow, mouseValue, -1); |
| 502 | } |
| 503 | |
| 504 | void InputEditorView::mouseReleaseEvent(QMouseEvent *event) |
| 505 | { |
nothing calls this directly
no test coverage detected