mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
Change the way to add new element in a diagram.
Drag & drop an element in a diagram and click left to add it, click right to finish git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3803 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -42,6 +42,7 @@
|
||||
#include "factory/elementfactory.h"
|
||||
#include "diagrampropertiesdialog.h"
|
||||
#include "dveventinterface.h"
|
||||
#include "diagrameventaddelement.h"
|
||||
|
||||
/**
|
||||
Constructeur
|
||||
@@ -287,11 +288,15 @@ void DiagramView::handleElementDrop(QDropEvent *e) {
|
||||
// verifie qu'il existe un element correspondant a cet emplacement
|
||||
ElementsCollectionItem *dropped_item = QETApp::collectionItem(location);
|
||||
if (!dropped_item) return;
|
||||
|
||||
diagram()->setEventInterface(new DiagramEventAddElement(location, diagram(), mapToScene(e->pos())));
|
||||
//Set focus to the view to get event
|
||||
this->setFocus();
|
||||
|
||||
next_location_ = location;
|
||||
next_position_ = e-> pos();
|
||||
// next_location_ = location;
|
||||
// next_position_ = e-> pos();
|
||||
|
||||
emit(aboutToAddElement());
|
||||
// emit(aboutToAddElement());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user