本文整理汇总了C++中QQuickItemPrivate::itemToWindowTransform方法的典型用法代码示例。如果您正苦于以下问题:C++ QQuickItemPrivate::itemToWindowTransform方法的具体用法?C++ QQuickItemPrivate::itemToWindowTransform怎么用?C++ QQuickItemPrivate::itemToWindowTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QQuickItemPrivate
的用法示例。
在下文中一共展示了QQuickItemPrivate::itemToWindowTransform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: renderScene
void QuickInspector::renderScene()
{
if (!m_clientConnected || !m_window)
return;
QImage img;
if (m_window->windowState() != Qt::WindowMinimized)
img = m_window->grabWindow();
if (m_currentItem) {
QQuickItem *parent = m_currentItem->parentItem();
QVariantMap geometryData;
if (parent)
geometryData.insert("itemRect", m_currentItem->parentItem()->mapRectToScene(QRectF(m_currentItem->x(), m_currentItem->y(), m_currentItem->width(), m_currentItem->height())));
else
geometryData.insert("itemRect", QRectF(0, 0, m_currentItem->width(), m_currentItem->height()));
geometryData.insert("boundingRect", m_currentItem->mapRectToScene(m_currentItem->boundingRect()));
geometryData.insert("childrenRect", m_currentItem->mapRectToScene(m_currentItem->childrenRect()));
geometryData.insert("transformOriginPoint", m_currentItem->mapToScene(m_currentItem->transformOriginPoint()));
#ifdef HAVE_SG_INSPECTOR
QQuickAnchors *anchors = m_currentItem->property("anchors").value<QQuickAnchors*>();
if (anchors) {
QQuickAnchors::Anchors usedAnchors = anchors->usedAnchors();
geometryData.insert("left", (bool)(usedAnchors & QQuickAnchors::LeftAnchor) || anchors->fill());
geometryData.insert("right", (bool)(usedAnchors & QQuickAnchors::RightAnchor) || anchors->fill());
geometryData.insert("top", (bool)(usedAnchors & QQuickAnchors::TopAnchor) || anchors->fill());
geometryData.insert("bottom", (bool)(usedAnchors & QQuickAnchors::BottomAnchor) || anchors->fill());
geometryData.insert("baseline", (bool)(usedAnchors & QQuickAnchors::BaselineAnchor));
geometryData.insert("horizontalCenter", (bool)(usedAnchors & QQuickAnchors::HCenterAnchor) || anchors->centerIn());
geometryData.insert("verticalCenter", (bool)(usedAnchors & QQuickAnchors::VCenterAnchor) || anchors->centerIn());
geometryData.insert("leftMargin", anchors->leftMargin());
geometryData.insert("rightMargin", anchors->rightMargin());
geometryData.insert("topMargin", anchors->topMargin());
geometryData.insert("bottomMargin", anchors->bottomMargin());
geometryData.insert("horizontalCenterOffset", anchors->horizontalCenterOffset());
geometryData.insert("verticalCenterOffset", anchors->verticalCenterOffset());
geometryData.insert("baselineOffset", anchors->baselineOffset());
geometryData.insert("margins", anchors->margins());
}
#endif
geometryData.insert("x", m_currentItem->x());
geometryData.insert("y", m_currentItem->y());
#ifdef HAVE_SG_INSPECTOR
QQuickItemPrivate *itemPriv = QQuickItemPrivate::get(m_currentItem);
geometryData.insert("transform", itemPriv->itemToWindowTransform());
if (parent) {
QQuickItemPrivate *parentPriv = QQuickItemPrivate::get(parent);
geometryData.insert("parentTransform", parentPriv->itemToWindowTransform());
}
#endif
emit sceneRendered(img, geometryData);
} else {
emit sceneRendered(img, QVariantMap());
}
}