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


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

本文整理汇总了C++中KnobGuiPtr::setSecret方法的典型用法代码示例。如果您正苦于以下问题:C++ KnobGuiPtr::setSecret方法的具体用法?C++ KnobGuiPtr::setSecret怎么用?C++ KnobGuiPtr::setSecret使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KnobGuiPtr的用法示例。


在下文中一共展示了KnobGuiPtr::setSecret方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: show

void
KnobGui::setSecret()
{
    bool showit = !isSecretRecursive();

    if (showit) {
        show(); //
    } else {
        hide();
    }
    KnobGuiGroup* isGrp = dynamic_cast<KnobGuiGroup*>(this);
    if (isGrp) {
        const std::list<KnobGuiWPtr>& children = isGrp->getChildren();
        for (std::list<KnobGuiWPtr>::const_iterator it = children.begin(); it != children.end(); ++it) {
            KnobGuiPtr k = it->lock();
            if (!k) {
                continue;
            }
            k->setSecret();
        }
    }
}
开发者ID:frostbane,项目名称:Natron,代码行数:22,代码来源:KnobGui10.cpp

示例2: KnobGuiPtr


//.........这里部分代码省略.........
                    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);
                    }
                }
            }


            //if (closestParentGroupTab) {
            ///See http://stackoverflow.com/questions/14033902/qt-qgridlayout-automatically-centers-moves-items-to-the-middle for
            ///a bug of QGridLayout: basically all items are centered, but we would like to add stretch in the bottom of the layout.
            ///To do this we add an empty widget with an expanding vertical size policy.
            /*QWidget* foundSpacer = 0;
               for (int i = 0; i < layout->rowCount(); ++i) {
                QLayoutItem* item = layout->itemAtPosition(i, 0);
                if (!item) {
                    continue;
                }
                QWidget* w = item->widget();
                if (!w) {
                    continue;
                }
                if (w->objectName() == QString::fromUtf8("emptyWidget")) {
                    foundSpacer = w;
                    break;
                }
               }
               if (foundSpacer) {
                layout->removeWidget(foundSpacer);
               } else {
                foundSpacer = new QWidget(layout->parentWidget());
                foundSpacer->setObjectName(QString::fromUtf8("emptyWidget"));
                foundSpacer->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);

               }

               ///And add our stretch
               layout->addWidget(foundSpacer,layout->rowCount(), 0, 1, 2);*/
            // }
        } // makeNewLine

        ret->setSecret();

        if ( knob->isNewLineActivated() && ret->shouldAddStretch() ) {
            fieldLayout->addStretch();
        }


        ///increment the row count
        ++page->second.currentRow;

        if (parentIsGroup && parentGui) {
            parentGui->addKnob(ret);
        }
    } //  if ( !ret->hasWidgetBeenCreated() && ( !isGroup || !isGroup->isTab() ) ) {
开发者ID:ChristianHeckl,项目名称:Natron,代码行数:101,代码来源:DockablePanelPrivate.cpp


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