Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
TechDraw: transfert mousePressEvent from QGIPrimPath to parent
  • Loading branch information
fjullien authored and wwmayer committed Apr 1, 2019
1 parent 99b4765 commit 2551c17
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/Mod/TechDraw/Gui/QGIPrimPath.cpp
Expand Up @@ -227,3 +227,13 @@ Base::Reference<ParameterGrp> QGIPrimPath::getParmGroup()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Colors");
return hGrp;
}

void QGIPrimPath::mousePressEvent(QGraphicsSceneMouseEvent * event)
{
QGIView *parent;
QGraphicsItem* qparent = parentItem();
if (qparent != nullptr) {
parent = dynamic_cast<QGIView *> (qparent);
parent->mousePressEvent(event);
}
}
1 change: 1 addition & 0 deletions src/Mod/TechDraw/Gui/QGIPrimPath.h
Expand Up @@ -61,6 +61,7 @@ class TechDrawGuiExport QGIPrimPath : public QGraphicsPathItem
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) override;

virtual QColor getNormalColor(void);
virtual QColor getPreColor(void);
Expand Down
3 changes: 2 additions & 1 deletion src/Mod/TechDraw/Gui/QGIView.h
Expand Up @@ -100,14 +100,15 @@ class TechDrawGuiExport QGIView : public QGraphicsItemGroup

static Gui::ViewProvider* getViewProvider(App::DocumentObject* obj);
MDIViewPage* getMDIViewPage(void) const;
// Mouse handling
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) override;

protected:
QGIView* getQGIVByName(std::string name);

virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
// Mouse handling
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override;
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
// Preselection events:
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
Expand Down

0 comments on commit 2551c17

Please sign in to comment.