当前位置: 首页>>代码示例>>C++>>正文


C++ KnobGuiPtr::setEnabledSlot方法代码示例

本文整理汇总了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);
        }
    }
}
开发者ID:azerupi,项目名称:Natron,代码行数:27,代码来源:KnobGuiGroup.cpp

示例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);
开发者ID:ChristianHeckl,项目名称:Natron,代码行数:67,代码来源:DockablePanelPrivate.cpp


注:本文中的KnobGuiPtr::setEnabledSlot方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。