mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-03-25 16:59:58 +01:00
Try it Laurent
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "changeelementinformationcommand.h"
|
#include "changeelementinformationcommand.h"
|
||||||
#include "element.h"
|
#include "element.h"
|
||||||
|
#include "diagram.h"
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -49,6 +50,7 @@ bool ChangeElementInformationCommand::mergeWith(const QUndoCommand *other)
|
|||||||
*/
|
*/
|
||||||
void ChangeElementInformationCommand::undo() {
|
void ChangeElementInformationCommand::undo() {
|
||||||
m_element -> setElementInformations(m_old_info);
|
m_element -> setElementInformations(m_old_info);
|
||||||
|
updateProjectDB();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -56,4 +58,12 @@ void ChangeElementInformationCommand::undo() {
|
|||||||
*/
|
*/
|
||||||
void ChangeElementInformationCommand::redo() {
|
void ChangeElementInformationCommand::redo() {
|
||||||
m_element -> setElementInformations(m_new_info);
|
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 undo() override;
|
||||||
void redo() override;
|
void redo() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
void updateProjectDB();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Element *m_element;
|
Element *m_element;
|
||||||
DiagramContext m_old_info,
|
DiagramContext m_old_info,
|
||||||
|
|||||||
Reference in New Issue
Block a user