mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
1-Use the "implicite shared" of Qt for the QPicture and QPixmap of element (https://doc.qt.io/qt-5/implicit-sharing.html).
This avoid to parse the same element definition each time user drop the same element in the diagram. Only the first element build the picture, all other get the created picture which is shared. 2- For use the "implicite shared" QPicture and QPixmap of element, now this isn't the element who build her picture, but a dedicated class who made only this job : build the QPicture and QPixmap of elements. 3- With the two previous novelty, the class CustomElement and GhostElement are became useless, and so was removed. Some few member function of CustomElement was moved to Element. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5492 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -23,7 +23,6 @@
|
||||
#include "qetgraphicsitem/element.h"
|
||||
#include "elementspanelwidget.h"
|
||||
#include "conductorpropertieswidget.h"
|
||||
#include "qetgraphicsitem/customelement.h"
|
||||
#include "qetproject.h"
|
||||
#include "projectview.h"
|
||||
#include "recentfiles.h"
|
||||
@@ -1126,17 +1125,6 @@ Element *QETDiagramEditor::currentElement() const
|
||||
return(selected_elements.first());
|
||||
}
|
||||
|
||||
/**
|
||||
@return the selected element in the current diagram view, or 0 if:
|
||||
* no diagram is being viewed in this editor.
|
||||
* no element is selected
|
||||
* more than one element is selected
|
||||
* the selected element is not a custom element
|
||||
*/
|
||||
CustomElement *QETDiagramEditor::currentCustomElement() const {
|
||||
return(dynamic_cast<CustomElement *>(currentElement()));
|
||||
}
|
||||
|
||||
/**
|
||||
Cette methode permet de retrouver le projet contenant un schema donne.
|
||||
@param diagram_view Schema dont il faut retrouver
|
||||
@@ -1332,8 +1320,8 @@ void QETDiagramEditor::selectionGroupTriggered(QAction *action)
|
||||
}
|
||||
else if (value == "rotate_selected_text")
|
||||
diagram->undoStack().push(new RotateTextsCommand(diagram));
|
||||
else if (value == "find_selected_element" && currentCustomElement())
|
||||
findElementInPanel(currentCustomElement()->location());
|
||||
else if (value == "find_selected_element" && currentElement())
|
||||
findElementInPanel(currentElement()->location());
|
||||
else if (value == "edit_selected_element")
|
||||
dv->editSelection();
|
||||
else if (value == "group_selected_texts")
|
||||
@@ -2117,7 +2105,7 @@ void QETDiagramEditor::editElementInEditor(const ElementsLocation &location) {
|
||||
diagram view.
|
||||
*/
|
||||
void QETDiagramEditor::editSelectedElementInEditor() {
|
||||
if (CustomElement *selected_element = currentCustomElement()) {
|
||||
if (Element *selected_element = currentElement()) {
|
||||
editElementInEditor(selected_element -> location());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user