Delete key did not work.
--HG-- branch : develop
This commit is contained in:
parent
e3d582fc5e
commit
49bee0cada
|
@ -169,7 +169,7 @@ QVariant VAbstractSpline::itemChange(QGraphicsItem::GraphicsItemChange change, c
|
||||||
emit ChangedToolSelection(value.toBool(), id, id);
|
emit ChangedToolSelection(value.toBool(), id, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return QGraphicsItem::itemChange(change, value);
|
return QGraphicsPathItem::itemChange(change, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -195,7 +195,7 @@ void VAbstractSpline::keyReleaseEvent(QKeyEvent *event)
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
QGraphicsItem::keyReleaseEvent ( event );
|
QGraphicsPathItem::keyReleaseEvent ( event );
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -58,6 +58,7 @@ VToolArc::VToolArc(VAbstractPattern *doc, VContainer *data, quint32 id, const QS
|
||||||
|
|
||||||
this->setPath(ToolPath());
|
this->setPath(ToolPath());
|
||||||
this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor));
|
this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor));
|
||||||
|
this->setFlag(QGraphicsItem::ItemIsFocusable, true);// For keyboard input focus
|
||||||
|
|
||||||
ToolCreation(typeCreation);
|
ToolCreation(typeCreation);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,6 +49,7 @@ VToolArcWithLength::VToolArcWithLength(VAbstractPattern *doc, VContainer *data,
|
||||||
|
|
||||||
this->setPath(ToolPath());
|
this->setPath(ToolPath());
|
||||||
this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor));
|
this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor));
|
||||||
|
this->setFlag(QGraphicsItem::ItemIsFocusable, true);// For keyboard input focus
|
||||||
|
|
||||||
ToolCreation(typeCreation);
|
ToolCreation(typeCreation);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,7 @@ VToolCubicBezier::VToolCubicBezier(VAbstractPattern *doc, VContainer *data, quin
|
||||||
|
|
||||||
this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor));
|
this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor));
|
||||||
this->setPath(ToolPath());
|
this->setPath(ToolPath());
|
||||||
|
this->setFlag(QGraphicsItem::ItemIsFocusable, true);// For keyboard input focus
|
||||||
|
|
||||||
ToolCreation(typeCreation);
|
ToolCreation(typeCreation);
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ VToolCubicBezierPath::VToolCubicBezierPath(VAbstractPattern *doc, VContainer *da
|
||||||
|
|
||||||
this->setPath(ToolPath());
|
this->setPath(ToolPath());
|
||||||
this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor));
|
this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor));
|
||||||
|
this->setFlag(QGraphicsItem::ItemIsFocusable, true);// For keyboard input focus
|
||||||
|
|
||||||
ToolCreation(typeCreation);
|
ToolCreation(typeCreation);
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,6 +62,7 @@ VToolSpline::VToolSpline(VAbstractPattern *doc, VContainer *data, quint32 id, co
|
||||||
|
|
||||||
this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor));
|
this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor));
|
||||||
this->setFlag(QGraphicsItem::ItemIsMovable, true);
|
this->setFlag(QGraphicsItem::ItemIsMovable, true);
|
||||||
|
this->setFlag(QGraphicsItem::ItemIsFocusable, true);// For keyboard input focus
|
||||||
this->setPath(ToolPath());
|
this->setPath(ToolPath());
|
||||||
|
|
||||||
const auto spl = VAbstractTool::data.GeometricObject<VSpline>(id);
|
const auto spl = VAbstractTool::data.GeometricObject<VSpline>(id);
|
||||||
|
|
|
@ -63,6 +63,7 @@ VToolSplinePath::VToolSplinePath(VAbstractPattern *doc, VContainer *data, quint3
|
||||||
this->setPath(ToolPath());
|
this->setPath(ToolPath());
|
||||||
this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor));
|
this->setPen(QPen(Qt::black, qApp->toPixel(WidthHairLine(*VAbstractTool::data.GetPatternUnit()))/factor));
|
||||||
this->setFlag(QGraphicsItem::ItemIsMovable, true);
|
this->setFlag(QGraphicsItem::ItemIsMovable, true);
|
||||||
|
this->setFlag(QGraphicsItem::ItemIsFocusable, true);// For keyboard input focus
|
||||||
|
|
||||||
const QSharedPointer<VSplinePath> splPath = data->GeometricObject<VSplinePath>(id);
|
const QSharedPointer<VSplinePath> splPath = data->GeometricObject<VSplinePath>(id);
|
||||||
for (qint32 i = 1; i<=splPath->CountSubSpl(); ++i)
|
for (qint32 i = 1; i<=splPath->CountSubSpl(); ++i)
|
||||||
|
|
|
@ -71,6 +71,7 @@ VToolSinglePoint::VToolSinglePoint(VAbstractPattern *doc, VContainer *data, quin
|
||||||
lineName = new QGraphicsLineItem(this);
|
lineName = new QGraphicsLineItem(this);
|
||||||
this->setBrush(QBrush(Qt::NoBrush));
|
this->setBrush(QBrush(Qt::NoBrush));
|
||||||
this->setAcceptHoverEvents(true);
|
this->setAcceptHoverEvents(true);
|
||||||
|
this->setFlag(QGraphicsItem::ItemIsFocusable, true);// For keyboard input focus
|
||||||
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<VPointF>(id));
|
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<VPointF>(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,6 +111,7 @@ VToolDetail::VToolDetail(VAbstractPattern *doc, VContainer *data, const quint32
|
||||||
seamAllowance->setBrush(QBrush(Qt::FDiagPattern));
|
seamAllowance->setBrush(QBrush(Qt::FDiagPattern));
|
||||||
|
|
||||||
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
||||||
|
this->setFlag(QGraphicsItem::ItemIsFocusable, true);// For keyboard input focus
|
||||||
|
|
||||||
connect(scene, &VMainGraphicsScene::EnableToolMove, this, &VToolDetail::EnableToolMove);
|
connect(scene, &VMainGraphicsScene::EnableToolMove, this, &VToolDetail::EnableToolMove);
|
||||||
if (typeCreation == Source::FromGui || typeCreation == Source::FromTool)
|
if (typeCreation == Source::FromGui || typeCreation == Source::FromTool)
|
||||||
|
@ -428,7 +429,7 @@ QVariant VToolDetail::itemChange(QGraphicsItem::GraphicsItemChange change, const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return QGraphicsItem::itemChange(change, value);
|
return VNoBrushScalePathItem::itemChange(change, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -454,7 +455,7 @@ void VToolDetail::keyReleaseEvent(QKeyEvent *event)
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
QGraphicsItem::keyReleaseEvent ( event );
|
VNoBrushScalePathItem::keyReleaseEvent ( event );
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -50,6 +50,7 @@ VGraphicsSimpleTextItem::VGraphicsSimpleTextItem(QGraphicsItem * parent)
|
||||||
this->setFlag(QGraphicsItem::ItemIsMovable, true);
|
this->setFlag(QGraphicsItem::ItemIsMovable, true);
|
||||||
this->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
this->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||||
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
this->setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);
|
||||||
|
this->setFlag(QGraphicsItem::ItemIsFocusable, true);// For keyboard input focus
|
||||||
this->setAcceptHoverEvents(true);
|
this->setAcceptHoverEvents(true);
|
||||||
QFont font = this->font();
|
QFont font = this->font();
|
||||||
font.setPointSize(font.pointSize()+20);
|
font.setPointSize(font.pointSize()+20);
|
||||||
|
|
|
@ -35,6 +35,7 @@
|
||||||
#include <QGraphicsSceneMouseEvent>
|
#include <QGraphicsSceneMouseEvent>
|
||||||
#include <QStyleOptionGraphicsItem>
|
#include <QStyleOptionGraphicsItem>
|
||||||
#include <QPen>
|
#include <QPen>
|
||||||
|
#include <QKeyEvent>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
VSimplePoint::VSimplePoint(quint32 id, const QColor ¤tColor, Unit patternUnit, qreal *factor, QObject *parent)
|
VSimplePoint::VSimplePoint(quint32 id, const QColor ¤tColor, Unit patternUnit, qreal *factor, QObject *parent)
|
||||||
|
@ -52,6 +53,7 @@ VSimplePoint::VSimplePoint(quint32 id, const QColor ¤tColor, Unit patternU
|
||||||
this->setBrush(QBrush(Qt::NoBrush));
|
this->setBrush(QBrush(Qt::NoBrush));
|
||||||
SetPen(this, currentColor, WidthHairLine(patternUnit));
|
SetPen(this, currentColor, WidthHairLine(patternUnit));
|
||||||
this->setAcceptHoverEvents(true);
|
this->setAcceptHoverEvents(true);
|
||||||
|
this->setFlag(QGraphicsItem::ItemIsFocusable, true);// For keyboard input focus
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -229,6 +231,20 @@ void VSimplePoint::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
||||||
QGraphicsEllipseItem::hoverLeaveEvent(event);
|
QGraphicsEllipseItem::hoverLeaveEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void VSimplePoint::keyReleaseEvent(QKeyEvent *event)
|
||||||
|
{
|
||||||
|
switch (event->key())
|
||||||
|
{
|
||||||
|
case Qt::Key_Delete:
|
||||||
|
emit Delete();
|
||||||
|
return; //Leave this method immediately after call!!!
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
QGraphicsEllipseItem::keyReleaseEvent ( event );
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QVariant VSimplePoint::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
|
QVariant VSimplePoint::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -82,6 +82,7 @@ protected:
|
||||||
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ) Q_DECL_OVERRIDE;
|
virtual void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event ) Q_DECL_OVERRIDE;
|
||||||
virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ) Q_DECL_OVERRIDE;
|
virtual void hoverEnterEvent ( QGraphicsSceneHoverEvent * event ) Q_DECL_OVERRIDE;
|
||||||
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ) Q_DECL_OVERRIDE;
|
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event ) Q_DECL_OVERRIDE;
|
||||||
|
virtual void keyReleaseEvent ( QKeyEvent * event ) Q_DECL_OVERRIDE;
|
||||||
virtual QVariant itemChange ( GraphicsItemChange change, const QVariant &value ) Q_DECL_OVERRIDE;
|
virtual QVariant itemChange ( GraphicsItemChange change, const QVariant &value ) Q_DECL_OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user