Ejemplo n.º 1
0
QImage QuickItemNodeInstance::renderImage() const
{
    updateDirtyNodesRecursive(quickItem());

    QRectF renderBoundingRect = boundingRect();

    QImage renderImage = designerSupport()->renderImageForItem(quickItem(), renderBoundingRect, renderBoundingRect.size().toSize());

    return renderImage;
}
Ejemplo n.º 2
0
void QuickItemNodeInstance::initialize(const ObjectNodeInstance::Pointer &objectNodeInstance)
{

    if (instanceId() == 0) {
        DesignerSupport::setRootItem(nodeInstanceServer()->quickView(), quickItem());
    } else {
        quickItem()->setParentItem(qobject_cast<QQuickItem*>(nodeInstanceServer()->quickView()->rootObject()));
    }

    if (s_createEffectItem || instanceId() == 0)
        designerSupport()->refFromEffectItem(quickItem());

    ObjectNodeInstance::initialize(objectNodeInstance);
    quickItem()->update();
}
Ejemplo n.º 3
0
QImage QuickItemNodeInstance::renderPreviewImage(const QSize &previewImageSize) const
{
    QRectF previewItemBoundingRect = boundingRect();

    if (previewItemBoundingRect.isValid() && quickItem()) {
        if (quickItem()->isVisible()) {
            return designerSupport()->renderImageForItem(quickItem(), previewItemBoundingRect, previewImageSize);
        } else {
            QImage transparentImage(previewImageSize, QImage::Format_ARGB32_Premultiplied);
            transparentImage.fill(Qt::transparent);
            return transparentImage;
        }
    }

    return QImage();
}
Ejemplo n.º 4
0
GraphicalNodeInstance::~GraphicalNodeInstance()
{
    if (quickItem())
        designerSupport()->derefFromEffectItem(quickItem());
}