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:
blacksun
2015-03-04 21:13:13 +00:00
parent 317626446a
commit bb54483e23
12 changed files with 669 additions and 33 deletions

View File

@@ -168,6 +168,27 @@ QETProject::~QETProject() {
delete undo_stack_;
}
/**
* @brief QETProject::integrateElementToProject
* Return true if we must to integarte the element to the project otherwise false
* @param location : element location
* @param project : project to test
* @return
*/
bool QETProject::integrateElementToProject(const ElementsLocation &location, const QETProject *project)
{
//Integration element must be enable
bool auto_integration_enabled = QETApp::settings().value("diagrameditor/integrate-elements", true).toBool();
//the element belongs there a project and if so, is this another project of the project given by parameter?
bool elmt_from_project = location.project();
bool elmt_from_another_project = elmt_from_project && location.project() != project;
bool must_integrate_element = (elmt_from_another_project || (auto_integration_enabled && !elmt_from_project));
return(must_integrate_element);
}
/**
Cette methode peut etre utilisee pour tester la bonne ouverture d'un projet
@return l'etat du projet