summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.qmake.conf2
-rw-r--r--tools/pngdumper/pngdumper.cpp8
2 files changed, 6 insertions, 4 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 661ac1a..bf1b71f 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -1,3 +1,3 @@
load(qt_build_config)
-MODULE_VERSION = 5.1.1
+MODULE_VERSION = 5.1.2
diff --git a/tools/pngdumper/pngdumper.cpp b/tools/pngdumper/pngdumper.cpp
index 8c3d065..75d2780 100644
--- a/tools/pngdumper/pngdumper.cpp
+++ b/tools/pngdumper/pngdumper.cpp
@@ -42,6 +42,7 @@
#include "pngdumper.h"
#include <QtQml/qqml.h>
+#include <QtQuick/QQuickWindow>
ItemCapturer::ItemCapturer(QQuickItem *parent):
QQuickItem(parent)
@@ -54,10 +55,11 @@ ItemCapturer::~ItemCapturer()
void ItemCapturer::grabItem(QQuickItem *item, QString filename)
{
- QImage img = canvas()->grabFrameBuffer();
+ QQuickWindow *w = window();
+ QImage img = w->grabWindow();
while (img.width() * img.height() == 0)
- img = canvas()->grabFrameBuffer();
- QQuickItem *rootItem = canvas()->rootItem();
+ img = w->grabWindow();
+ QQuickItem *rootItem = w->contentItem();
QRectF rectf = rootItem->mapRectFromItem(item, QRectF(0, 0, item->width(), item->height()));
QDir pwd = QDir().dirName();
pwd.mkdir("output");