| 574 | } |
| 575 | |
| 576 | void DeviceView::mousePressEvent(QMouseEvent *event) |
| 577 | { |
| 578 | if(per_led) |
| 579 | { |
| 580 | ctrlDown = event->modifiers().testFlag(Qt::ControlModifier); |
| 581 | mouseDown = true; |
| 582 | mouseMoved = false; |
| 583 | |
| 584 | if(ctrlDown) |
| 585 | { |
| 586 | previousFlags = selectionFlags; |
| 587 | previousSelection = selectedLeds; |
| 588 | } |
| 589 | |
| 590 | /*-----------------------------------------------------*\ |
| 591 | | It's okay if the size becomes negative | |
| 592 | \*-----------------------------------------------------*/ |
| 593 | selectionRect.setLeft(event->x()); |
| 594 | selectionRect.setTop(event->y()); |
| 595 | selectionRect.setRight(event->x()); |
| 596 | selectionRect.setBottom(event->y()); |
| 597 | |
| 598 | updateSelection(); |
| 599 | update(); |
| 600 | } |
| 601 | } |
| 602 | |
| 603 | void DeviceView::mouseMoveEvent(QMouseEvent *event) |
| 604 | { |