BlockView right-click, ctrl+left-click fixes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "blockview.h"
|
||||
#include "qad_types.h"
|
||||
#include <qmath.h>
|
||||
#include <QScrollBar>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
@@ -213,9 +214,9 @@ bool BlockView::eventFilter(QObject * o, QEvent * e) {
|
||||
}
|
||||
//if (mm_ci->data(bvidItemSelection).toBool()) break;
|
||||
}
|
||||
if (me->buttons().testFlag(Qt::LeftButton)) btncnt++;
|
||||
if (me->buttons().testFlag(Qt::LeftButton )) btncnt++;
|
||||
if (me->buttons().testFlag(Qt::RightButton)) btncnt++;
|
||||
if (me->buttons().testFlag(Qt::MidButton)) btncnt++;
|
||||
if (me->buttons().testFlag(Qt::MidButton )) btncnt++;
|
||||
mm_cancel = btncnt >= 2;
|
||||
match_bus = bus_from = 0;
|
||||
hpin = 0;
|
||||
@@ -229,12 +230,11 @@ bool BlockView::eventFilter(QObject * o, QEvent * e) {
|
||||
block_emit_selection = false;
|
||||
emit selectionChanged();
|
||||
}
|
||||
//qDebug() << cur_bus;
|
||||
if (cur_bus) {
|
||||
return false;
|
||||
}
|
||||
if (mm_cancel) {
|
||||
if (cur_bus) {
|
||||
cur_bus->pol = cur_bus->bpol;
|
||||
cur_bus->prepareGeometryChange();
|
||||
cur_bus = 0;
|
||||
}
|
||||
if (mm_copy) {
|
||||
deleteCopyTemp();
|
||||
mm_copy = moved = false;
|
||||
@@ -357,6 +357,9 @@ bool BlockView::eventFilter(QObject * o, QEvent * e) {
|
||||
/*if (ghost_) {
|
||||
ghost_->setPos(quantize(me->scenePos(), grid_step));
|
||||
}*/
|
||||
if (cur_bus) {
|
||||
return false;
|
||||
}
|
||||
if (mm_ci)
|
||||
if (mm_ci->data(bvidInvalidItem).toBool()) {
|
||||
mm_ci = 0;
|
||||
@@ -518,6 +521,7 @@ bool BlockView::eventFilter(QObject * o, QEvent * e) {
|
||||
if (me->buttons().testFlag(Qt::LeftButton)) btncnt++;
|
||||
if (me->buttons().testFlag(Qt::RightButton)) btncnt++;
|
||||
if (me->buttons().testFlag(Qt::MidButton)) btncnt++;
|
||||
cur_bus = 0;
|
||||
mm_cancel = btncnt > 0;
|
||||
if (mm_cancel || (me->button() == Qt::MidButton) || (me->button() == Qt::RightButton)) {
|
||||
mm_ci = 0;
|
||||
|
||||
Reference in New Issue
Block a user