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


C++ QQuickItemPrivate::removeItemChangeListener方法代码示例

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


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

示例1:

QQuickLoader::~QQuickLoader()
{
    Q_D(QQuickLoader);
    if (d->item) {
        QQuickItemPrivate *p = QQuickItemPrivate::get(d->item);
        p->removeItemChangeListener(d, watchedChanges);
    }
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:8,代码来源:qquickloader.cpp

示例2: setActive

void QQuickLoader::setActive(bool newVal)
{
    Q_D(QQuickLoader);
    if (d->active == newVal)
        return;

    d->active = newVal;
    if (newVal == true) {
        if (d->loadingFromSource) {
            loadFromSource();
        } else {
            loadFromSourceComponent();
        }
    } else {
        // cancel any current incubation
        if (d->incubator) {
            d->incubator->clear();
            delete d->itemContext;
            d->itemContext = 0;
        }

        if (d->item) {
            QQuickItemPrivate *p = QQuickItemPrivate::get(d->item);
            p->removeItemChangeListener(d, watchedChanges);

            // We can't delete immediately because our item may have triggered
            // the Loader to load a different item.
            d->item->setParentItem(0);
            d->item->setVisible(false);
            d->item = 0;
        }
        if (d->object) {
            d->object->deleteLater();
            d->object = 0;
            emit itemChanged();
        }
        emit statusChanged();
    }
    emit activeChanged();
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:40,代码来源:qquickloader.cpp

示例3: clear

void QQuickLoaderPrivate::clear()
{
    Q_Q(QQuickLoader);
    disposeInitialPropertyValues();

    if (incubator)
        incubator->clear();

    delete itemContext;
    itemContext = 0;

    if (loadingFromSource && component) {
        // disconnect since we deleteLater
        QObject::disconnect(component, SIGNAL(statusChanged(QQmlComponent::Status)),
                q, SLOT(_q_sourceLoaded()));
        QObject::disconnect(component, SIGNAL(progressChanged(qreal)),
                q, SIGNAL(progressChanged()));
        component->deleteLater();
        component = 0;
    }
    componentStrongReference.clear();
    source = QUrl();

    if (item) {
        QQuickItemPrivate *p = QQuickItemPrivate::get(item);
        p->removeItemChangeListener(this, watchedChanges);

        // We can't delete immediately because our item may have triggered
        // the Loader to load a different item.
        item->setParentItem(0);
        item->setVisible(false);
        item = 0;
    }
    if (object) {
        object->deleteLater();
        object = 0;
    }
}
开发者ID:Drakey83,项目名称:steamlink-sdk,代码行数:38,代码来源:qquickloader.cpp


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