本文整理汇总了C++中QDeclarativeItemPrivate::addItemChangeListener方法的典型用法代码示例。如果您正苦于以下问题:C++ QDeclarativeItemPrivate::addItemChangeListener方法的具体用法?C++ QDeclarativeItemPrivate::addItemChangeListener怎么用?C++ QDeclarativeItemPrivate::addItemChangeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QDeclarativeItemPrivate
的用法示例。
在下文中一共展示了QDeclarativeItemPrivate::addItemChangeListener方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: watchChanges
void QDeclarativeBasePositionerPrivate::watchChanges(QGraphicsObject *other)
{
if (QGraphicsItemPrivate::get(other)->isDeclarativeItem) {
QDeclarativeItemPrivate *otherPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(other));
otherPrivate->addItemChangeListener(this, watchedChanges);
} else {
Q_Q(QDeclarativeBasePositioner);
QObject::connect(other, SIGNAL(widthChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
QObject::connect(other, SIGNAL(heightChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
QObject::connect(other, SIGNAL(opacityChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
QObject::connect(other, SIGNAL(visibleChanged()), q, SLOT(graphicsWidgetGeometryChanged()));
}
}
示例2: addDepend
void QDeclarativeAnchorsPrivate::addDepend(QGraphicsObject *item)
{
if (!item)
return;
QGraphicsItemPrivate * itemPrivate = QGraphicsItemPrivate::get(item);
if (itemPrivate->isDeclarativeItem) {
QDeclarativeItemPrivate *p =
static_cast<QDeclarativeItemPrivate *>(QGraphicsItemPrivate::get(item));
p->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
} else if(itemPrivate->isWidget) {
Q_Q(QDeclarativeAnchors);
QGraphicsWidget *widget = static_cast<QGraphicsWidget *>(item);
QObject::connect(widget, SIGNAL(destroyed(QObject*)), q, SLOT(_q_widgetDestroyed(QObject*)));
QObject::connect(widget, SIGNAL(geometryChanged()), q, SLOT(_q_widgetGeometryChanged()));
}
}
示例3: initResize
void QDeclarativeLoaderPrivate::initResize()
{
Q_Q(QDeclarativeLoader);
if (QDeclarativeItem *qmlItem = qobject_cast<QDeclarativeItem*>(item)) {
QDeclarativeItemPrivate *p =
static_cast<QDeclarativeItemPrivate *>(QGraphicsItemPrivate::get(qmlItem));
p->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
// We may override the item's size, so we need to remember
// whether the item provided its own valid size.
itemWidthValid = p->widthValid;
itemHeightValid = p->heightValid;
} else if (item && item->isWidget()) {
QGraphicsWidget *widget = static_cast<QGraphicsWidget*>(item);
widget->installEventFilter(q);
}
_q_updateSize();
}
示例4: watchChanges
void QDeclarativeBasePositionerPrivate::watchChanges(QDeclarativeItem *other)
{
QDeclarativeItemPrivate *otherPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(other));
otherPrivate->addItemChangeListener(this, watchedChanges);
}