mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
Element editor : add handler for modifie primitives
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4058 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -322,21 +322,32 @@ ChangePartCommand::ChangePartCommand(
|
||||
ElementEditionCommand(QString(QObject::tr("modification %1", "undo caption")).arg(name), 0, 0, parent),
|
||||
cep(part),
|
||||
property(prop),
|
||||
old_value(old_v),
|
||||
new_value(new_v)
|
||||
m_old_value(old_v),
|
||||
m_new_value(new_v)
|
||||
{
|
||||
}
|
||||
|
||||
ChangePartCommand::ChangePartCommand(const QString &part_name, CustomElementPart *part, const char *property_name, const QVariant &old_value, QUndoCommand *parent) :
|
||||
ElementEditionCommand(QString(QObject::tr("modification %1", "undo caption")).arg(part_name), 0, 0, parent),
|
||||
cep(part),
|
||||
property(property_name),
|
||||
m_old_value(old_value)
|
||||
{}
|
||||
|
||||
/// Destructeur
|
||||
ChangePartCommand::~ChangePartCommand() {
|
||||
}
|
||||
|
||||
void ChangePartCommand::setNewValue(const QVariant &new_value) {
|
||||
m_new_value = new_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief ChangePartCommand::undo
|
||||
*/
|
||||
void ChangePartCommand::undo()
|
||||
{
|
||||
cep -> setProperty(property, old_value);
|
||||
cep -> setProperty(property, m_old_value);
|
||||
ElementEditionCommand::undo();
|
||||
}
|
||||
|
||||
@@ -345,7 +356,7 @@ void ChangePartCommand::undo()
|
||||
*/
|
||||
void ChangePartCommand::redo()
|
||||
{
|
||||
cep -> setProperty(property, new_value);
|
||||
cep -> setProperty(property, m_new_value);
|
||||
ElementEditionCommand::redo();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user