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


C++ KnobIPtr::getInViewerContextSecret方法代码示例

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


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

示例1: QDialog


//.........这里部分代码省略.........

    if (isButtonKnob && knob->isUserKnob()) {
        QWidget* rowContainer = new QWidget(this);
        QHBoxLayout* rowLayout = new QHBoxLayout(rowContainer);
        rowLayout->setContentsMargins(0, 0, 0, 0);

        QString text;
        text = tr("Button Unchecked Icon:");

        QString tooltip;
        tooltip = NATRON_NAMESPACE::convertFromPlainText(tr("The icon of the button when unchecked"), NATRON_NAMESPACE::WhiteSpaceNormal);

        _imp->uncheckedIconLabel = new Label(text, this);
        _imp->uncheckedIconLineEdit = new LineEdit(rowContainer);
        _imp->uncheckedIconLineEdit->setToolTip(tooltip);
        _imp->uncheckedIconLabel->setToolTip(tooltip);

        _imp->uncheckedIconLineEdit->setText( QString::fromUtf8( knob->getInViewerContextIconFilePath(false).c_str() ) );

        rowLayout->addWidget(_imp->uncheckedIconLineEdit);
        rowLayout->addStretch();

        _imp->mainLayout->addRow(_imp->uncheckedIconLabel, rowContainer);
    }

    {
        QWidget* rowContainer = new QWidget(this);
        QHBoxLayout* rowLayout = new QHBoxLayout(rowContainer);
        rowLayout->setContentsMargins(0, 0, 0, 0);

        QString text = tr("Layout Type:");
        QString tooltip = NATRON_NAMESPACE::convertFromPlainText(tr("The layout type for this parameter"), NATRON_NAMESPACE::WhiteSpaceNormal);
        _imp->layoutTypeLabel = new Label(text, this);
        _imp->layoutTypeChoice = new ComboBox(rowContainer);
        _imp->layoutTypeLabel->setToolTip(tooltip);
        _imp->layoutTypeChoice->setToolTip(tooltip);
        _imp->layoutTypeChoice->addItem(tr("Spacing (px)"), QIcon(), QKeySequence(), tr("The spacing in pixels to add after the parameter"));
        _imp->layoutTypeChoice->addItem(tr("Separator"), QIcon(), QKeySequence(), tr("A vertical line will be added after the parameter"));
        _imp->layoutTypeChoice->addItem(tr("Stretch After"), QIcon(), QKeySequence(), tr("The layout will be stretched between this parameter and the next"));
        _imp->layoutTypeChoice->addItem(tr("New Line"), QIcon(), QKeySequence(), tr("A new line will be added after this parameter"));

        ViewerContextLayoutTypeEnum type = knob->getInViewerContextLayoutType();
        _imp->layoutTypeChoice->setCurrentIndex_no_emit((int)type);

        QObject::connect(_imp->layoutTypeChoice, SIGNAL(currentIndexChanged(int)), this, SLOT(onLayoutTypeChoiceChanged(int)));
        rowLayout->addWidget(_imp->layoutTypeChoice);

        _imp->itemSpacingSpinbox = new SpinBox(rowContainer, SpinBox::eSpinBoxTypeInt);
        _imp->itemSpacingSpinbox->setMinimum(0);
        _imp->itemSpacingSpinbox->setValue(_imp->knob->getInViewerContextItemSpacing());
        _imp->itemSpacingSpinbox->setVisible(_imp->layoutTypeChoice->activeIndex() == 0);
        _imp->itemSpacingSpinbox->setToolTip(NATRON_NAMESPACE::convertFromPlainText(tr("The spacing in pixels to add after the parameter"), NATRON_NAMESPACE::WhiteSpaceNormal));
        rowLayout->addWidget(_imp->itemSpacingSpinbox);
        rowLayout->addStretch();

        _imp->mainLayout->addRow(_imp->layoutTypeLabel, rowContainer);
    }

    {
        QWidget* rowContainer = new QWidget(this);
        QHBoxLayout* rowLayout = new QHBoxLayout(rowContainer);
        rowLayout->setContentsMargins(0, 0, 0, 0);

        QString text = tr("Hidden:");
        QString tooltip = NATRON_NAMESPACE::convertFromPlainText(tr("When checked, the parameter will be hidden from the viewer interface"), NATRON_NAMESPACE::WhiteSpaceNormal);
        _imp->hiddenLabel = new Label(text, this);
        _imp->hiddenCheckbox = new AnimatedCheckBox(rowContainer);
        _imp->hiddenLabel->setToolTip(tooltip);
        _imp->hiddenCheckbox->setToolTip(tooltip);
        _imp->hiddenCheckbox->setChecked(knob->getInViewerContextSecret());
        rowLayout->addWidget(_imp->hiddenCheckbox);
        rowLayout->addStretch();

        _imp->mainLayout->addRow(_imp->hiddenLabel, rowContainer);
    }

   /* if (isButtonKnob) {
        QWidget* rowContainer = new QWidget(this);
        QHBoxLayout* rowLayout = new QHBoxLayout(rowContainer);
        rowLayout->setContentsMargins(0, 0, 0, 0);

        QString text = tr("Add to Shortcut Editor:");
        QString tooltip = GuiUtils::convertFromPlainText(tr("When checked, the parameter can be attributed a shortcut from the Shortcut Editor"), Qt::WhiteSpaceNormal);
        _imp->addToShortcutEditorLabel = new Label(text, this);
        _imp->addToShortcutEditorCheckbox = new AnimatedCheckBox(rowContainer);
        _imp->addToShortcutEditorLabel->setToolTip(tooltip);
        _imp->addToShortcutEditorCheckbox->setToolTip(tooltip);
        _imp->addToShortcutEditorCheckbox->setChecked(knob->getInViewerContextHasShortcut());
        rowLayout->addWidget(_imp->addToShortcutEditorCheckbox);
        rowLayout->addStretch();

        _imp->mainLayout->addRow(_imp->addToShortcutEditorLabel, rowContainer);
    }*/


    QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::StandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel), Qt::Horizontal, this);
    QObject::connect( buttons, SIGNAL(rejected()), this, SLOT(reject()) );
    QObject::connect( buttons, SIGNAL(accepted()), this, SLOT(onOkClicked()) );
    _imp->vLayout->addWidget(buttons);
}
开发者ID:kcotugno,项目名称:Natron,代码行数:101,代码来源:EditNodeViewerContextDialog.cpp


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