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


C++ QtVariantProperty::addSubProperty方法代码示例

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


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

示例1: createProperties

void GeneratorSine::createProperties()
{
    QtVariantProperty *pRoot = rootProperty();

    m_pPropFreqScale = propertyManager()->addProperty(QVariant::Double, "Frequency scale");
    m_pPropFreqScale->setAttribute("minimum", 0.01);
    m_pPropFreqScale->setAttribute("maximum", 100.0);
    m_pPropFreqScale->setAttribute("singleStep", 1.0);
    m_pPropFreqScale->setValue(1.0);

    m_pPropAmplitude = propertyManager()->addProperty(QVariant::Double, "Amplitude");
    m_pPropAmplitude->setAttribute("minimum", 0.0);
    m_pPropAmplitude->setAttribute("maximum", 1.0);
    m_pPropAmplitude->setValue(1.0);

    m_pPropPhase = propertyManager()->addProperty(QVariant::Double, "Phase, \302\260");
    m_pPropPhase->setAttribute("minumum", -180.0);
    m_pPropPhase->setAttribute("maximum", 180);
    m_pPropPhase->setValue(0.0);

    pRoot->addSubProperty(m_pPropFreqScale);
    pRoot->addSubProperty(m_pPropAmplitude);
    pRoot->addSubProperty(m_pPropPhase);

    // Property change handler
    QObject::connect (propertyManager(), &QtVariantPropertyManager::propertyChanged, [this](QtProperty *pProperty){
        Q_ASSERT(pProperty);
        setValues();
    });
}
开发者ID:Archie3d,项目名称:qmusic,代码行数:30,代码来源:GeneratorSine.cpp

示例2: createProperties

void Generator::createProperties()
{
    QtVariantProperty *pRoot = rootProperty();

    m_pPropWaveform = propertyManager()->addProperty(QtVariantPropertyManager::enumTypeId(), "Waveform");
    QVariantList list;
    list << "Sine" << "Sawtooth" << "Square" << "Triangle";
    m_pPropWaveform->setAttribute("enumNames", list);
    m_pPropWaveform->setValue(0);

    m_pPropBandPassLimit = propertyManager()->addProperty(QVariant::Bool, "Limit bandpass");
    m_pPropBandPassLimit->setValue(false);

    m_pPropTrigger = propertyManager()->addProperty(QVariant::Bool, "Trigger");
    m_pPropTrigger->setValue(false);
    m_pPropTrigger->setToolTip("Reset generator phase to zero when key is pressed");

    pRoot->addSubProperty(m_pPropWaveform);
    pRoot->addSubProperty(m_pPropBandPassLimit);
    pRoot->addSubProperty(m_pPropTrigger);

    // Properties change handler
    QObject::connect (propertyManager(), &QtVariantPropertyManager::propertyChanged, [this](QtProperty *pProperty){
        Q_UNUSED(pProperty);
        setValues();
    });
}
开发者ID:Archie3d,项目名称:qmusic,代码行数:27,代码来源:Generator.cpp

示例3: createProperties

void StkFreeVerb::createProperties()
{
    QtVariantProperty *pRoot = rootProperty();
    m_pPropRoomSize = propertyManager()->addProperty(QVariant::Double, "Room size");
    setPropertyAttrs(m_pPropRoomSize, 0.0f, 1.0f, 0.1f, 0.5f);

    m_pPropDamping = propertyManager()->addProperty(QVariant::Double, "Damping");
    setPropertyAttrs(m_pPropDamping, 0.0f, 1.0f, 0.1f, 0.4f);

    m_pPropWidth = propertyManager()->addProperty(QVariant::Double, "Left-right mix");
    setPropertyAttrs(m_pPropWidth, 0.0f, 1.0f, 0.1f, 1.0f);

    m_pPropFrozen = propertyManager()->addProperty(QVariant::Bool, "Frozen");
    m_pPropFrozen->setValue(false);

    m_pPropEffectMix = propertyManager()->addProperty(QVariant::Double, "Effect mix");
    setPropertyAttrs(m_pPropEffectMix, 0.0f, 1.0f, 0.1f, 0.75f);

    pRoot->addSubProperty(m_pPropRoomSize);
    pRoot->addSubProperty(m_pPropDamping);
    pRoot->addSubProperty(m_pPropWidth);
    pRoot->addSubProperty(m_pPropFrozen);
    pRoot->addSubProperty(m_pPropEffectMix);

    // Properties change handler
    QObject::connect (propertyManager(), &QtVariantPropertyManager::propertyChanged, [this](QtProperty *pProperty){
        Q_UNUSED(pProperty);
        setValues();
    });
}
开发者ID:Archie3d,项目名称:qmusic,代码行数:30,代码来源:StkFreeVerb.cpp

示例4: createProperties

void MidiIn::createProperties()
{
    QtVariantProperty *pRoot = rootProperty();

    QtVariantProperty *pPropPitchBend = propertyManager()->addProperty(propertyManager()->groupTypeId(), "Pitch bend");

    m_pPropPitchBendSemitones = propertyManager()->addProperty(QVariant::Int, "Semitones");
    m_pPropPitchBendSemitones->setAttribute("minimum", 1);
    m_pPropPitchBendSemitones->setAttribute("maximum", 24);
    m_pPropPitchBendSemitones->setValue(1);

    pPropPitchBend->addSubProperty(m_pPropPitchBendSemitones);
    pRoot->addSubProperty(pPropPitchBend);
}
开发者ID:Archie3d,项目名称:qmusic,代码行数:14,代码来源:MidiIn.cpp

示例5: setupProperties

QtVariantProperty *TreeWidgetEditor::setupPropertyGroup(const QString &title, PropertyDefinition *propDefs)
{
    setupProperties(propDefs);
    QtVariantProperty *groupProp = m_propertyManager->addProperty(QtVariantPropertyManager::groupTypeId(), title);
    foreach (QtVariantProperty *prop, m_rootProperties)
        groupProp->addSubProperty(prop);
    m_rootProperties.clear();
    return groupProp;
}
开发者ID:maxxant,项目名称:qt,代码行数:9,代码来源:treewidgeteditor.cpp

示例6: createProperties

void LHPFilter::createProperties()
{
    QtVariantProperty *pRoot = rootProperty();

    m_pFilterType = propertyManager()->addProperty(QtVariantPropertyManager::enumTypeId(), "Filter type");
    QVariantList list;
    list << "Low-pass" << "High-pass";
    m_pFilterType->setAttribute("enumNames", list);
    m_pFilterType->setValue(0);
    pRoot->addSubProperty(m_pFilterType);

}
开发者ID:Archie3d,项目名称:qmusic,代码行数:12,代码来源:LHPFilter.cpp

示例7: createProperties

void Dial::createProperties()
{
    QtVariantProperty *pRoot = rootProperty();

    m_pPropLabel = propertyManager()->addProperty(QVariant::String, "Label");
    m_pPropLabel->setValue(plugin()->name());

    m_pPropValue = propertyManager()->addProperty(QVariant::Double, "Value");
    m_pPropValue->setValue(0.0);
    m_pPropValue->setAttribute("decimals", 2);
    m_pPropValue->setAttribute("singleStep", 0.1);

    m_pPropMin = propertyManager()->addProperty(QVariant::Double, "Mininum");
    m_pPropMin->setValue(0.0);
    m_pPropMin->setAttribute("decimals", 2);
    m_pPropMin->setAttribute("signleStep", 0.1);


    m_pPropMax = propertyManager()->addProperty(QVariant::Double, "Maximum");
    m_pPropMax->setValue(1.0);
    m_pPropMax->setAttribute("decimals", 2);
    m_pPropMax->setAttribute("signleStep", 0.1);

    m_pPropSteps = propertyManager()->addProperty(QVariant::Int, "Steps");
    m_pPropSteps->setValue(10);
    m_pPropSteps->setAttribute("minimum", 2);

    QObject::connect(propertyManager(), &QtVariantPropertyManager::propertyChanged, [this](QtProperty *pProperty){
        Q_UNUSED(pProperty);
        updateDialValues();
    });

    pRoot->addSubProperty(m_pPropLabel);
    pRoot->addSubProperty(m_pPropValue);
    pRoot->addSubProperty(m_pPropMin);
    pRoot->addSubProperty(m_pPropMax);
    pRoot->addSubProperty(m_pPropSteps);

    updateDialValues();
}
开发者ID:Archie3d,项目名称:qmusic,代码行数:40,代码来源:Dial.cpp

示例8: createProperties

void StkCubic::createProperties()
{
    QtVariantProperty *pRoot = rootProperty();

    QtVariantProperty *pCoefs = propertyManager()->addProperty(propertyManager()->groupTypeId(), "Coefficients");

    m_pPropA1 = propertyManager()->addProperty(QVariant::Double, "A1");
    m_pPropA1->setAttribute("singleStep", 0.0);
    m_pPropA1->setValue(1.0);
    pCoefs->addSubProperty(m_pPropA1);

    m_pPropA2 = propertyManager()->addProperty(QVariant::Double, "A2");
    m_pPropA2->setAttribute("singleStep", 0.0);
    m_pPropA2->setValue(0.0);
    pCoefs->addSubProperty(m_pPropA2);

    m_pPropA3 = propertyManager()->addProperty(QVariant::Double, "A3");
    m_pPropA3->setAttribute("singleStep", 0.0);
    m_pPropA3->setValue(-1.0 / 3.0);
    pCoefs->addSubProperty(m_pPropA3);


    m_pPropThreshold = propertyManager()->addProperty(QVariant::Double, "Threshold");
    m_pPropThreshold->setAttribute("minimum", 0.0);
    m_pPropThreshold->setAttribute("maximum", 1.0);
    m_pPropThreshold->setAttribute("singleStep", 0.1);
    m_pPropThreshold->setValue(0.66);

    pRoot->addSubProperty(pCoefs);
    pRoot->addSubProperty(m_pPropThreshold);

    // Properties change handler
    QObject::connect (propertyManager(), &QtVariantPropertyManager::propertyChanged, [this](QtProperty *pProperty){
        Q_UNUSED(pProperty);
        setValues();
    });
}
开发者ID:Archie3d,项目名称:qmusic,代码行数:37,代码来源:StkCubic.cpp

示例9: setupProperties

 //-----------------------------------------------------------------------
 // Class MacroLinkItem
 //-----------------------------------------------------------------------
 void MacroLinkItem::setupProperties(WndProperties& propWnd) const
 {
   QtVariantPropertyManager& propManager = propWnd.infoPropertyManager();
   QtVariantProperty* item;
   QtVariantProperty* group;
   group = propManager.addProperty(QtVariantPropertyManager::groupTypeId(), QObject::tr("General"));
   item = propManager.addProperty(QVariant::String, QObject::tr("Link type"));
   item->setValue(edge().srcPin().data()->dataRef().staticCast<app::MacroPin>()->getType());
   group->addSubProperty(item);
   group = propManager.addProperty(QtVariantPropertyManager::groupTypeId(), QObject::tr("Source"));
   item = propManager.addProperty(QVariant::String, QObject::tr("Macro"));
   item->setValue(edge().srcPin().data()->vertex().dataRef().staticCast<app::Macro>()->getName());
   group->addSubProperty(item);
   item = propManager.addProperty(QVariant::String, QObject::tr("Output pin"));
   item->setValue(edge().srcPin().data()->dataRef().staticCast<app::MacroPin>()->getName());
   group->addSubProperty(item);
   group = propManager.addProperty(QtVariantPropertyManager::groupTypeId(), QObject::tr("Destination"));
   item = propManager.addProperty(QVariant::String, QObject::tr("Macro"));
   item->setValue(edge().destPin().data()->vertex().dataRef().staticCast<app::Macro>()->getName());
   group->addSubProperty(item);
   item = propManager.addProperty(QVariant::String, QObject::tr("Input pin"));
   item->setValue(edge().destPin().data()->dataRef().staticCast<app::MacroPin>()->getName());
   group->addSubProperty(item);
 }
开发者ID:llibuda,项目名称:impresario,代码行数:27,代码来源:pgeitems.cpp

示例10: createProperties

void ExposedInput::createProperties()
{
    QtVariantProperty *pRoot = rootProperty();
    m_pPropName = propertyManager()->addProperty(QVariant::String, "Name");
    m_pPropName->setValue("input");

    QObject::connect (propertyManager(), &QtVariantPropertyManager::propertyChanged, [this](QtProperty *pProperty){
        // Update text item with the value for the property.
        QtVariantProperty *pV = dynamic_cast<QtVariantProperty*>(pProperty);
        if (pV == m_pPropName) {
            if (m_pNameItem != nullptr) {
                m_pNameItem->setText(pV->valueText() + " ");
            }
        }
    });
    pRoot->addSubProperty(m_pPropName);
}
开发者ID:Archie3d,项目名称:qmusic,代码行数:17,代码来源:ExposedInput.cpp


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