本文整理汇总了C++中KnobGuiPtr::createGUI方法的典型用法代码示例。如果您正苦于以下问题:C++ KnobGuiPtr::createGUI方法的具体用法?C++ KnobGuiPtr::createGUI怎么用?C++ KnobGuiPtr::createGUI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KnobGuiPtr
的用法示例。
在下文中一共展示了KnobGuiPtr::createGUI方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: KnobGuiPtr
//.........这里部分代码省略.........
if (closestParentGroupTab) {
/*
* At this point we know that the parent group (which is a tab in the TabWidget) will have at least 1 knob
* so ensure it is added to the TabWidget.
* There are 2 possibilities, either the parent of the group tab is another group, in which case we have to
* make sure the TabWidget is visible in the parent TabWidget of the group, otherwise we just add the TabWidget
* to the on of the page.
*/
KnobPtr parentParent = closestParentGroupTab->getParentKnob();
KnobGroup* parentParentIsGroup = dynamic_cast<KnobGroup*>( parentParent.get() );
boost::shared_ptr<KnobPage> parentParentIsPage = boost::dynamic_pointer_cast<KnobPage>(parentParent);
assert(parentParentIsGroup || parentParentIsPage);
if (parentParentIsGroup) {
KnobGuiGroup* parentParentGroupGui = dynamic_cast<KnobGuiGroup*>( findKnobGuiOrCreate( parentParent, true,
ret->getFieldContainer() ).get() );
assert(parentParentGroupGui);
if (parentParentGroupGui) {
TabGroup* groupAsTab = parentParentGroupGui->getOrCreateTabWidget();
assert(groupAsTab);
layout = groupAsTab->addTab( closestParentGroupTab, QString::fromUtf8( closestParentGroupTab->getLabel().c_str() ) );
}
} else if (parentParentIsPage) {
PageMap::iterator page = getOrCreatePage(parentParentIsPage);
assert( page != _pages.end() );
assert(page->second.groupAsTab);
layout = page->second.groupAsTab->addTab( closestParentGroupTab, QString::fromUtf8( closestParentGroupTab->getLabel().c_str() ) );
}
assert(layout);
}
///fill the fieldLayout with the widgets
ret->createGUI(layout, fieldContainer, labelContainer, label, warningLabel, fieldLayout, makeNewLine, knobsOnSameLine);
ret->setEnabledSlot();
///Must add the row to the layout before calling setSecret()
if (makeNewLine) {
int rowIndex;
if (closestParentGroupTab) {
rowIndex = layout->rowCount();
} else if ( parentGui && knob->isDynamicallyCreated() ) {
const std::list<KnobGuiWPtr>& children = parentGui->getChildren();
if ( children.empty() ) {
rowIndex = parentGui->getActualIndexInLayout();
} else {
rowIndex = children.back().lock()->getActualIndexInLayout();
}
++rowIndex;
} else {
rowIndex = page->second.currentRow;
}
const bool labelOnSameColumn = ret->isLabelOnSameColumn();
if (!hasLabel) {
layout->addWidget(fieldContainer, rowIndex, 0, 1, 2);
} else {
if (label) {
if (labelOnSameColumn) {
labelLayout->addWidget(fieldContainer);
layout->addWidget(labelContainer, rowIndex, 0, 1, 2);