mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-22 01:10:53 +01:00
When remove an element with several conductors connected to the same terminal, the electrical potential is partially or totally destroyed.
This commit fix it : When element is removed one or several conductors are created (if needed) to conserve the electrical potential. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5703 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -23,14 +23,19 @@
|
||||
|
||||
class Diagram;
|
||||
class ElementTextItemGroup;
|
||||
class Terminal;
|
||||
|
||||
class DeleteQGraphicsItemCommand : public QUndoCommand
|
||||
{
|
||||
public:
|
||||
DeleteQGraphicsItemCommand(Diagram *diagram, const DiagramContent &content, QUndoCommand * parent = nullptr);
|
||||
~DeleteQGraphicsItemCommand() override;
|
||||
|
||||
private:
|
||||
DeleteQGraphicsItemCommand(const DeleteQGraphicsItemCommand &);
|
||||
|
||||
void setPotentialsOfRemovedElements();
|
||||
Terminal *terminalInSamePotential(Terminal *terminal, Conductor *conductor_to_exclude);
|
||||
|
||||
public:
|
||||
void undo() override;
|
||||
@@ -43,6 +48,7 @@ class DeleteQGraphicsItemCommand : public QUndoCommand
|
||||
QHash <Element *, QList<Element *> > m_link_hash; /// keep linked element for each removed element linked to other element.
|
||||
QHash <DynamicElementTextItem *, Element *> m_elmt_text_hash; /// Keep the parent element of each deleted dynamic element text item
|
||||
QHash <DynamicElementTextItem *, ElementTextItemGroup *> m_grp_texts_hash; ///Keep the parent group of each deleted element text item
|
||||
QList <QPair<Terminal *, Terminal *>> m_connected_terminals;
|
||||
};
|
||||
|
||||
#endif // DELETEQGRAPHICSITEMCOMMAND_H
|
||||
|
||||
Reference in New Issue
Block a user