Show context menu of tool on label.
--HG-- branch : develop
This commit is contained in:
parent
d9a5296b34
commit
7b850afaea
|
@ -91,6 +91,11 @@ void VToolAlongLine::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
|||
ContextMenu(dialogAlongLine, this, event);
|
||||
}
|
||||
|
||||
void VToolAlongLine::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu(dialogAlongLine, this, event);
|
||||
}
|
||||
|
||||
void VToolAlongLine::AddToFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
|
|
@ -106,12 +106,13 @@ public slots:
|
|||
* @param factor
|
||||
*/
|
||||
virtual void SetFactor(qreal factor);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
/**
|
||||
* @brief contextMenuEvent
|
||||
* @param event
|
||||
*/
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
/**
|
||||
* @brief AddToFile
|
||||
*/
|
||||
|
|
|
@ -182,6 +182,11 @@ void VToolBisector::SetFactor(qreal factor)
|
|||
RefreshGeometry();
|
||||
}
|
||||
|
||||
void VToolBisector::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu(dialogBisector, this, event);
|
||||
}
|
||||
|
||||
void VToolBisector::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu(dialogBisector, this, event);
|
||||
|
|
|
@ -119,6 +119,7 @@ public slots:
|
|||
* @param factor
|
||||
*/
|
||||
virtual void SetFactor(qreal factor);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
/**
|
||||
* @brief contextMenuEvent
|
||||
|
|
|
@ -151,6 +151,11 @@ void VToolEndLine::FullUpdateFromGui(int result)
|
|||
dialogEndLine.clear();
|
||||
}
|
||||
|
||||
void VToolEndLine::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu(dialogEndLine, this, event);
|
||||
}
|
||||
|
||||
void VToolEndLine::AddToFile()
|
||||
{
|
||||
const VPointF *point = VAbstractTool::data.GeometricObject<const VPointF *>(id);
|
||||
|
|
|
@ -101,6 +101,7 @@ public slots:
|
|||
* @param result
|
||||
*/
|
||||
virtual void FullUpdateFromGui(int result);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
/**
|
||||
* @brief contextMenuEvent
|
||||
|
|
|
@ -166,6 +166,11 @@ void VToolHeight::FullUpdateFromGui(int result)
|
|||
dialogHeight.clear();
|
||||
}
|
||||
|
||||
void VToolHeight::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu(dialogHeight, this, event);
|
||||
}
|
||||
|
||||
void VToolHeight::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu(dialogHeight, this, event);
|
||||
|
|
|
@ -108,6 +108,7 @@ public slots:
|
|||
* @param result
|
||||
*/
|
||||
virtual void FullUpdateFromGui(int result);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
/**
|
||||
* @brief contextMenuEvent
|
||||
|
|
|
@ -163,6 +163,11 @@ void VToolLineIntersect::SetFactor(qreal factor)
|
|||
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<const VPointF *>(id));
|
||||
}
|
||||
|
||||
void VToolLineIntersect::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu(dialogLineIntersect, this, event);
|
||||
}
|
||||
|
||||
void VToolLineIntersect::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu(dialogLineIntersect, this, event);
|
||||
|
|
|
@ -106,6 +106,7 @@ public slots:
|
|||
* @param factor
|
||||
*/
|
||||
virtual void SetFactor(qreal factor);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
/**
|
||||
* @brief contextMenuEvent
|
||||
|
|
|
@ -167,6 +167,11 @@ void VToolNormal::SetFactor(qreal factor)
|
|||
RefreshGeometry();
|
||||
}
|
||||
|
||||
void VToolNormal::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu(dialogNormal, this, event);
|
||||
}
|
||||
|
||||
void VToolNormal::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu(dialogNormal, this, event);
|
||||
|
|
|
@ -120,6 +120,7 @@ public slots:
|
|||
* @param factor
|
||||
*/
|
||||
virtual void SetFactor(qreal factor);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
/**
|
||||
* @brief contextMenuEvent
|
||||
|
|
|
@ -34,11 +34,13 @@ VToolPoint::VToolPoint(VDomDocument *doc, VContainer *data, qint64 id, QGraphics
|
|||
QGraphicsEllipseItem(parent), radius(toPixel(2)), namePoint(0), lineName(0)
|
||||
{
|
||||
namePoint = new VGraphicsSimpleTextItem(this);
|
||||
Q_ASSERT(namePoint != 0);
|
||||
connect(namePoint, &VGraphicsSimpleTextItem::ShowContextMenu, this, &VToolPoint::ShowContextMenu);
|
||||
namePoint->setBrush(Qt::black);
|
||||
lineName = new QGraphicsLineItem(this);
|
||||
Q_ASSERT(lineName != 0);
|
||||
lineName->setPen(QPen(Qt::black));
|
||||
connect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this,
|
||||
&VToolPoint::NameChangePosition);
|
||||
connect(namePoint, &VGraphicsSimpleTextItem::NameChangePosition, this, &VToolPoint::NameChangePosition);
|
||||
this->setBrush(QBrush(Qt::NoBrush));
|
||||
this->setFlag(QGraphicsItem::ItemIsSelectable, true);
|
||||
this->setFlag(QGraphicsItem::ItemIsFocusable, true);
|
||||
|
@ -105,6 +107,11 @@ void VToolPoint::SetFactor(qreal factor)
|
|||
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<const VPointF *>(id));
|
||||
}
|
||||
|
||||
void VToolPoint::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
}
|
||||
|
||||
void VToolPoint::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
{
|
||||
if (event->button() == Qt::LeftButton)
|
||||
|
|
|
@ -80,6 +80,7 @@ public slots:
|
|||
* @param factor
|
||||
*/
|
||||
virtual void SetFactor(qreal factor);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
/**
|
||||
* @brief radius
|
||||
|
|
|
@ -186,6 +186,11 @@ void VToolPointOfContact::SetFactor(qreal factor)
|
|||
RefreshPointGeometry(*VAbstractTool::data.GeometricObject<const VPointF *>(id));
|
||||
}
|
||||
|
||||
void VToolPointOfContact::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu(dialogPointOfContact, this, event);
|
||||
}
|
||||
|
||||
void VToolPointOfContact::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu(dialogPointOfContact, this, event);
|
||||
|
|
|
@ -116,6 +116,7 @@ public slots:
|
|||
* @param factor
|
||||
*/
|
||||
virtual void SetFactor(qreal factor);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
/**
|
||||
* @brief contextMenuEvent
|
||||
|
|
|
@ -128,6 +128,11 @@ void VToolPointOfIntersection::FullUpdateFromGui(int result)
|
|||
dialogPointOfIntersection.clear();
|
||||
}
|
||||
|
||||
void VToolPointOfIntersection::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu(dialogPointOfIntersection, this, event);
|
||||
}
|
||||
|
||||
void VToolPointOfIntersection::RemoveReferens()
|
||||
{
|
||||
doc->DecrementReferens(firstPointId);
|
||||
|
|
|
@ -97,6 +97,7 @@ public slots:
|
|||
* @param result
|
||||
*/
|
||||
virtual void FullUpdateFromGui(int result);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
/**
|
||||
* @brief RemoveReferens
|
||||
|
|
|
@ -190,6 +190,11 @@ void VToolShoulderPoint::SetFactor(qreal factor)
|
|||
RefreshGeometry();
|
||||
}
|
||||
|
||||
void VToolShoulderPoint::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu(dialogShoulderPoint, this, event);
|
||||
}
|
||||
|
||||
void VToolShoulderPoint::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu(dialogShoulderPoint, this, event);
|
||||
|
|
|
@ -118,6 +118,7 @@ public slots:
|
|||
* @param factor
|
||||
*/
|
||||
virtual void SetFactor(qreal factor);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
/**
|
||||
* @brief contextMenuEvent
|
||||
|
|
|
@ -184,3 +184,8 @@ void VToolSinglePoint::SetFactor(qreal factor)
|
|||
VDrawTool::SetFactor(factor);
|
||||
RefreshPointGeometry(*(VAbstractTool::data.GeometricObject<const VPointF *>(id)));
|
||||
}
|
||||
|
||||
void VToolSinglePoint::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu(dialogSinglePoint, this, event, false);
|
||||
}
|
||||
|
|
|
@ -77,6 +77,7 @@ public slots:
|
|||
* @param factor
|
||||
*/
|
||||
virtual void SetFactor(qreal factor);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
signals:
|
||||
/**
|
||||
* @brief FullUpdateTree
|
||||
|
|
|
@ -184,6 +184,11 @@ void VToolTriangle::FullUpdateFromGui(int result)
|
|||
dialogTriangle.clear();
|
||||
}
|
||||
|
||||
void VToolTriangle::ShowContextMenu(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
ContextMenu(dialogTriangle, this, event);
|
||||
}
|
||||
|
||||
void VToolTriangle::RemoveReferens()
|
||||
{
|
||||
doc->DecrementReferens(axisP1Id);
|
||||
|
|
|
@ -111,6 +111,7 @@ public slots:
|
|||
* @param result
|
||||
*/
|
||||
virtual void FullUpdateFromGui(int result);
|
||||
virtual void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
/**
|
||||
* @brief RemoveReferens
|
||||
|
|
|
@ -73,3 +73,8 @@ void VGraphicsSimpleTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
|
|||
Q_UNUSED(event);
|
||||
this->setBrush(Qt::black);
|
||||
}
|
||||
|
||||
void VGraphicsSimpleTextItem::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
|
||||
{
|
||||
emit ShowContextMenu(event);
|
||||
}
|
||||
|
|
|
@ -60,6 +60,7 @@ signals:
|
|||
* @param pos
|
||||
*/
|
||||
void NameChangePosition(const QPointF pos);
|
||||
void ShowContextMenu(QGraphicsSceneContextMenuEvent *event);
|
||||
protected:
|
||||
/**
|
||||
* @brief itemChange
|
||||
|
@ -78,6 +79,7 @@ protected:
|
|||
* @param event
|
||||
*/
|
||||
virtual void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
|
||||
virtual void contextMenuEvent ( QGraphicsSceneContextMenuEvent * event );
|
||||
private:
|
||||
/**
|
||||
* @brief fontSize
|
||||
|
|
Loading…
Reference in New Issue
Block a user