mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-03-26 09:49:59 +01:00
Element editor : clean some code
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3476 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -60,7 +60,7 @@ bool ESEventAddEllipse::mousePressEvent(QGraphicsSceneMouseEvent *event) {
|
||||
|
||||
//Add ellipse to scene
|
||||
m_ellipse -> setRect(m_ellipse -> rect().normalized());
|
||||
m_scene -> undoStack().push(new AddPartCommand(QObject::tr("Rectangle"), m_scene, m_ellipse));
|
||||
m_scene -> undoStack().push(new AddPartCommand(QObject::tr("Ellipse"), m_scene, m_ellipse));
|
||||
|
||||
//Set m_ellipse to nullptr for create new ellipse at next mouse press
|
||||
m_ellipse = nullptr;
|
||||
|
||||
@@ -28,8 +28,14 @@ ESEventInterface::ESEventInterface(ElementScene *scene) :
|
||||
m_running (false),
|
||||
m_abort (false)
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
void ESEventInterface::init() {
|
||||
foreach (QGraphicsView *qgv, m_scene->views())
|
||||
qgv->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
|
||||
m_editor->slot_setNoDragToView();
|
||||
}
|
||||
|
||||
ESEventInterface::~ESEventInterface() {
|
||||
@@ -38,6 +44,8 @@ ESEventInterface::~ESEventInterface() {
|
||||
|
||||
foreach (QGraphicsView *qgv, m_scene->views())
|
||||
qgv->setContextMenuPolicy(Qt::DefaultContextMenu);
|
||||
|
||||
m_editor->slot_setRubberBandToView();
|
||||
}
|
||||
|
||||
bool ESEventInterface::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) {
|
||||
|
||||
@@ -32,6 +32,8 @@ class ESEventInterface
|
||||
ESEventInterface(ElementScene *scene);
|
||||
virtual ~ESEventInterface();
|
||||
|
||||
void init();
|
||||
|
||||
virtual bool mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event);
|
||||
virtual bool mousePressEvent (QGraphicsSceneMouseEvent *event);
|
||||
virtual bool mouseMoveEvent (QGraphicsSceneMouseEvent *event);
|
||||
|
||||
Reference in New Issue
Block a user