[TechDraw] Refactor QGIView and QGIPrimPath mouse processing

This commit is contained in:
pavltom
2023-11-16 12:45:58 +01:00
committed by WandererFan
parent bd69b1c341
commit ec6df1726e
3 changed files with 14 additions and 39 deletions

View File

@@ -259,26 +259,6 @@ Qt::PenCapStyle QGIPrimPath::prefCapStyle()
return result;
}
void QGIPrimPath::mousePressEvent(QGraphicsSceneMouseEvent * event)
{
//wf: this seems a bit of a hack. does it mess up selection of QGIPP??
QGIView *parent;
QGraphicsItem* qparent = parentItem();
if (qparent) {
parent = dynamic_cast<QGIView *> (qparent);
if (parent) {
// Base::Console().Message("QGIPP::mousePressEvent - passing event to QGIV parent\n");
parent->mousePressEvent(event);
} else {
// qparent->mousePressEvent(event); //protected!
QGraphicsPathItem::mousePressEvent(event);
}
} else {
// Base::Console().Message("QGIPP::mousePressEvent - passing event to ancestor\n");
QGraphicsPathItem::mousePressEvent(event);
}
}
void QGIPrimPath::setFill(QColor c, Qt::BrushStyle s) {
setFillColor(c);
m_fillNormal = s;