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


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

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


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

示例1: QDialog

EditNodeViewerContextDialog::EditNodeViewerContextDialog(const KnobIPtr& knob, QWidget* parent)
: QDialog(parent)
, _imp(new EditNodeViewerContextDialogPrivate(knob))
{

    setWindowTitle(tr("Edit %1 viewer interface").arg(QString::fromUtf8(knob->getName().c_str())));

    _imp->vLayout = new QVBoxLayout(this);
    _imp->vLayout->setContentsMargins(0, 0, TO_DPIX(15), 0);

    _imp->mainContainer = new QWidget(this);
    _imp->mainLayout = new QFormLayout(_imp->mainContainer);
    _imp->mainLayout->setLabelAlignment(Qt::AlignVCenter | Qt::AlignRight);
    _imp->mainLayout->setFormAlignment(Qt::AlignVCenter | Qt::AlignLeft);
    _imp->mainLayout->setSpacing(TO_DPIX(3));
    _imp->mainLayout->setContentsMargins(0, 0, TO_DPIX(15), 0);

    _imp->vLayout->addWidget(_imp->mainContainer);

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

        _imp->viewerUILabelLabel = new Label(tr("Viewer Interface Label:"), this);
        _imp->viewerUILabelEdit = new LineEdit(rowContainer);
        QString labelTooltip = NATRON_NAMESPACE::convertFromPlainText(tr("The text label of the parameter that will appear in its viewer interface"), NATRON_NAMESPACE::WhiteSpaceNormal);
        _imp->viewerUILabelEdit->setToolTip(labelTooltip);
        _imp->viewerUILabelLabel->setToolTip(labelTooltip);

        if (knob) {
            _imp->viewerUILabelEdit->setText( QString::fromUtf8( knob->getInViewerContextLabel().c_str() ) );
        }
        rowLayout->addWidget(_imp->viewerUILabelEdit);
        rowLayout->addStretch();

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

    KnobButtonPtr isButtonKnob = toKnobButton(knob);

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

        QString text;
        if (isButtonKnob) {
            text = tr("Button Checked Icon:");
        } else {
            text = tr("Icon label:");
        }
        QString tooltip;
        if (isButtonKnob) {
            tooltip = NATRON_NAMESPACE::convertFromPlainText(tr("The icon of the button when checked"), NATRON_NAMESPACE::WhiteSpaceNormal);
        } else {
            tooltip = NATRON_NAMESPACE::convertFromPlainText(tr("This icon will be used instead of the text label"), NATRON_NAMESPACE::WhiteSpaceNormal);
        }
        _imp->checkedIconLabel = new Label(text, this);
        _imp->checkedIconLineEdit = new LineEdit(rowContainer);
        _imp->checkedIconLineEdit->setToolTip(tooltip);
        _imp->checkedIconLabel->setToolTip(tooltip);

        _imp->checkedIconLineEdit->setText( QString::fromUtf8( knob->getInViewerContextIconFilePath(true).c_str() ) );

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

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

    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);

//.........这里部分代码省略.........
开发者ID:kcotugno,项目名称:Natron,代码行数:101,代码来源:EditNodeViewerContextDialog.cpp


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