本文整理汇总了C++中QStackedLayout::parentWidget方法的典型用法代码示例。如果您正苦于以下问题:C++ QStackedLayout::parentWidget方法的具体用法?C++ QStackedLayout::parentWidget怎么用?C++ QStackedLayout::parentWidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QStackedLayout
的用法示例。
在下文中一共展示了QStackedLayout::parentWidget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SIPLong_FromLong
static PyObject *meth_QStackedLayout_insertWidget(PyObject *sipSelf, PyObject *sipArgs)
{
PyObject *sipParseErr = NULL;
{
int a0;
QWidget* a1;
PyObject *a1Wrapper;
QStackedLayout *sipCpp;
if (sipParseArgs(&sipParseErr, sipArgs, "[email protected]", &sipSelf, sipType_QStackedLayout, &sipCpp, &a0, &a1Wrapper, sipType_QWidget, &a1))
{
int sipRes = 0;
#line 74 "/Users/Kunwiji/Dropbox/Spectroscopy_paper/PyQt-mac-gpl-4.11.2/sip/QtGui/qstackedlayout.sip"
Py_BEGIN_ALLOW_THREADS
sipCpp->insertWidget(a0, a1);
Py_END_ALLOW_THREADS
// The layout's parent widget (if there is one) will now have ownership.
QWidget *parent = sipCpp->parentWidget();
if (parent)
{
PyObject *py_parent = sipGetPyObject(parent, sipType_QWidget);
if (py_parent)
sipTransferTo(a1Wrapper, py_parent);
}
else
{
// For now give the Python ownership to the layout. This maintains
// compatibility with previous versions and allows insertWidget(QWidget()).
sipTransferTo(a1Wrapper, sipSelf);
}
#line 704 "/Users/Kunwiji/Dropbox/Spectroscopy_paper/PyQt-mac-gpl-4.11.2/QtGui/sipQtGuiQStackedLayout.cpp"
return SIPLong_FromLong(sipRes);
}
}
/* Raise an exception if the arguments couldn't be parsed. */
sipNoMethod(sipParseErr, sipName_QStackedLayout, sipName_insertWidget, doc_QStackedLayout_insertWidget);
return NULL;
}