int size = Shiboken::String::len(%PYARG_1);
if (size == 1) {
const char *str = Shiboken::String::toCString(%PYARG_1);
QChar ch(str[0]);
%RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(ch);
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
} else {
PyErr_SetString(PyExc_TypeError, "String must have only one character");
}
QTransform _result;
if (QTransform::quadToQuad(%1, %2, _result)) {
%PYARG_0 = %CONVERTTOPYTHON[QTransform](_result);
} else {
Py_INCREF(Py_None);
%PYARG_0 = Py_None;
}
QTransform _result;
if (QTransform::quadToSquare(%1, _result)) {
%PYARG_0 = %CONVERTTOPYTHON[QTransform](_result);
} else {
Py_INCREF(Py_None);
%PYARG_0 = Py_None;
}
QTransform _result;
if (QTransform::squareToQuad(%1, _result)) {
%PYARG_0 = %CONVERTTOPYTHON[QTransform](_result);
} else {
Py_INCREF(Py_None);
%PYARG_0 = Py_None;
}
uchar* buffer = (uchar*) Shiboken::Buffer::getPointer(%PYARG_2);
QBitmap %0 = QBitmap::fromData(%1, buffer, %3);
%PYARG_0 = %CONVERTTOPYTHON[QBitmap](%0);
%BEGIN_ALLOW_THREADS
%RETURN_TYPE %0 = %CPPSELF->::%TYPE::%FUNCTION_NAME(&%1, %2);
%END_ALLOW_THREADS
%PYARG_0 = PyTuple_New(2);
PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](%0));
PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](%1));
if (_i < 0 || _i >= %CPPSELF.count()) {
PyErr_SetString(PyExc_IndexError, "index out of bounds");
return 0;
}
int item = (*%CPPSELF)[_i];
return %CONVERTTOPYTHON[int](item);
%PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.data(), %CPPSELF.size());
PyObject* %out = Shiboken::Buffer::newObject(%in, size);
Py_ssize_t bufferLen;
char* %out = (char*) Shiboken::Buffer::getPointer(%PYARG_1, &bufferLen);
uint %out = bufferLen;
const QTextDocument* doc = %CPPSELF.document();
if (doc) {
Shiboken::AutoDecRef pyDocument(%CONVERTTOPYTHON[QTextDocument*](doc));
Shiboken::Object::setParent(pyDocument, %PYARG_1);
}
const QTextDocument* doc = %CPPSELF.document();
if (doc) {
Shiboken::AutoDecRef pyDocument(%CONVERTTOPYTHON[QTextDocument*](doc));
Shiboken::Object::setParent(pyDocument, %PYARG_0);
}
PyObject* points = PyList_New(%CPPSELF.count());
for (int i = 0, max = %CPPSELF.count(); i < max; ++i){
int x, y;
%CPPSELF.point(i, &x, &y);
QPoint pt = QPoint(x, y);
PyList_SET_ITEM(points, i, %CONVERTTOPYTHON[QPoint](pt));
}
// %FUNCTION_NAME()
*%CPPSELF << %1;
%PYARG_0 = %CONVERTTOPYTHON[QPolygon*](%CPPSELF);
// %FUNCTION_NAME()
*%CPPSELF << %1;
%PYARG_0 = %CONVERTTOPYTHON[QPolygon*](%CPPSELF);
if (**%CPPSELF) {
QTreeWidgetItemIterator* %0 = new QTreeWidgetItemIterator((*%CPPSELF)++);
%PYARG_0 = %CONVERTTOPYTHON[QTreeWidgetItemIterator*](%0);
}
QTreeWidgetItem* %0 = %CPPSELF.operator*();
%PYARG_0 = %CONVERTTOPYTHON[QTreeWidgetItem*](%0);
Shiboken::Object::releaseOwnership(%PYARG_0);
Shiboken::AutoDecRef strList(PySequence_Fast(%PYARG_1, "Invalid sequence."));
int lineCount = PySequence_Fast_GET_SIZE(strList.object());
for (int line = 0; line < lineCount; ++line) {
if (!Shiboken::String::check(PySequence_Fast_GET_ITEM(strList.object(), line))) {
PyErr_SetString(PyExc_TypeError, "The argument must be a sequence of strings.");
break;
}
}
const char** xpm = (const char**) malloc (lineCount * sizeof(const char**));
for (int line = 0; line < lineCount; ++line)
xpm[line] = Shiboken::String::toCString(PySequence_Fast_GET_ITEM(strList.object(), line));
%BEGIN_ALLOW_THREADS
%0 = new %TYPE(xpm);
%END_ALLOW_THREADS
free(xpm);
%0 = new %TYPE(QPixmap::fromImage(%1));
const uchar* %out = reinterpret_cast<const uchar*>(PyBytes_AS_STRING(%PYARG_1));
uint %out = static_cast<uint>(PyBytes_Size(%PYARG_1));
%ARG1_TYPE a, b;
%CPPSELF.%FUNCTION_NAME(%1, %2, &a, &b);
%PYARG_0 = PyTuple_New(2);
PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%ARG1_TYPE](a));
PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](b));
uchar* ptr = (uchar*) Shiboken::Buffer::getPointer(%PYARG_1);
%0 = new %TYPE(ptr, %ARGS);
%PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.byteCount());
// byteCount() is only available on Qt4.7, so we use bytesPerLine * height
%PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(), %CPPSELF.bytesPerLine() * %CPPSELF.height(), Shiboken::Buffer::ReadWrite);
%PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(%1), %CPPSELF.bytesPerLine());
%PYARG_0 = Shiboken::Buffer::newObject(%CPPSELF.%FUNCTION_NAME(%1), %CPPSELF.bytesPerLine(), Shiboken::Buffer::ReadWrite);
switch(%CPPSELF.spec()) {
case QColor::Rgb:
{
qreal r, g, b, a;
%CPPSELF.getRgbF(&r, &g, &b, &a);
QString repr = QString().sprintf("PySide.QtGui.QColor.fromRgbF(%.6f, %.6f, %.6f, %.6f)", r, g, b, a);
%PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));
break;
}
case QColor::Hsv:
{
qreal h, s, v, a;
%CPPSELF.getHsvF(&h, &s, &v, &a);
QString repr = QString().sprintf("PySide.QtGui.QColor.fromHsvF(%.6f, %.6f, %.6f, %.6f)", h, s, v, a);
%PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));
break;
}
case QColor::Cmyk:
{
qreal c, m, y, k, a;
%CPPSELF.getCmykF(&c, &m, &y, &k, &a);
QString repr = QString().sprintf("PySide.QtGui.QColor.fromCmykF(%.6f, %.6f, %.6f, %.6f, %.6f)", c, m, y, k, a);
%PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));
break;
}
#if QT_VERSION >= 0x040600
case QColor::Hsl:
{
qreal h, s, l, a;
%CPPSELF.getHslF(&h, &s, &l, &a);
QString repr = QString().sprintf("PySide.QtGui.QColor.fromHslF(%.6f, %.6f, %.6f, %.6f)", h, s, l, a);
%PYARG_0 = Shiboken::String::fromCString(qPrintable(repr));
break;
}
#endif
default:
{
%PYARG_0 = Shiboken::String::fromCString("PySide.QtGui.QColor()");
}
}
Shiboken::AutoDecRef func(PyObject_GetAttr(%PYSELF, PyTuple_GET_ITEM(%1, 0)));
PyObject* args = PyTuple_GET_ITEM(%1, 1);
%PYARG_0 = PyObject_Call(func, args, NULL);
switch(%CPPSELF.spec()) {
case QColor::Rgb:
{
qreal r, g, b, a;
%CPPSELF.getRgbF(&r, &g, &b, &a);
%PYARG_0 = Py_BuildValue("(ON(s(ffff)))", Py_TYPE(%PYSELF), PyTuple_New(0), "setRgbF", (float)r, (float)g, (float)b, (float)a);
break;
}
case QColor::Hsv:
{
qreal h, s, v, a;
%CPPSELF.getHsvF(&h, &s, &v, &a);
%PYARG_0 = Py_BuildValue("(ON(s(ffff)))", Py_TYPE(%PYSELF), PyTuple_New(0), "setHsvF", (float)h, (float)s, (float)v, (float)a);
break;
}
case QColor::Cmyk:
{
qreal c, m, y, k, a;
%CPPSELF.getCmykF(&c, &m, &y, &k, &a);
%PYARG_0 = Py_BuildValue("(ON(s(fffff)))", Py_TYPE(%PYSELF), PyTuple_New(0), "setCmykF", (float)c, (float)m, (float)y, (float)k, (float)a);
break;
}
#if QT_VERSION >= 0x040600
case QColor::Hsl:
{
qreal h, s, l, a;
%CPPSELF.getHslF(&h, &s, &l, &a);
%PYARG_0 = Py_BuildValue("(ON(s(ffff)))", Py_TYPE(%PYSELF), PyTuple_New(0), "setHslF", (float)h, (float)s, (float)l, (float)a);
break;
}
#endif
default:
{
%PYARG_0 = Py_BuildValue("(N(O))", PyObject_Type(%PYSELF), Py_None);
}
}
switch(%CPPSELF.spec()) {
case QColor::Rgb:
{
int r, g, b, a;
%CPPSELF.getRgb(&r, &g, &b, &a);
%PYARG_0 = Py_BuildValue("iiii", r, g, b, a);
break;
}
case QColor::Hsv:
{
int h, s, v, a;
%CPPSELF.getHsv(&h, &s, &v, &a);
%PYARG_0 = Py_BuildValue("iiii", h, s, v, a);
break;
}
case QColor::Cmyk:
{
int c, m, y, k, a;
%CPPSELF.getCmyk(&c, &m, &y, &k, &a);
%PYARG_0 = Py_BuildValue("iiiii", c, m, y, k, a);
break;
}
case QColor::Hsl:
{
int h, s, l, a;
%CPPSELF.getHsl(&h, &s, &l, &a);
%PYARG_0 = Py_BuildValue("iiii", h, s, l, a);
break;
}
default:
{
%PYARG_0 = 0;
}
}
if (%1.type() == QVariant::Color)
%0 = new %TYPE(%1.value<QColor>());
else
PyErr_SetString(PyExc_TypeError, "QVariant must be holding a QColor");
int* array = NULL;
bool errorOccurred = false;
if (numArgs == 5) {
array = Shiboken::sequenceToIntArray(%PYARG_5, true);
if (PyErr_Occurred()) {
if (array)
delete []array;
errorOccurred = true;
}
}
if (!errorOccurred) {
%RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, array);
if (array)
delete []array;
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
}
int* array = NULL;
bool errorOccurred = false;
if (numArgs == 4) {
array = Shiboken::sequenceToIntArray(%PYARG_4, true);
if (PyErr_Occurred()) {
if (array)
delete []array;
errorOccurred = true;
}
}
if (!errorOccurred) {
%RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, array);
if (array)
delete []array;
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
}
int* array = NULL;
bool errorOccurred = false;
if (numArgs == 8) {
array = Shiboken::sequenceToIntArray(%PYARG_8, true);
if (PyErr_Occurred()) {
if (array)
delete []array;
errorOccurred = true;
}
}
if (!errorOccurred) {
%RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, %5, %6, %7, array);
if (array)
delete []array;
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
}
int* array = NULL;
bool errorOccurred = false;
if (numArgs == 5) {
array = Shiboken::sequenceToIntArray(%PYARG_5, true);
if (PyErr_Occurred()) {
if (array)
delete []array;
errorOccurred = true;
}
}
if (!errorOccurred) {
%RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, %4, array);
if (array)
delete []array;
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
}
int* array = NULL;
bool errorOccurred = false;
if (numArgs == 4) {
array = Shiboken::sequenceToIntArray(%PYARG_4, true);
if (PyErr_Occurred()) {
if (array)
delete []array;
errorOccurred = true;
}
}
if (!errorOccurred) {
%RETURN_TYPE retval = %CPPSELF.%FUNCTION_NAME(%1, %2, %3, array);
if (array)
delete []array;
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](retval);
}
PyObject* userTypeConstant = PyInt_FromLong(QGraphicsItem::UserType);
PyDict_SetItemString(Sbk_QGraphicsItem_Type.super.ht_type.tp_dict, "UserType", userTypeConstant);
if (%0) {
QObject* parent = %0->parent();
Shiboken::AutoDecRef pyParent(%CONVERTTOPYTHON[QObject*](parent));
Shiboken::Object::setParent(pyParent, %PYARG_0);
}
QGraphicsItem *item_ = NULL;
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(&item_);
%PYARG_0 = PyTuple_New(2);
PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QGraphicsItem*](item_));
Shiboken::Object::releaseOwnership(%PYARG_2);
//this function is static we need keep ref to default value, to be able to call python virtual functions
static PyObject* _defaultValue = 0;
%CPPSELF.%FUNCTION_NAME(%1);
Py_INCREF(%PYARG_1);
if (_defaultValue)
Py_DECREF(_defaultValue);
_defaultValue = %PYARG_1;
%PYARG_0 = addActionWithPyObject(%CPPSELF, QIcon(), %1, %2, %3);
%PYARG_0 = addActionWithPyObject(%CPPSELF, %1, %2, %3, %4);
Shiboken::BindingManager& bm = Shiboken::BindingManager::instance();
PyObject* pyObj;
foreach(QAction* act, %CPPSELF.actions()) {
if ((pyObj = (PyObject*)bm.retrieveWrapper(act)) != 0) {
Py_INCREF(pyObj);
Shiboken::Object::setParent(NULL, pyObj);
Shiboken::Object::invalidate(pyObj);
Py_DECREF(pyObj);
}
}
%PYARG_0 = addActionWithPyObject(%CPPSELF, %1, %2);
foreach(QAction *act, %CPPSELF.actions()) {
Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act));
Shiboken::Object::setParent(NULL, pyAct);
Shiboken::Object::invalidate(pyAct);
}
QPixmap p;
if (%CPPSELF.%FUNCTION_NAME(%1, &p)) {
%PYARG_0 = %CONVERTTOPYTHON[QPixmap](p);
} else {
%PYARG_0 = Py_None;
Py_INCREF(%PYARG_0);
}
%0 = new %TYPE(%1, %2);
Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, "connect", "OsO", %PYSELF, SIGNAL(activated()), %PYARG_3));
if (!result.isNull())
Shiboken::Object::setParent(%PYARG_2, %PYSELF);
// Clear parent from the old child
QStandardItem* _i = %CPPSELF->child(%1, %2);
if (_i) {
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
Shiboken::Object::setParent(0, _pyI);
}
// Clear parent from the old child
QStandardItem* _i = %CPPSELF->child(%1);
if (_i) {
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
Shiboken::Object::setParent(0, _pyI);
}
QWidget *_widget = %CPPSELF.widget(%1);
if (_widget) {
Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](_widget));
Shiboken::Object::setParent(0, pyWidget);
}
QValidator::State %out;
if (PySequence_Check(%PYARG_0)) {
Shiboken::AutoDecRef seq(PySequence_Fast(%PYARG_0, 0));
int size = PySequence_Fast_GET_SIZE(seq.object());
if (size > 1) {
if (%ISCONVERTIBLE[QString](PySequence_Fast_GET_ITEM(seq.object(), 1)))
%1 = %CONVERTTOCPP[QString](PySequence_Fast_GET_ITEM(seq.object(), 1));
else
qWarning("%TYPE::%FUNCTION_NAME: Second tuple element is not convertible to unicode.");
}
if (size > 2) {
if (%ISCONVERTIBLE[int](PySequence_Fast_GET_ITEM(seq.object(), 2)))
%2 = %CONVERTTOCPP[int](PySequence_Fast_GET_ITEM(seq.object(), 2));
else
qWarning("%TYPE::%FUNCTION_NAME: Second tuple element is not convertible to int.");
}
%PYARG_0 = PySequence_Fast_GET_ITEM(seq.object(), 0);
Py_INCREF(%PYARG_0); // we need to incref, because "%PYARG_0 = ..." will decref the tuple and the tuple will be decrefed again at the end of this scope.
}
// check retrun value
if (%ISCONVERTIBLE[QValidator::State](%PYARG_0)) {
%out = %CONVERTTOCPP[QValidator::State](%PYARG_0);
} else {
PyErr_Format(PyExc_TypeError, "Invalid return value in function %s, expected %s, got %s.",
"QValidator.validate",
"PySide.QtGui.QValidator.State, (PySide.QtGui.QValidator.State,), (PySide.QtGui.QValidator.State, unicode) or (PySide.QtGui.QValidator.State, unicode, int)",
pyResult->ob_type->tp_name);
return QValidator::State();
}
bool ret = !(&%CPPSELF == %1);
%PYARG_0 = %CONVERTTOPYTHON[bool](ret);
addLayoutOwnership(%CPPSELF, %0);
removeLayoutOwnership(%CPPSELF, %1);
removeLayoutOwnership(%CPPSELF, %1);
addLayoutOwnership(%CPPSELF, %1);
addLayoutOwnership(%CPPSELF, %1);
addLayoutOwnership(%CPPSELF, %1);
addLayoutOwnership(%CPPSELF, %1);
addLayoutOwnership(%CPPSELF, %1);
addLayoutOwnership(%CPPSELF, %2);
addLayoutOwnership(%CPPSELF, %1);
addLayoutOwnership(%CPPSELF, %1);
addLayoutOwnership(%CPPSELF, %2);
addLayoutOwnership(%CPPSELF, %2);
addLayoutOwnership(%CPPSELF, %2);
addLayoutOwnership(%CPPSELF, %1);
addLayoutOwnership(%CPPSELF, %2);
addLayoutOwnership(%CPPSELF, %0);
addLayoutOwnership(%CPPSELF, %1);
addLayoutOwnership(%CPPSELF, %1);
addLayoutOwnership(%CPPSELF, %1);
addLayoutOwnership(%CPPSELF, %1);
addLayoutOwnership(%CPPSELF, %1);
int a, b, c, d;
%CPPSELF.%FUNCTION_NAME(%1, &a, &b, &c, &d);
%PYARG_0 = PyTuple_New(4);
PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](a));
PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[int](b));
PyTuple_SET_ITEM(%PYARG_0, 2, %CONVERTTOPYTHON[int](c));
PyTuple_SET_ITEM(%PYARG_0, 3, %CONVERTTOPYTHON[int](d));
int %out = PySequence_Size(%PYARG_1);
int numItems = PySequence_Size(%PYARG_1);
Shiboken::AutoArrayPointer<QGraphicsItem*> %out(numItems);
for (int i=0; i < numItems; i++) {
%out[i] = %CONVERTTOCPP[QGraphicsItem*](PySequence_Fast_GET_ITEM(%PYARG_1, i));
}
Shiboken::AutoDecRef object(PyList_New(0));
for (int i=0, max=numItems; i < max; i++) {
PyList_Append(object, %CONVERTTOPYTHON[QGraphicsItem*](%in[i]));
}
PyObject *%out = object.object();
Shiboken::AutoDecRef option_object(PyList_New(0));
for (int i=0, max=numItems; i < max; i++) {
const QStyleOptionGraphicsItem* item = &%in[i];
PyList_Append(option_object, %CONVERTTOPYTHON[QStyleOptionGraphicsItem](item));
}
PyObject* %out = option_object.object();
int numOptions = PySequence_Size(%PYARG_2);
Shiboken::AutoArrayPointer<QStyleOptionGraphicsItem> %out(numOptions);
for (int i=0; i < numOptions; i++) {
%out[i] = %CONVERTTOCPP[QStyleOptionGraphicsItem](PySequence_Fast_GET_ITEM(%PYARG_1, i));
}
QGraphicsItem* parentItem = %1->parentItem();
Shiboken::AutoDecRef parent(%CONVERTTOPYTHON[QGraphicsItem*](parentItem));
foreach (QGraphicsItem* item, %1->children())
Shiboken::Object::setParent(parent, %CONVERTTOPYTHON[QGraphicsItem*](item));
%BEGIN_ALLOW_THREADS
%CPPSELF.%FUNCTION_NAME(%1);
%END_ALLOW_THREADS
// the arg was destroyed by Qt.
Shiboken::Object::invalidate(%PYARG_1);
%RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, %2);
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
Shiboken::Object::keepReference((SbkObject*)%PYARG_0, "setWidget(QWidget*)1", %PYARG_1);
const QList<QGraphicsItem*> items = %CPPSELF.items();
Shiboken::BindingManager& bm = Shiboken::BindingManager::instance();
foreach (QGraphicsItem* item, items) {
SbkObject* obj = bm.retrieveWrapper(item);
if (obj) {
if (reinterpret_cast<PyObject*>(obj)->ob_refcnt > 1) // If the refcnt is 1 the object will vannish anyway.
Shiboken::Object::invalidate(obj);
Shiboken::Object::removeParent(obj);
}
}
%CPPSELF.%FUNCTION_NAME();
QTreeWidgetItem *rootItem = %CPPSELF.invisibleRootItem();
Shiboken::BindingManager &bm = Shiboken::BindingManager::instance();
for (int i = 0; i < rootItem->childCount(); ++i) {
QTreeWidgetItem *item = rootItem->child(i);
SbkObject* wrapper = bm.retrieveWrapper(item);
if (wrapper)
Shiboken::Object::setParent(0, reinterpret_cast<PyObject*>(wrapper));
}
// Only call the parent function if this return some value
// the parent can be the TreeWidget
if (%0)
Shiboken::Object::setParent(%PYARG_0, %PYSELF);
// Only call the parent function if this return some value
// the parent can be the TreeWidgetItem
if (%0)
Shiboken::Object::setParent(%PYARG_0, %PYSELF);
Shiboken::Object::keepReference(reinterpret_cast<SbkObject*>(%PYSELF), "__style__", %PYARG_1);
QStyle* myStyle = %CPPSELF->style();
if (myStyle && qApp) {
%PYARG_0 = %CONVERTTOPYTHON[QStyle*](myStyle);
QStyle *appStyle = qApp->style();
if (appStyle == myStyle) {
Shiboken::AutoDecRef pyApp(%CONVERTTOPYTHON[QApplication*](qApp));
Shiboken::Object::setParent(pyApp, %PYARG_0);
Shiboken::Object::releaseOwnership(%PYARG_0);
} else {
Shiboken::Object::keepReference(reinterpret_cast<SbkObject*>(%PYSELF), "__style__", %PYARG_0);
}
}
qwidgetSetLayout(%CPPSELF, %1);
// %FUNCTION_NAME() - disable generation of function call.
Returns the window system identifier of the widget.
Portable in principle, but if you use it you are probably about to do something non-portable. Be careful.
If a widget is non-native (alien) and winId() is invoked on it, that widget will be provided a native handle.
On X11 the type returned is long, on other platforms it's void pointer casted to a Python long long.
This value may change at run-time. An event with type PySide.QtCore.QEvent.WinIdChange will be sent to the widget following a change in window system identifier.
QWidget* tab = %CPPSELF.widget(%1);
if (tab) {
Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](tab));
%CPPSELF.%FUNCTION_NAME(%1);
}
for (int i = 0; i < %CPPSELF.count(); i++) {
QWidget* widget = %CPPSELF.widget(i);
Shiboken::AutoDecRef pyWidget(%CONVERTTOPYTHON[QWidget*](widget));
Shiboken::Object::setParent(0, pyWidget);
}
%CPPSELF.%FUNCTION_NAME();
// Clear parent from the old child
QStandardItem* _i = %CPPSELF->item(%1, %2);
if (_i) {
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
Shiboken::Object::setParent(0, _pyI);
}
// Clear parent from the old child
QStandardItem* _i = %CPPSELF->item(%1);
if (_i) {
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
Shiboken::Object::setParent(0, _pyI);
}
// Clear parent from the old child
QStandardItem* _i = %CPPSELF->verticalHeaderItem(%1);
if (_i) {
PyObject* _pyI = %CONVERTTOPYTHON[QStandardItem*](_i);
Shiboken::Object::setParent(0, _pyI);
}
for(int r=0, r_max = %CPPSELF.rowCount(); r < r_max; r++) {
QList<QStandardItem *> ri = %CPPSELF.takeRow(0);
PyObject *pyResult = %CONVERTTOPYTHON[QList<QStandardItem * >](ri);
Shiboken::Object::setParent(Py_None, pyResult);
Py_XDECREF(pyResult);
}
%BEGIN_ALLOW_THREADS
%RETURN_TYPE retval_ = %CPPSELF.%FUNCTION_NAME(%1, %2);
%END_ALLOW_THREADS
%PYARG_0 = PyTuple_New(2);
PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](retval_));
PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[%ARG1_TYPE](%1));
::
def callback_int(value_as_int):
print 'int value changed:', repr(value_as_int)
app = QApplication(sys.argv)
spinbox = QSpinBox()
spinbox.valueChanged[unicode].connect(callback_unicode)
spinbox.show()
sys.exit(app.exec_())
::
def callback_unicode(value_as_unicode):
print 'unicode value changed:', repr(value_as_unicode)
app = QApplication(sys.argv)
spinbox = QSpinBox()
spinbox.valueChanged[unicode].connect(callback_unicode)
spinbox.show()
sys.exit(app.exec_())
QAction* action = %CPPSELF.addAction(%1, %2);
%PYARG_0 = %CONVERTTOPYTHON[QAction*](action);
Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0, "connect", "OsO", %PYARG_0, SIGNAL(triggered()), %PYARG_3));
QAction* action = %CPPSELF.addAction(%1);
%PYARG_0 = %CONVERTTOPYTHON[QAction*](action);
Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0, "connect", "OsO", %PYARG_0, SIGNAL(triggered()), %PYARG_2));
QList<PyObject* > lst;
Shiboken::BindingManager& bm = Shiboken::BindingManager::instance();
foreach(QToolButton* child, %CPPSELF.findChildren<QToolButton*>()) {
if (bm.hasWrapper(child)) {
PyObject* pyChild = %CONVERTTOPYTHON[QToolButton*](child);
Shiboken::Object::setParent(0, pyChild);
lst << pyChild;
}
}
//Remove actions
foreach(QAction *act, %CPPSELF.actions()) {
Shiboken::AutoDecRef pyAct(%CONVERTTOPYTHON[QAction*](act));
Shiboken::Object::setParent(NULL, pyAct);
Shiboken::Object::invalidate(pyAct);
}
%CPPSELF.clear();
foreach(PyObject* obj, lst) {
Shiboken::Object::invalidate(reinterpret_cast<SbkObject* >(obj));
Py_XDECREF(obj);
}
%BEGIN_ALLOW_THREADS
%CPPSELF.%FUNCTION_NAME(%1.data(), %1.size());
%END_ALLOW_THREADS
%BEGIN_ALLOW_THREADS
%CPPSELF.%FUNCTION_NAME(%1.data(), %1.size(), %2);
%END_ALLOW_THREADS
%BEGIN_ALLOW_THREADS
%CPPSELF.%FUNCTION_NAME(%1.data(), %1.size(), %2);
%END_ALLOW_THREADS
PyObject* moduleQtGui;
QApplicationConstructor(%PYSELF, %1, &%0);
QApplicationConstructor(%PYSELF, %1, %2, &%0);
QApplicationConstructor(%PYSELF, %1, %2, &%0);
Shiboken::Object::setParent(%CONVERTTOPYTHON[QApplication*](qApp), %PYARG_1);
int _row;
QFormLayout::ItemRole _role;
%BEGIN_ALLOW_THREADS
%CPPSELF->%FUNCTION_NAME(%ARGUMENT_NAMES, &_row, &_role);
%END_ALLOW_THREADS
%PYARG_0 = PyTuple_New(2);
PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[int](_row));
PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QFormLayout::ItemRole](_role));
QWidget* _old = %CPPSELF.widget();
if (_old)
Shiboken::Object::setParent(NULL, %CONVERTTOPYTHON[QWidget*](_old));
%CPPSELF.%FUNCTION_NAME(%1);
Shiboken::Object::setParent(%PYSELF, %PYARG_1);
*%CPPSELF += %1;
return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF);
*%CPPSELF -= %1;
return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF);
*%CPPSELF *= %1;
return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF);
*%CPPSELF /= %1;
return %CONVERTTOPYTHON[%RETURN_TYPE](*%CPPSELF);
if (PySequence_Size(%PYARG_1) == 16) {
qreal values[16];
for(int i=0; i < 16; i++) {
PyObject *pv = PySequence_Fast_GET_ITEM(%PYARG_1, i);
values[i] = PyFloat_AsDouble(pv);
}
%0 = new %TYPE(values[0], values[1], values[2], values[3],
values[4], values[5], values[6], values[7],
values[8], values[9], values[10], values[11],
values[12], values[13], values[14], values[15]);
}
qreal values[16];
%CPPSELF.%FUNCTION_NAME(values);
%PYARG_0 = PyTuple_New(16);
for(int i=0; i < 16; i++) {
PyObject *v = PyFloat_FromDouble(values[i]);
PyTuple_SET_ITEM(%PYARG_0, i, v);
}
if (PySequence_Check(_key)) {
Shiboken::AutoDecRef key(PySequence_Fast(_key, "Invalid matrix index."));
if (PySequence_Fast_GET_SIZE(key.object()) == 2) {
PyObject* posx = PySequence_Fast_GET_ITEM(key.object(), 0);
PyObject* posy = PySequence_Fast_GET_ITEM(key.object(), 1);
Py_ssize_t x = PyInt_AsSsize_t(posx);
Py_ssize_t y = PyInt_AsSsize_t(posy);
qreal ret = (*%CPPSELF)(x,y);
return %CONVERTTOPYTHON[qreal](ret);
}
}
PyErr_SetString(PyExc_IndexError, "Invalid matrix index.");
return 0;