mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 23:20:52 +01:00
ProjectDatabase improvement
Use transaction / commit when several elements was changed instead of update one by one each element.
This commit is contained in:
@@ -36,6 +36,9 @@ class ChangeElementInformationCommand : public QUndoCommand
|
||||
DiagramContext &new_info,
|
||||
QUndoCommand *parent = nullptr);
|
||||
|
||||
ChangeElementInformationCommand(QMap<QPointer<Element>, QPair<DiagramContext, DiagramContext>> map,
|
||||
QUndoCommand *parent = nullptr);
|
||||
|
||||
int id() const override {return 1;}
|
||||
bool mergeWith(const QUndoCommand *other) override;
|
||||
void undo() override;
|
||||
@@ -45,8 +48,7 @@ class ChangeElementInformationCommand : public QUndoCommand
|
||||
void updateProjectDB();
|
||||
|
||||
private:
|
||||
Element *m_element;
|
||||
DiagramContext m_old_info, m_new_info;
|
||||
QMap<QPointer<Element>, QPair<DiagramContext, DiagramContext>> m_map;
|
||||
};
|
||||
|
||||
#endif // CHANGEELEMENTINFORMATIONCOMMAND_H
|
||||
|
||||
Reference in New Issue
Block a user