本文整理汇总了C++中propertyName函数的典型用法代码示例。如果您正苦于以下问题:C++ propertyName函数的具体用法?C++ propertyName怎么用?C++ propertyName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了propertyName函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: Q_D
QAbstractAnimationJob *QQuickAnimator::transition(QQuickStateActions &actions,
QQmlProperties &modified,
TransitionDirection direction,
QObject *defaultTarget)
{
Q_D(QQuickAnimator);
if (d->defaultProperty.isValid() && propertyName() != d->defaultProperty.name()) {
qDebug() << Q_FUNC_INFO << "property name conflict...";
return 0;
}
// The animation system cannot handle backwards uncontrolled animations.
if (direction == Backward)
return 0;
QQuickAnimatorJob *job = createJob();
if (!job)
return 0;
d->apply(job, propertyName(), actions, modified, defaultTarget);
if (!job->target()) {
delete job;
return 0;
}
return job;
}
开发者ID:2gis,项目名称:2gisqt5android,代码行数:29,代码来源:qquickanimator.cpp
示例2: switch
void ChannelMapper::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e)
{
switch (e->type()) {
case Qt3DCore::PropertyValueAdded: {
const auto change = qSharedPointerCast<Qt3DCore::QPropertyNodeAddedChange>(e);
if (change->propertyName() == QByteArrayLiteral("mappings")) {
m_mappingIds.push_back(change->addedNodeId());
setDirty(Handler::ChannelMappingsDirty);
m_isDirty = true;
}
break;
}
case Qt3DCore::PropertyValueRemoved: {
const auto change = qSharedPointerCast<Qt3DCore::QPropertyNodeRemovedChange>(e);
if (change->propertyName() == QByteArrayLiteral("mappings")) {
m_mappingIds.removeOne(change->removedNodeId());
setDirty(Handler::ChannelMappingsDirty);
m_isDirty = true;
}
break;
}
default:
break;
}
QBackendNode::sceneChangeEvent(e);
}
开发者ID:RSATom,项目名称:Qt,代码行数:28,代码来源:channelmapper.cpp
示例3: foreach
void CPropertyCommand::undo()
{
if(oldValue().isValid() && !propertyName().isEmpty())
{
foreach (QObject * object, fobjects)
object->setProperty(qPrintable(propertyName()),oldValue());
}
}
开发者ID:exat500g,项目名称:winbug,代码行数:8,代码来源:cpropertycommand.cpp
示例4: beginChangeValue
void EnumPropItem::slotEnumChanged(const QString &text)
{
if ( nameByType(object()->property(propertyName().toLatin1()).toInt())!=text){
beginChangeValue();
setPropertyValue(typeByName(text));
setValueToObject(propertyName(),typeByName(text));
endChangeValue();
}
}
开发者ID:fralx,项目名称:LimeReport,代码行数:9,代码来源:lrenumpropitem.cpp
示例5: object
void FontAttribPropItem::setModelData(QWidget *propertyEditor , QAbstractItemModel *model, const QModelIndex &index)
{
model->setData(index,qobject_cast<CheckBoxEditor*>(propertyEditor)->isChecked());
QFont font = object()->property(parent()->propertyName().toLatin1()).value<QFont>();
if (propertyName()=="bold"){
font.setBold(propertyValue().toBool());
}
if (propertyName()=="italic"){
font.setItalic(propertyValue().toBool());
}
if (propertyName()=="underline"){
font.setUnderline(propertyValue().toBool());
}
setValueToObject(parent()->propertyName(),font);
}
开发者ID:fralx,项目名称:LimeReport,代码行数:15,代码来源:lrfontpropitem.cpp
示例6: checkSensitivityUpdate
void checkSensitivityUpdate()
{
// GIVEN
TestArbiter arbiter;
Qt3DInput::QMouseDevice mouseDevice;
arbiter.setArbiterOnNode(&mouseDevice);
{
// WHEN
mouseDevice.setSensitivity(0.7f);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 1);
auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>();
QCOMPARE(change->propertyName(), "sensitivity");
QCOMPARE(change->value().value<float>(), mouseDevice.sensitivity());
QCOMPARE(change->type(), Qt3DCore::PropertyUpdated);
arbiter.events.clear();
}
{
// WHEN
mouseDevice.setSensitivity(0.7f);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 0);
}
}
开发者ID:RSATom,项目名称:Qt,代码行数:32,代码来源:tst_qmousedevice.cpp
示例7: checkEndClipUpdate
void checkEndClipUpdate()
{
// GIVEN
TestArbiter arbiter;
Qt3DAnimation::QLerpClipBlend lerpBlend;
arbiter.setArbiterOnNode(&lerpBlend);
auto endClip = new Qt3DAnimation::QLerpClipBlend();
{
// WHEN
lerpBlend.setEndClip(endClip);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 1);
auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>();
QCOMPARE(change->propertyName(), "endClip");
QCOMPARE(change->value().value<Qt3DCore::QNodeId>(), lerpBlend.endClip()->id());
QCOMPARE(change->type(), Qt3DCore::PropertyUpdated);
arbiter.events.clear();
}
{
// WHEN
lerpBlend.setEndClip(endClip);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 0);
}
}
开发者ID:RSATom,项目名称:Qt,代码行数:32,代码来源:tst_qlerpclipblend.cpp
示例8: checkLoopsUpdate
void checkLoopsUpdate()
{
// GIVEN
TestArbiter arbiter;
Qt3DAnimation::QBlendedClipAnimator blendedClipAnimator;
arbiter.setArbiterOnNode(&blendedClipAnimator);
{
// WHEN
blendedClipAnimator.setLoopCount(1584);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 1);
auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>();
QCOMPARE(change->propertyName(), "loops");
QCOMPARE(change->value().value<int>(), blendedClipAnimator.loopCount());
QCOMPARE(change->type(), Qt3DCore::PropertyUpdated);
arbiter.events.clear();
}
{
// WHEN
blendedClipAnimator.setLoopCount(1584);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 0);
}
}
开发者ID:RSATom,项目名称:Qt,代码行数:32,代码来源:tst_qblendedclipanimator.cpp
示例9: checkRunningUpdate
void checkRunningUpdate()
{
// GIVEN
TestArbiter arbiter;
Qt3DAnimation::QBlendedClipAnimator blendedClipAnimator;
arbiter.setArbiterOnNode(&blendedClipAnimator);
{
// WHEN
blendedClipAnimator.setRunning(true);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 1);
auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>();
QCOMPARE(change->propertyName(), "running");
QCOMPARE(change->value().value<bool>(), blendedClipAnimator.isRunning());
QCOMPARE(change->type(), Qt3DCore::PropertyUpdated);
arbiter.events.clear();
}
{
// WHEN
blendedClipAnimator.setRunning(true);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 0);
}
}
开发者ID:RSATom,项目名称:Qt,代码行数:32,代码来源:tst_qblendedclipanimator.cpp
示例10: checkChannelMapperUpdate
void checkChannelMapperUpdate()
{
// GIVEN
TestArbiter arbiter;
Qt3DAnimation::QBlendedClipAnimator blendedClipAnimator;
arbiter.setArbiterOnNode(&blendedClipAnimator);
Qt3DAnimation::QChannelMapper channelMapper;
{
// WHEN
blendedClipAnimator.setChannelMapper(&channelMapper);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 1);
auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>();
QCOMPARE(change->propertyName(), "channelMapper");
QCOMPARE(change->value().value<Qt3DCore::QNodeId>(), channelMapper.id());
QCOMPARE(change->type(), Qt3DCore::PropertyUpdated);
arbiter.events.clear();
}
{
// WHEN
blendedClipAnimator.setChannelMapper(&channelMapper);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 0);
}
}
开发者ID:RSATom,项目名称:Qt,代码行数:33,代码来源:tst_qblendedclipanimator.cpp
示例11: checkBlendTreeUpdate
void checkBlendTreeUpdate()
{
// GIVEN
TestArbiter arbiter;
Qt3DAnimation::QBlendedClipAnimator blendedClipAnimator;
arbiter.setArbiterOnNode(&blendedClipAnimator);
Qt3DAnimation::QLerpClipBlend blendRoot;
{
// WHEN
blendedClipAnimator.setBlendTree(&blendRoot);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 1);
auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>();
QCOMPARE(change->propertyName(), "blendTree");
QCOMPARE(change->value().value<Qt3DCore::QNodeId>(), blendRoot.id());
QCOMPARE(change->type(), Qt3DCore::PropertyUpdated);
arbiter.events.clear();
}
{
// WHEN
blendedClipAnimator.setBlendTree(&blendRoot);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 0);
}
}
开发者ID:RSATom,项目名称:Qt,代码行数:33,代码来源:tst_qblendedclipanimator.cpp
示例12: layoutPropertyType
bool LayoutPropertySheet::reset(int index)
{
int left, top, right, bottom;
m_layout->getContentsMargins(&left, &top, &right, &bottom);
const LayoutPropertyType type = layoutPropertyType(propertyName(index));
bool rc = true;
switch (type) {
case LayoutPropertyLeftMargin:
m_layout->setContentsMargins(-1, top, right, bottom);
break;
case LayoutPropertyTopMargin:
m_layout->setContentsMargins(left, -1, right, bottom);
break;
case LayoutPropertyRightMargin:
m_layout->setContentsMargins(left, top, -1, bottom);
break;
case LayoutPropertyBottomMargin:
m_layout->setContentsMargins(left, top, right, -1);
break;
default:
rc = QDesignerPropertySheet::reset(index);
break;
}
return rc;
}
开发者ID:FilipBE,项目名称:qtextended,代码行数:25,代码来源:layout_propertysheet.cpp
示例13: createPropertyEditorValue
void createPropertyEditorValue(const QmlObjectNode &fxObjectNode, const QString &name, const QVariant &value, QDeclarativePropertyMap *propertyMap, PropertyEditor *propertyEditor)
{
QString propertyName(name);
propertyName.replace(QLatin1Char('.'), QLatin1Char('_'));
PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(variantToQObject(propertyMap->value(propertyName)));
if (!valueObject) {
valueObject = new PropertyEditorValue(propertyMap);
QObject::connect(valueObject, SIGNAL(valueChanged(QString,QVariant)), propertyMap, SIGNAL(valueChanged(QString,QVariant)));
QObject::connect(valueObject, SIGNAL(expressionChanged(QString)), propertyEditor, SLOT(changeExpression(QString)));
propertyMap->insert(propertyName, QVariant::fromValue(valueObject));
}
valueObject->setName(name);
valueObject->setModelNode(fxObjectNode);
if (fxObjectNode.propertyAffectedByCurrentState(name) && !(fxObjectNode.modelNode().property(name).isBindingProperty())) {
valueObject->setValue(fxObjectNode.modelValue(name));
} else {
valueObject->setValue(value);
}
if (propertyName != QLatin1String("id") &&
fxObjectNode.currentState().isBaseState() &&
fxObjectNode.modelNode().property(propertyName).isBindingProperty()) {
valueObject->setExpression(fxObjectNode.modelNode().bindingProperty(propertyName).expression());
} else {
valueObject->setExpression(fxObjectNode.instanceValue(name).toString());
}
}
开发者ID:CNOT,项目名称:julia-studio,代码行数:29,代码来源:propertyeditor.cpp
示例14: checkFaceUpdate
void checkFaceUpdate()
{
// GIVEN
TestArbiter arbiter;
FakeTextureImage abstractTextureImage;
arbiter.setArbiterOnNode(&abstractTextureImage);
{
// WHEN
abstractTextureImage.setFace(Qt3DRender::QAbstractTexture::CubeMapPositiveY);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 1);
auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>();
QCOMPARE(change->propertyName(), "face");
QCOMPARE(change->value().value<Qt3DRender::QAbstractTexture::CubeMapFace>(), abstractTextureImage.face());
QCOMPARE(change->type(), Qt3DCore::PropertyUpdated);
arbiter.events.clear();
}
{
// WHEN
abstractTextureImage.setFace(Qt3DRender::QAbstractTexture::CubeMapPositiveY);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 0);
}
}
开发者ID:RSATom,项目名称:Qt,代码行数:32,代码来源:tst_qabstracttextureimage.cpp
示例15: checkLayerUpdate
void checkLayerUpdate()
{
// GIVEN
TestArbiter arbiter;
FakeTextureImage abstractTextureImage;
arbiter.setArbiterOnNode(&abstractTextureImage);
{
// WHEN
abstractTextureImage.setLayer(12);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 1);
auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>();
QCOMPARE(change->propertyName(), "layer");
QCOMPARE(change->value().value<int>(), abstractTextureImage.layer());
QCOMPARE(change->type(), Qt3DCore::PropertyUpdated);
arbiter.events.clear();
}
{
// WHEN
abstractTextureImage.setLayer(12);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 0);
}
}
开发者ID:RSATom,项目名称:Qt,代码行数:32,代码来源:tst_qabstracttextureimage.cpp
示例16: getTarget
bool Properties::operator==( const qps::Properties& right ) const
{
if ( getTarget() == nullptr ||
right.getTarget() == nullptr )
return false;
if ( getTarget() == right.getTarget() )
return true;
if ( getHiddenStaticPropertiesCount() != right.getHiddenStaticPropertiesCount() )
return false; // Fast exit
int pCount = getTarget()->metaObject( )->propertyCount( );
for ( int i = getHiddenStaticPropertiesCount(); i < pCount; ++i ) {
QMetaProperty metaProperty = getTarget()->metaObject( )->property( i );
QString propertyName( metaProperty.name( ) );
if ( !right.hasProperty( propertyName ) )
return false;
QVariant propertyValue = getTarget()->property( propertyName.toLatin1() );
QVariant rightPropertyValue = right.getProperty( propertyName );
if ( propertyValue != rightPropertyValue )
return false;
}
QList< QByteArray > dynamicProperties = getTarget()->dynamicPropertyNames( );
for ( int d = 0; d < dynamicProperties.size( ); d++ ) {
QString propertyName = dynamicProperties.at( d );
if ( !right.hasProperty( propertyName ) )
return false;
QVariant propertyValue = getTarget()->property( propertyName.toLatin1( ) );
if ( propertyValue != right.getProperty( propertyName ) )
return false;
}
return true;
}
开发者ID:cneben,项目名称:QuickProperties,代码行数:33,代码来源:qpsProperties.cpp
示例17: checkBlendFactorUpdate
void checkBlendFactorUpdate()
{
// GIVEN
TestArbiter arbiter;
Qt3DAnimation::QLerpClipBlend lerpBlend;
arbiter.setArbiterOnNode(&lerpBlend);
{
// WHEN
lerpBlend.setBlendFactor(0.4f);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 1);
auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>();
QCOMPARE(change->propertyName(), "blendFactor");
QCOMPARE(change->value().value<float>(), lerpBlend.blendFactor());
QCOMPARE(change->type(), Qt3DCore::PropertyUpdated);
arbiter.events.clear();
}
{
// WHEN
lerpBlend.setBlendFactor(0.4f);
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 0);
}
}
开发者ID:RSATom,项目名称:Qt,代码行数:32,代码来源:tst_qlerpclipblend.cpp
示例18: checkSourceUpdate
void checkSourceUpdate()
{
// GIVEN
TestArbiter arbiter;
Qt3DAnimation::QAnimationClipLoader clip;
arbiter.setArbiterOnNode(&clip);
{
// WHEN
clip.setSource(QUrl(QStringLiteral("qrc:/toyplane.qlip")));
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 1);
auto change = arbiter.events.first().staticCast<Qt3DCore::QPropertyUpdatedChange>();
QCOMPARE(change->propertyName(), "source");
QCOMPARE(change->type(), Qt3DCore::PropertyUpdated);
arbiter.events.clear();
}
{
// WHEN
clip.setSource(QStringLiteral("qrc:/toyplane.qlip"));
QCoreApplication::processEvents();
// THEN
QCOMPARE(arbiter.events.size(), 0);
}
}
开发者ID:RSATom,项目名称:Qt,代码行数:31,代码来源:tst_qanimationcliploader.cpp
示例19: propertyName
void PropertyEditorQmlBackend::createPropertyEditorValue(const QmlObjectNode &qmlObjectNode,
const PropertyName &name,
const QVariant &value,
PropertyEditorView *propertyEditor)
{
PropertyName propertyName(name);
propertyName.replace('.', '_');
PropertyEditorValue *valueObject = qobject_cast<PropertyEditorValue*>(variantToQObject(backendValuesPropertyMap().value(propertyName)));
if (!valueObject) {
valueObject = new PropertyEditorValue(&backendValuesPropertyMap());
QObject::connect(valueObject, SIGNAL(valueChanged(QString,QVariant)), &backendValuesPropertyMap(), SIGNAL(valueChanged(QString,QVariant)));
QObject::connect(valueObject, SIGNAL(expressionChanged(QString)), propertyEditor, SLOT(changeExpression(QString)));
backendValuesPropertyMap().insert(QString::fromUtf8(propertyName), QVariant::fromValue(valueObject));
}
valueObject->setName(name);
valueObject->setModelNode(qmlObjectNode);
if (qmlObjectNode.propertyAffectedByCurrentState(name) && !(qmlObjectNode.modelNode().property(name).isBindingProperty()))
valueObject->setValue(qmlObjectNode.modelValue(name));
else
valueObject->setValue(value);
if (propertyName != "id" &&
qmlObjectNode.currentState().isBaseState() &&
qmlObjectNode.modelNode().property(propertyName).isBindingProperty()) {
valueObject->setExpression(qmlObjectNode.modelNode().bindingProperty(propertyName).expression());
} else {
valueObject->setExpression(qmlObjectNode.instanceValue(name).toString());
}
}
开发者ID:zhongxingzhi,项目名称:qtcreator,代码行数:31,代码来源:propertyeditorqmlbackend.cpp
示例20: layoutPropertyType
QVariant LayoutPropertySheet::property(int index) const
{
const LayoutPropertyType type = layoutPropertyType(propertyName(index));
if (const QLayoutWidget *lw = qobject_cast<QLayoutWidget *>(m_layout->parent())) {
switch (type) {
case LayoutPropertyLeftMargin:
return lw->layoutLeftMargin();
case LayoutPropertyTopMargin:
return lw->layoutTopMargin();
case LayoutPropertyRightMargin:
return lw->layoutRightMargin();
case LayoutPropertyBottomMargin:
return lw->layoutBottomMargin();
default:
break;
}
}
switch (type) {
case LayoutPropertyLeftMargin:
case LayoutPropertyTopMargin:
case LayoutPropertyRightMargin:
case LayoutPropertyBottomMargin:
return getLayoutMargin(m_layout, type);
case LayoutPropertyHorizontalSpacing:
if (const QGridLayout *grid = qobject_cast<QGridLayout *>(m_layout))
return grid->horizontalSpacing();
if (const QFormLayout *form = qobject_cast<QFormLayout *>(m_layout))
return form->horizontalSpacing();
break;
case LayoutPropertyVerticalSpacing:
if (const QGridLayout *grid = qobject_cast<QGridLayout *>(m_layout))
return grid->verticalSpacing();
if (const QFormLayout *form = qobject_cast<QFormLayout *>(m_layout))
return form->verticalSpacing();
case LayoutPropertyBoxStretch:
if (const QBoxLayout *box = qobject_cast<QBoxLayout *>(m_layout))
return QVariant(QByteArray(QFormBuilderExtra::boxLayoutStretch(box).toUtf8()));
break;
case LayoutPropertyGridRowStretch:
if (const QGridLayout *grid = qobject_cast<QGridLayout *>(m_layout))
return QVariant(QByteArray(QFormBuilderExtra::gridLayoutRowStretch(grid).toUtf8()));
break;
case LayoutPropertyGridColumnStretch:
if (const QGridLayout *grid = qobject_cast<QGridLayout *>(m_layout))
return QVariant(QByteArray(QFormBuilderExtra::gridLayoutColumnStretch(grid).toUtf8()));
break;
case LayoutPropertyGridRowMinimumHeight:
if (const QGridLayout *grid = qobject_cast<QGridLayout *>(m_layout))
return QVariant(QByteArray(QFormBuilderExtra::gridLayoutRowMinimumHeight(grid).toUtf8()));
break;
case LayoutPropertyGridColumnMinimumWidth:
if (const QGridLayout *grid = qobject_cast<QGridLayout *>(m_layout))
return QVariant(QByteArray(QFormBuilderExtra::gridLayoutColumnMinimumWidth(grid).toUtf8()));
break;
default:
break;
}
return QDesignerPropertySheet::property(index);
}
开发者ID:Fale,项目名称:qtmoko,代码行数:59,代码来源:layout_propertysheet.cpp
注:本文中的propertyName函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论