PythonQtWrapper_QUndoStack.cpp
219 lines
| 6.9 KiB
| text/x-c
|
CppLexer
florianlink
|
r13 | #include "PythonQtWrapper_QUndoStack.h" | ||
florianlink
|
r24 | #include <PythonQtSignalReceiver.h> | ||
#include <PythonQtMethodInfo.h> | ||||
#include <PythonQtConversion.h> | ||||
florianlink
|
r13 | #include <QVariant> | ||
#include <qaction.h> | ||||
#include <qbytearray.h> | ||||
#include <qcoreevent.h> | ||||
#include <qlist.h> | ||||
#include <qobject.h> | ||||
#include <qundostack.h> | ||||
florianlink
|
r24 | void PythonQtShell_QUndoStack::childEvent(QChildEvent* arg__1) | ||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "childEvent"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"" , "QChildEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
florianlink
|
r24 | void* args[2] = {NULL, (void*)&arg__1}; | ||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
QUndoStack::childEvent(arg__1); | ||||
} | ||||
void PythonQtShell_QUndoStack::customEvent(QEvent* arg__1) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "customEvent"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"" , "QEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
florianlink
|
r24 | void* args[2] = {NULL, (void*)&arg__1}; | ||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
QUndoStack::customEvent(arg__1); | ||||
} | ||||
bool PythonQtShell_QUndoStack::event(QEvent* arg__1) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "event"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"bool" , "QEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
bool returnValue; | ||||
florianlink
|
r24 | void* args[2] = {NULL, (void*)&arg__1}; | ||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { | ||||
args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); | ||||
if (args[0]!=&returnValue) { | ||||
florianlink
|
r73 | if (args[0]==NULL) { | ||
PythonQt::priv()->handleVirtualOverloadReturnError("event", methodInfo, result); | ||||
} else { | ||||
returnValue = *((bool*)args[0]); | ||||
} | ||||
florianlink
|
r24 | } | ||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QUndoStack::event(arg__1); | ||||
} | ||||
bool PythonQtShell_QUndoStack::eventFilter(QObject* arg__1, QEvent* arg__2) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "eventFilter"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"bool" , "QObject*" , "QEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(3, argumentList); | ||||
bool returnValue; | ||||
florianlink
|
r24 | void* args[3] = {NULL, (void*)&arg__1, (void*)&arg__2}; | ||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { | ||||
args[0] = PythonQtConv::ConvertPythonToQt(methodInfo->parameters().at(0), result, false, NULL, &returnValue); | ||||
if (args[0]!=&returnValue) { | ||||
florianlink
|
r73 | if (args[0]==NULL) { | ||
PythonQt::priv()->handleVirtualOverloadReturnError("eventFilter", methodInfo, result); | ||||
} else { | ||||
returnValue = *((bool*)args[0]); | ||||
} | ||||
florianlink
|
r24 | } | ||
} | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return returnValue; | ||||
} | ||||
} | ||||
return QUndoStack::eventFilter(arg__1, arg__2); | ||||
} | ||||
void PythonQtShell_QUndoStack::timerEvent(QTimerEvent* arg__1) | ||||
{ | ||||
if (_wrapper) { | ||||
PyObject* obj = PyObject_GetAttrString((PyObject*)_wrapper, "timerEvent"); | ||||
PyErr_Clear(); | ||||
if (obj && !PythonQtSlotFunction_Check(obj)) { | ||||
florianlink
|
r73 | static const char* argumentList[] ={"" , "QTimerEvent*"}; | ||
static const PythonQtMethodInfo* methodInfo = PythonQtMethodInfo::getCachedMethodInfoFromArgumentList(2, argumentList); | ||||
florianlink
|
r24 | void* args[2] = {NULL, (void*)&arg__1}; | ||
PyObject* result = PythonQtSignalTarget::call(obj, methodInfo, args, true); | ||||
if (result) { Py_DECREF(result); } | ||||
Py_DECREF(obj); | ||||
return; | ||||
} | ||||
} | ||||
QUndoStack::timerEvent(arg__1); | ||||
} | ||||
florianlink
|
r13 | QUndoStack* PythonQtWrapper_QUndoStack::new_QUndoStack(QObject* parent) | ||
{ | ||||
florianlink
|
r24 | return new PythonQtShell_QUndoStack(parent); } | ||
florianlink
|
r13 | |||
florianlink
|
r73 | const QUndoCommand* PythonQtWrapper_QUndoStack::command(QUndoStack* theWrappedObject, int index) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->command(index)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QAction* PythonQtWrapper_QUndoStack::createUndoAction(QUndoStack* theWrappedObject, QObject* parent, const QString& prefix) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->createUndoAction(parent, prefix)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | bool PythonQtWrapper_QUndoStack::isActive(QUndoStack* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->isActive()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | bool PythonQtWrapper_QUndoStack::canRedo(QUndoStack* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->canRedo()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QUndoStack::index(QUndoStack* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->index()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QUndoStack::push(QUndoStack* theWrappedObject, QUndoCommand* cmd) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( theWrappedObject->push(cmd)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QUndoStack::count(QUndoStack* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->count()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QString PythonQtWrapper_QUndoStack::redoText(QUndoStack* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->redoText()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QUndoStack::cleanIndex(QUndoStack* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->cleanIndex()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QUndoStack::clear(QUndoStack* theWrappedObject) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( theWrappedObject->clear()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QAction* PythonQtWrapper_QUndoStack::createRedoAction(QUndoStack* theWrappedObject, QObject* parent, const QString& prefix) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->createRedoAction(parent, prefix)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | int PythonQtWrapper_QUndoStack::undoLimit(QUndoStack* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->undoLimit()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | bool PythonQtWrapper_QUndoStack::isClean(QUndoStack* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->isClean()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QUndoStack::setUndoLimit(QUndoStack* theWrappedObject, int limit) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( theWrappedObject->setUndoLimit(limit)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | bool PythonQtWrapper_QUndoStack::canUndo(QUndoStack* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->canUndo()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QUndoStack::beginMacro(QUndoStack* theWrappedObject, const QString& text) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( theWrappedObject->beginMacro(text)); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | void PythonQtWrapper_QUndoStack::endMacro(QUndoStack* theWrappedObject) | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | ( theWrappedObject->endMacro()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QString PythonQtWrapper_QUndoStack::undoText(QUndoStack* theWrappedObject) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->undoText()); | ||
florianlink
|
r13 | } | ||
florianlink
|
r73 | QString PythonQtWrapper_QUndoStack::text(QUndoStack* theWrappedObject, int idx) const | ||
florianlink
|
r13 | { | ||
florianlink
|
r73 | return ( theWrappedObject->text(idx)); | ||
florianlink
|
r13 | } | ||