void ShaderEffectSource::setSourceItem(QDeclarativeItem *item) { if (item == m_sourceItem) return; if (m_sourceItem) { disconnect(m_sourceItem, SIGNAL(widthChanged()), this, SLOT(markSourceSizeDirty())); disconnect(m_sourceItem, SIGNAL(heightChanged()), this, SLOT(markSourceSizeDirty())); if (m_refs) detachSourceItem(); } m_sourceItem = item; if (m_sourceItem) { // Must have some item as parent if (m_sourceItem->parentItem() == 0) m_sourceItem->setParentItem(this); if (m_refs) attachSourceItem(); connect(m_sourceItem, SIGNAL(widthChanged()), this, SLOT(markSourceSizeDirty())); connect(m_sourceItem, SIGNAL(heightChanged()), this, SLOT(markSourceSizeDirty())); } updateSizeAndTexture(); emit sourceItemChanged(); emit repaintRequired(); }
/*! \qmlproperty object MapQuickItem::sourceItem This property holds the source item that will be drawn on the map. */ void QDeclarativeGeoMapQuickItem::setSourceItem(QQuickItem *sourceItem) { if (sourceItem_.data() == sourceItem) return; sourceItem_ = sourceItem; updateMapItem(); emit sourceItemChanged(); }
void QmlAsTexture::setSourceItem(QQuickItem *sourceItem) { if (this->sourceItem != sourceItem) { this->sourceItem = sourceItem; if (this->sourceItem) { this->sourceItem->setParentItem(this); this->sourceItem->setParent(this); this->update(); } emit sourceItemChanged(); } }