keyframe values can now be set in graph editor

This commit is contained in:
itsmattkc
2018-12-31 22:44:34 +11:00
parent 7a4e655d2c
commit 1e1ed96bff
4 changed files with 76 additions and 2 deletions
+31
View File
@@ -1301,3 +1301,34 @@ void RippleAction::redo() {
}
ca->redo();
}
SetDouble::SetDouble(double* pointer, double new_value) :
p(pointer),
oldval(*pointer),
newval(new_value),
old_project_changed(mainWindow->isWindowModified())
{}
void SetDouble::undo() {
*p = oldval;
mainWindow->setWindowModified(old_project_changed);
}
void SetDouble::redo() {
*p = newval;
mainWindow->setWindowModified(true);
}
SetQVariant::SetQVariant(QVariant *itarget, const QVariant &iold, const QVariant &inew) :
target(itarget),
old_val(iold),
new_val(inew)
{}
void SetQVariant::undo() {
*target = old_val;
}
void SetQVariant::redo() {
*target = new_val;
}
+23
View File
@@ -524,6 +524,18 @@ private:
bool old_project_changed;
};
class SetDouble : public QUndoCommand {
public:
SetDouble(double* pointer, double new_value);
void undo();
void redo();
private:
double* p;
double oldval;
double newval;
bool old_project_changed;
};
class SetString : public QUndoCommand {
public:
SetString(QString* pointer, QString new_value);
@@ -606,4 +618,15 @@ public:
void redo();
};
class SetQVariant : public QUndoCommand {
public:
SetQVariant(QVariant* itarget, const QVariant& iold, const QVariant& inew);
void undo();
void redo();
private:
QVariant* target;
QVariant old_val;
QVariant new_val;
};
#endif // UNDO_H