1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
#include "qtscriptshell_QUndoCommand.h"
#include <QtScript/QScriptEngine>
#include <QVariant>
#include <qundostack.h>
#define QTSCRIPT_IS_GENERATED_FUNCTION(fun) ((fun.data().toUInt32() & 0xFFFF0000) == 0xBABE0000)
Q_DECLARE_METATYPE(QUndoCommand*)
QtScriptShell_QUndoCommand::QtScriptShell_QUndoCommand(QUndoCommand* parent)
: QUndoCommand(parent) {}
QtScriptShell_QUndoCommand::QtScriptShell_QUndoCommand(const QString& text, QUndoCommand* parent)
: QUndoCommand(text, parent) {}
QtScriptShell_QUndoCommand::~QtScriptShell_QUndoCommand() {}
int QtScriptShell_QUndoCommand::id() const
{
QScriptValue _q_function = __qtscript_self.property("id");
if (!_q_function.isFunction() || QTSCRIPT_IS_GENERATED_FUNCTION(_q_function)
|| (__qtscript_self.propertyFlags("id") & QScriptValue::QObjectMember)) {
return QUndoCommand::id();
} else {
return qscriptvalue_cast<int >(_q_function.call(__qtscript_self));
}
}
bool QtScriptShell_QUndoCommand::mergeWith(const QUndoCommand* other)
{
QScriptValue _q_function = __qtscript_self.property("mergeWith");
if (!_q_function.isFunction() || QTSCRIPT_IS_GENERATED_FUNCTION(_q_function)
|| (__qtscript_self.propertyFlags("mergeWith") & QScriptValue::QObjectMember)) {
return QUndoCommand::mergeWith(other);
} else {
QScriptEngine *_q_engine = __qtscript_self.engine();
return qscriptvalue_cast<bool >(_q_function.call(__qtscript_self,
QScriptValueList()
<< qScriptValueFromValue(_q_engine, const_cast<QUndoCommand *>(other))));
}
}
void QtScriptShell_QUndoCommand::redo()
{
QScriptValue _q_function = __qtscript_self.property("redo");
if (!_q_function.isFunction() || QTSCRIPT_IS_GENERATED_FUNCTION(_q_function)
|| (__qtscript_self.propertyFlags("redo") & QScriptValue::QObjectMember)) {
QUndoCommand::redo();
} else {
_q_function.call(__qtscript_self);
}
}
void QtScriptShell_QUndoCommand::undo()
{
QScriptValue _q_function = __qtscript_self.property("undo");
if (!_q_function.isFunction() || QTSCRIPT_IS_GENERATED_FUNCTION(_q_function)
|| (__qtscript_self.propertyFlags("undo") & QScriptValue::QObjectMember)) {
QUndoCommand::undo();
} else {
_q_function.call(__qtscript_self);
}
}
|