本文整理汇总了C++中KnobGuiPtr::setEnabledSlot方法的典型用法代码示例。如果您正苦于以下问题:C++ KnobGuiPtr::setEnabledSlot方法的具体用法?C++ KnobGuiPtr::setEnabledSlot怎么用?C++ KnobGuiPtr::setEnabledSlot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KnobGuiPtr
的用法示例。
在下文中一共展示了KnobGuiPtr::setEnabledSlot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
KnobGuiGroup::setEnabled(const std::vector<bool>& perDimEnabled)
{
KnobGroupPtr knob = _knob.lock();
if (_button) {
_button->setEnabled(perDimEnabled[0]);
}
if (perDimEnabled[0]) {
for (std::list<KnobGuiWPtr>::iterator it = _children.begin(); it != _children.end(); ++it) {
KnobGuiPtr k = it->lock();
if (!k) {
continue;
}
k->setEnabledSlot();
}
} else {
for (std::list<KnobGuiWPtr>::iterator it = _children.begin(); it != _children.end(); ++it) {
KnobGuiPtr k = it->lock();
if (!k) {
continue;
}
k->onFrozenChanged(true);
}
}
}
示例2: KnobGuiPtr
//.........这里部分代码省略.........
* 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);
} else {
layout->addWidget(labelContainer, rowIndex, 0, 1, 1, Qt::AlignRight);
layout->addWidget(fieldContainer, rowIndex, 1, 1, 1);