Clicking on notselectable object do not clean previous selections.
--HG-- branch : develop
This commit is contained in:
parent
823b29d907
commit
d13937fb40
|
@ -204,6 +204,13 @@ void VAbstractSpline::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|||
{
|
||||
// Special for not selectable item first need to call standard mousePressEvent then accept event
|
||||
QGraphicsPathItem::mousePressEvent(event);
|
||||
|
||||
// Somehow clicking on notselectable object do not clean previous selections.
|
||||
if (not (flags() & ItemIsSelectable) && scene())
|
||||
{
|
||||
scene()->clearSelection();
|
||||
}
|
||||
|
||||
event->accept();// Special for not selectable item first need to call standard mousePressEvent then accept event
|
||||
}
|
||||
|
||||
|
|
|
@ -132,6 +132,13 @@ void VToolSinglePoint::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|||
{
|
||||
// Special for not selectable item first need to call standard mousePressEvent then accept event
|
||||
QGraphicsEllipseItem::mousePressEvent(event);
|
||||
|
||||
// Somehow clicking on notselectable object do not clean previous selections.
|
||||
if (not (flags() & ItemIsSelectable) && scene())
|
||||
{
|
||||
scene()->clearSelection();
|
||||
}
|
||||
|
||||
if (selectionType == SelectionType::ByMouseRelease)
|
||||
{
|
||||
event->accept();// Special for not selectable item first need to call standard mousePressEvent then accept event
|
||||
|
|
|
@ -234,6 +234,13 @@ void VNodePoint::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|||
{
|
||||
// Special for not selectable item first need to call standard mousePressEvent then accept event
|
||||
QGraphicsEllipseItem::mousePressEvent(event);
|
||||
|
||||
// Somehow clicking on notselectable object do not clean previous selections.
|
||||
if (not (flags() & ItemIsSelectable) && scene())
|
||||
{
|
||||
scene()->clearSelection();
|
||||
}
|
||||
|
||||
event->accept();// Special for not selectable item first need to call standard mousePressEvent then accept event
|
||||
}
|
||||
|
||||
|
|
|
@ -460,6 +460,13 @@ void VToolDetail::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|||
{
|
||||
// Special for not selectable item first need to call standard mousePressEvent then accept event
|
||||
VNoBrushScalePathItem::mousePressEvent(event);
|
||||
|
||||
// Somehow clicking on notselectable object do not clean previous selections.
|
||||
if (not (flags() & ItemIsSelectable) && scene())
|
||||
{
|
||||
scene()->clearSelection();
|
||||
}
|
||||
|
||||
if (flags() & QGraphicsItem::ItemIsMovable)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick)
|
||||
|
|
|
@ -207,6 +207,13 @@ void VGraphicsSimpleTextItem::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|||
{
|
||||
// Special for not selectable item first need to call standard mousePressEvent then accept event
|
||||
QGraphicsSimpleTextItem::mousePressEvent(event);
|
||||
|
||||
// Somehow clicking on notselectable object do not clean previous selections.
|
||||
if (not (flags() & ItemIsSelectable) && scene())
|
||||
{
|
||||
scene()->clearSelection();
|
||||
}
|
||||
|
||||
if (flags() & QGraphicsItem::ItemIsMovable)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton && event->type() != QEvent::GraphicsSceneMouseDoubleClick)
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include <QDebug>
|
||||
#include <QGraphicsSceneMouseEvent>
|
||||
#include <QGraphicsScene>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSimpleCurve::VSimpleCurve(quint32 id, const QColor ¤tColor, Unit patternUnit, qreal *factor, QObject *parent)
|
||||
|
@ -92,6 +93,13 @@ void VSimpleCurve::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|||
{
|
||||
// Special for not selectable item first need to call standard mousePressEvent then accept event
|
||||
QGraphicsPathItem::mousePressEvent(event);
|
||||
|
||||
// Somehow clicking on notselectable object do not clean previous selections.
|
||||
if (not (flags() & ItemIsSelectable) && scene())
|
||||
{
|
||||
scene()->clearSelection();
|
||||
}
|
||||
|
||||
if (selectionType == SelectionType::ByMouseRelease)
|
||||
{
|
||||
event->accept();// Special for not selectable item first need to call standard mousePressEvent then accept event
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include <QStyleOptionGraphicsItem>
|
||||
#include <QPen>
|
||||
#include <QKeyEvent>
|
||||
#include <QGraphicsScene>
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
VSimplePoint::VSimplePoint(quint32 id, const QColor ¤tColor, Unit patternUnit, qreal *factor, QObject *parent)
|
||||
|
@ -188,6 +189,13 @@ void VSimplePoint::mousePressEvent(QGraphicsSceneMouseEvent *event)
|
|||
{
|
||||
// Special for not selectable item first need to call standard mousePressEvent then accept event
|
||||
QGraphicsEllipseItem::mousePressEvent(event);
|
||||
|
||||
// Somehow clicking on notselectable object do not clean previous selections.
|
||||
if (not (flags() & ItemIsSelectable) && scene())
|
||||
{
|
||||
scene()->clearSelection();
|
||||
}
|
||||
|
||||
if (selectionType == SelectionType::ByMouseRelease)
|
||||
{
|
||||
event->accept();// Special for not selectable item first need to call standard mousePressEvent then accept event
|
||||
|
|
Loading…
Reference in New Issue
Block a user