|
|
|
|
@ -596,10 +596,17 @@ void DeviceView::mousePressEvent(QMouseEvent *event)
|
|
|
|
|
/*-----------------------------------------------------*\
|
|
|
|
|
| It's okay if the size becomes negative |
|
|
|
|
|
\*-----------------------------------------------------*/
|
|
|
|
|
selectionRect.setLeft(event->x());
|
|
|
|
|
selectionRect.setTop(event->y());
|
|
|
|
|
selectionRect.setRight(event->x());
|
|
|
|
|
selectionRect.setBottom(event->y());
|
|
|
|
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
|
|
|
selectionRect.setLeft(event->position().x());
|
|
|
|
|
selectionRect.setTop(event->position().y());
|
|
|
|
|
selectionRect.setRight(event->position().x());
|
|
|
|
|
selectionRect.setBottom(event->position().y());
|
|
|
|
|
#else
|
|
|
|
|
selectionRect.setLeft(event->x());
|
|
|
|
|
selectionRect.setTop(event->y());
|
|
|
|
|
selectionRect.setRight(event->x());
|
|
|
|
|
selectionRect.setBottom(event->y());
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
updateSelection();
|
|
|
|
|
update();
|
|
|
|
|
@ -611,8 +618,14 @@ void DeviceView::mouseMoveEvent(QMouseEvent *event)
|
|
|
|
|
if(per_led)
|
|
|
|
|
{
|
|
|
|
|
lastMousePos = event->pos();
|
|
|
|
|
selectionRect.setRight(event->x());
|
|
|
|
|
selectionRect.setBottom(event->y());
|
|
|
|
|
|
|
|
|
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
|
|
|
|
selectionRect.setRight(event->position().x());
|
|
|
|
|
selectionRect.setBottom(event->position().y());
|
|
|
|
|
#else
|
|
|
|
|
selectionRect.setRight(event->x());
|
|
|
|
|
selectionRect.setBottom(event->y());
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if(mouseDown)
|
|
|
|
|
{
|
|
|
|
|
|