summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNo'am Rosenthal <noam.rosenthal@nokia.com>2009-11-28 17:37:08 -0800
committerNo'am Rosenthal <noam.rosenthal@nokia.com>2009-11-28 17:37:08 -0800
commit112609ea39c694dd6d0279adc8e27d4117d88ed0 (patch)
tree0b069c486b7d99fdaf490914f71c05637f4aeba0
parent1eec369503511779f6204ccff1cbd7010f60e65c (diff)
changed QPixmap to QImage
-rw-r--r--deconstructive/main.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/deconstructive/main.cpp b/deconstructive/main.cpp
index 46ed597..3bed79a 100644
--- a/deconstructive/main.cpp
+++ b/deconstructive/main.cpp
@@ -32,7 +32,7 @@
#include <QBuffer>
#include <QDebug>
#include <QFile>
-
+#include <QImage>
namespace {
class RendererNetworkReply : public QNetworkReply
{
@@ -50,14 +50,14 @@ namespace {
open(ReadOnly|Unbuffered);
setUrl(r.url());
QWebElement element = frame->findFirstElement(selector);
- QPixmap pxm(element.geometry().size());
- pxm.fill(Qt::transparent);
+ QImage img(element.geometry().size(),QImage::Format_ARGB32);
+ img.fill(0);
{
- QPainter painter(&pxm);
+ QPainter painter(&img);
element.render(&painter);
}
buffer.open(QIODevice::WriteOnly);
- pxm.save(&buffer,"png");
+ img.save(&buffer,"png");
buffer.close();
buffer.open(QIODevice::ReadOnly);
QTimer::singleShot(0,this,SIGNAL(readyRead()));