Try it Laurent

This commit is contained in:
Claveau Joshua
2020-03-29 18:48:19 +02:00
parent 8819146a01
commit 46350c3860
2 changed files with 13 additions and 0 deletions

View File

@@ -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();
}
}

View File

@@ -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,