void MToolBarLayoutPolicy::activateMiddleSpacers(bool activate) { int base = 1+(leftSpacer ? 1 : 0); for (int i=base; i<MLinearLayoutPolicy::count()-1; i += 2) { QGraphicsLayoutItem *item = MLinearLayoutPolicy::itemAt(i); if (item) { if (activate) { item->setMaximumWidth(-1); item->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred); } else { item->setMaximumWidth(0); item->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); } } } }
static PyObject *meth_QGraphicsLayoutItem_setSizePolicy(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds) { PyObject *sipParseErr = NULL; { const QSizePolicy* a0; QGraphicsLayoutItem *sipCpp; if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, NULL, NULL, "BJ9", &sipSelf, sipType_QGraphicsLayoutItem, &sipCpp, sipType_QSizePolicy, &a0)) { Py_BEGIN_ALLOW_THREADS sipCpp->setSizePolicy(*a0); Py_END_ALLOW_THREADS Py_INCREF(Py_None); return Py_None; } } { QSizePolicy::Policy a0; QSizePolicy::Policy a1; QSizePolicy::ControlType a2 = QSizePolicy::DefaultType; QGraphicsLayoutItem *sipCpp; static const char *sipKwdList[] = { NULL, NULL, sipName_controlType, }; if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, NULL, "BEE|E", &sipSelf, sipType_QGraphicsLayoutItem, &sipCpp, sipType_QSizePolicy_Policy, &a0, sipType_QSizePolicy_Policy, &a1, sipType_QSizePolicy_ControlType, &a2)) { Py_BEGIN_ALLOW_THREADS sipCpp->setSizePolicy(a0,a1,a2); Py_END_ALLOW_THREADS Py_INCREF(Py_None); return Py_None; } } /* Raise an exception if the arguments couldn't be parsed. */ sipNoMethod(sipParseErr, sipName_QGraphicsLayoutItem, sipName_setSizePolicy, doc_QGraphicsLayoutItem_setSizePolicy); return NULL; }