| Summary: | item.grabToImage() does not work in a KQuickAddons::ConfigModule | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-kdeclarative | Reporter: | Janet Blackquill <uhhadd> |
| Component: | general | Assignee: | Marco Martin <notmart> |
| Status: | RESOLVED UPSTREAM | ||
| Severity: | normal | CC: | kde, kdelibs-bugs-null, nate |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
Looks like a Qt bug. We use QQuickWidget to embed QtQuick into a widget window which uses an offscreen window.
if (!item->window()->isVisible()) {
qmlWarning(item) << "grabToImage: item's window is not visible";
return nullptr;
}
I wonder if using QQuickRenderControl::renderWindowFor(item->window()) instad of item->window() directly here would work
|
Expected behaviour: item.grabToImage() works as expected. Actual behaviour: "QML <ItemType>: grabToImage: item's window is not visible" Example: --- import QtQuick 2.6 import org.kde.kcm 1.2 as KCM KCM.ScrollViewKCM { Rectangle { id: rect width: 50 height: 50 color: "red" MouseArea { anchors.fill: parent onClicked: { rect.grabToImage(function(result) {}) // QML Rectangle: grabToImage: item's window is not visible } } } } ---