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


C++ QQmlProperty类代码示例

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


在下文中一共展示了QQmlProperty类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
            }
        }
    }
}
开发者ID:CodeDJ,项目名称:qt5-hidpi,代码行数:32,代码来源:qtquick2.cpp

示例2: HighQualityTextureItem

VideoRendererItem::VideoRendererItem(QQuickItem *parent)
    : HighQualityTextureItem(parent)
    , d(new Data(this))
{
    d->mposd = new MpOsdItem(this);
    d->letterbox = new LetterboxItem(this);
    const QQmlProperty property(d->letterbox, "anchors.centerIn");
    property.write(QVariant::fromValue(this));
    setZ(-1);
    setAcceptHoverEvents(true);
    setAcceptedMouseButtons(Qt::AllButtons);
    setFlag(ItemAcceptsDrops, true);
    connect(d->mposd, &MpOsdItem::targetSizeChanged,
            this, &VideoRendererItem::osdSizeChanged);
}
开发者ID:evsh,项目名称:cmplayer,代码行数:15,代码来源:videorendereritem.cpp

示例3: deleteObjectsInList

void ObjectNodeInstance::deleteObjectsInList(const QQmlProperty &property)
{
    QObjectList objectList;
    QQmlListReference list = qvariant_cast<QQmlListReference>(property.read());

    if (!QmlPrivateGate::hasFullImplementedListInterface(list)) {
        qWarning() << "Property list interface not fully implemented for Class " << property.property().typeName() << " in property " << property.name() << "!";
        return;
    }

    for (int i = 0; i < list.count(); i++) {
        objectList += list.at(i);
    }

    list.clear();
}
开发者ID:qtproject,项目名称:qt-creator,代码行数:16,代码来源:objectnodeinstance.cpp

示例4: HighQualityTextureItem

VideoRenderer::VideoRenderer(QQuickItem *parent)
    : HighQualityTextureItem(parent)
    , d(new Data(this))
{
    d->letterbox = new LetterboxItem(this);
    const QQmlProperty property(d->letterbox, u"anchors.centerIn"_q);
    property.write(QVariant::fromValue(this));
    setZ(-1);
    setAcceptHoverEvents(true);
    setAcceptedMouseButtons(Qt::AllButtons);
    setFlag(ItemAcceptsDrops, true);
    connect(&d->sizeChecker, &QTimer::timeout, [=] () { d->updateOsdSize(); });
    d->sizeChecker.setInterval(300);

    d->measure.setTimer([=]() {
        if (_Change(d->fps, d->measure.get()))
            emit fpsChanged(d->fps);
    }, 100000);
}
开发者ID:manhtukhang,项目名称:cmplayer,代码行数:19,代码来源:videorendereritem.cpp

示例5: Super

VideoRenderer::VideoRenderer(QQuickItem *parent)
    : Super(parent), d(new Data)
{
    d->p = this;
    d->letterbox = new LetterboxItem(this);
    const QQmlProperty property(d->letterbox, u"anchors.centerIn"_q);
    property.write(QVariant::fromValue(this));
    setZ(-1);
    setAcceptHoverEvents(true);
    setAcceptedMouseButtons(Qt::AllButtons);
    setFlag(ItemAcceptsDrops, true);
    connect(&d->sizeChecker, &QTimer::timeout, [this] () {
        if (_Change(d->frame.size, d->fboSizeHint()) |
                _Change(d->osd.size, d->osdSizeHint())) {
            d->redraw = true;
            reserve(UpdateAll);
        }
    });
    d->sizeChecker.setInterval(300);
    d->sizeChecker.setSingleShot(true);
}
开发者ID:darongE,项目名称:bomi,代码行数:21,代码来源:videorenderer.cpp

示例6: 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);
}
开发者ID:qtproject,项目名称:qt-creator,代码行数:24,代码来源:objectnodeinstance.cpp

示例7: handleProperty

/*!
 \internal
 */
void ApplicationSettings::handleProperty(const QQmlProperty& qmlProperty, bool overwrite) {
    // Validate property for this application settings
    if(!qmlProperty.isValid() || qmlProperty.propertyType() == QVariant::Invalid) return;

    // Skip applicationName and fileName
    if(qmlProperty.name() == "applicationName" || qmlProperty.name() == "fileName") return;

    //Don't persist class properties (only user defined ones)
    if(m_existingProperties->contains(qmlProperty.name())) return;

    QVariant v = value(qmlProperty.name());

    // Add notification handler
    QmlPropertyWrapper* wrapper = new QmlPropertyWrapper(qmlProperty);
    m_userProperties->append(wrapper);

    if(!m_initialized) {
        connect(wrapper, SIGNAL(notifySignal(QmlPropertyWrapper*)), this,
                SLOT(qmlPropertyLookup(QmlPropertyWrapper*)));
    }
开发者ID:prplmnky,项目名称:sailfish-widgets,代码行数:23,代码来源:applicationsettings.cpp

示例8: isObject

static bool isObject(const QQmlProperty &property)
{
    return (property.propertyTypeCategory() == QQmlProperty::Object) ||
            //QVariant can also store QObjects. Lets trust our model.
           (QLatin1String(property.propertyTypeName()) == QLatin1String("QVariant"));
}
开发者ID:qtproject,项目名称:qt-creator,代码行数:6,代码来源:objectnodeinstance.cpp

示例9: isList

static bool isList(const QQmlProperty &property)
{
    return property.propertyTypeCategory() == QQmlProperty::List;
}
开发者ID:qtproject,项目名称:qt-creator,代码行数:4,代码来源:objectnodeinstance.cpp

示例10: setTarget

void QQmlBinding::setTarget(const QQmlProperty &prop)
{
    setTarget(prop.object(), QQmlPropertyPrivate::get(prop)->core,
              QQmlPropertyPrivate::get(prop)->context);
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:5,代码来源:qqmlbinding.cpp


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