本文整理汇总了C++中QQuickItemPrivate::itemNode方法的典型用法代码示例。如果您正苦于以下问题:C++ QQuickItemPrivate::itemNode方法的具体用法?C++ QQuickItemPrivate::itemNode怎么用?C++ QQuickItemPrivate::itemNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QQuickItemPrivate
的用法示例。
在下文中一共展示了QQuickItemPrivate::itemNode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initialize
void QQuickOpacityAnimatorJob::initialize(QQuickAnimatorController *controller)
{
QQuickAnimatorJob::initialize(controller);
QQuickItemPrivate *d = QQuickItemPrivate::get(m_target);
if (d->extra.isAllocated()
&& d->extra->layer
&& d->extra->layer->enabled()) {
d = QQuickItemPrivate::get(d->extra->layer->m_effectSource);
}
m_opacityNode = d->opacityNode();
if (!m_opacityNode) {
m_opacityNode = new QSGOpacityNode();
d->extra.value().opacityNode = m_opacityNode;
QSGNode *child = d->clipNode();
if (!child)
child = d->rootNode();
if (!child)
child = d->groupNode;
if (child) {
if (child->parent())
child->parent()->removeChildNode(child);
m_opacityNode->appendChildNode(child);
}
d->itemNode()->appendChildNode(m_opacityNode);
}
}
示例2: while
QSGNode *QuickSceneGraphModel::currentRootNode() const
{
if (!m_window)
return nullptr;
QQuickItem *item = m_window->contentItem();
QQuickItemPrivate *itemPriv = QQuickItemPrivate::get(item);
QSGNode *root = itemPriv->itemNode();
while (root->parent()) // Ensure that we really get the very root node.
root = root->parent();
return root;
}
示例3: setWindow
void QuickSceneGraphModel::setWindow(QQuickWindow* window)
{
beginResetModel();
clear();
m_window = window;
QQuickItem *item = window->contentItem();
QQuickItemPrivate *itemPriv = QQuickItemPrivate::get(item);
m_rootNode = itemPriv->itemNode();
while(m_rootNode->parent()) // Ensure that we really get the very root node.
m_rootNode = m_rootNode->parent();
updateSGTree();
connect(window, SIGNAL(beforeRendering()), this, SLOT(updateSGTree()));
endResetModel();
}
示例4: updateSGTree
void QuickSceneGraphModel::updateSGTree()
{
QQuickItem *item = m_window->contentItem();
QQuickItemPrivate *itemPriv = QQuickItemPrivate::get(item);
QSGNode *rootNode = itemPriv->itemNode();
while(rootNode->parent()) // Ensure that we really get the very root node.
rootNode = rootNode->parent();
m_oldChildParentMap = m_childParentMap;
m_oldParentChildMap = m_parentChildMap;
m_childParentMap = QHash<QSGNode*, QSGNode*>();
m_parentChildMap = QHash<QSGNode*, QVector<QSGNode*> >();
m_childParentMap[m_rootNode] = 0;
m_parentChildMap[0].append(m_rootNode);
populateFromNode(m_rootNode);
collectItemNodes(m_window->contentItem());
}
示例5:
void QQuickTransformAnimatorJob::Helper::sync()
{
const quint32 mask = QQuickItemPrivate::Position
| QQuickItemPrivate::BasicTransform
| QQuickItemPrivate::TransformOrigin
| QQuickItemPrivate::Size;
QQuickItemPrivate *d = QQuickItemPrivate::get(item);
if (d->extra.isAllocated()
&& d->extra->layer
&& d->extra->layer->enabled()) {
d = QQuickItemPrivate::get(d->extra->layer->m_effectSource);
}
quint32 dirty = mask & d->dirtyAttributes;
if (!wasSynced) {
dirty = 0xffffffffu;
wasSynced = true;
}
if (dirty == 0)
return;
node = d->itemNode();
if (dirty & QQuickItemPrivate::Position) {
dx = item->x();
dy = item->y();
}
if (dirty & QQuickItemPrivate::BasicTransform) {
scale = item->scale();
rotation = item->rotation();
}
if (dirty & (QQuickItemPrivate::TransformOrigin | QQuickItemPrivate::Size)) {
QPointF o = item->transformOriginPoint();
ox = o.x();
oy = o.y();
}
}