mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-31 08:10:52 +01:00
Try it Laurent
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
#include "changeelementinformationcommand.h"
|
||||
#include "element.h"
|
||||
#include "diagram.h"
|
||||
#include <QObject>
|
||||
|
||||
/**
|
||||
@@ -49,6 +50,7 @@ bool ChangeElementInformationCommand::mergeWith(const QUndoCommand *other)
|
||||
*/
|
||||
void ChangeElementInformationCommand::undo() {
|
||||
m_element -> setElementInformations(m_old_info);
|
||||
updateProjectDB();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,4 +58,12 @@ void ChangeElementInformationCommand::undo() {
|
||||
*/
|
||||
void ChangeElementInformationCommand::redo() {
|
||||
m_element -> setElementInformations(m_new_info);
|
||||
updateProjectDB();
|
||||
}
|
||||
|
||||
void ChangeElementInformationCommand::updateProjectDB()
|
||||
{
|
||||
if(m_element->diagram()) {
|
||||
m_element->diagram()->project()->dataBase()->updateDB();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,9 @@ class ChangeElementInformationCommand : public QUndoCommand
|
||||
void undo() override;
|
||||
void redo() override;
|
||||
|
||||
private:
|
||||
void updateProjectDB();
|
||||
|
||||
private:
|
||||
Element *m_element;
|
||||
DiagramContext m_old_info,
|
||||
|
||||
Reference in New Issue
Block a user