本文整理汇总了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);
}
}
示例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();
}
示例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;
}
}