本文整理汇总了C++中QQmlProperty::object方法的典型用法代码示例。如果您正苦于以下问题:C++ QQmlProperty::object方法的具体用法?C++ QQmlProperty::object怎么用?C++ QQmlProperty::object使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QQmlProperty
的用法示例。
在下文中一共展示了QQmlProperty::object方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: foreach
void QQmlQtQuick2DebugStatesDelegate::updateBinding(QQmlContext *context,
const QQmlProperty &property,
const QVariant &expression, bool isLiteralValue,
const QString &fileName, int line, int column,
bool *inBaseState)
{
typedef QPointer<QQuickState> QuickStatePointer;
QObject *object = property.object();
QString propertyName = property.name();
foreach (const QuickStatePointer& statePointer, m_allStates) {
if (QQuickState *state = statePointer.data()) {
// here we assume that the revert list on itself defines the base state
if (state->isStateActive() && state->containsPropertyInRevertList(object, propertyName)) {
*inBaseState = false;
QQmlBinding *newBinding = 0;
if (!isLiteralValue) {
newBinding = new QQmlBinding(expression.toString(), object,
QQmlContextData::get(context), fileName,
line, column);
newBinding->setTarget(property);
newBinding->setNotifyOnValueChanged(true);
}
state->changeBindingInRevertList(object, propertyName, newBinding);
if (isLiteralValue)
state->changeValueInRevertList(object, propertyName, expression);
}
}
}
}
示例2: removeObjectFromList
static void removeObjectFromList(const QQmlProperty &property, QObject *objectToBeRemoved, QQmlEngine * engine)
{
QQmlListReference listReference(property.object(), property.name().toUtf8(), engine);
if (!QmlPrivateGate::hasFullImplementedListInterface(listReference)) {
qWarning() << "Property list interface not fully implemented for Class " << property.property().typeName() << " in property " << property.name() << "!";
return;
}
int count = listReference.count();
QObjectList objectList;
for (int i = 0; i < count; i ++) {
QObject *listItem = listReference.at(i);
if (listItem && listItem != objectToBeRemoved)
objectList.append(listItem);
}
listReference.clear();
foreach (QObject *object, objectList)
listReference.append(object);
}
示例3: setTarget
void QQmlBinding::setTarget(const QQmlProperty &prop)
{
setTarget(prop.object(), QQmlPropertyPrivate::get(prop)->core,
QQmlPropertyPrivate::get(prop)->context);
}