Webkit changed location and scale() is gone.
[quassel.git] / src / qtui / webpreviewitem.cpp
index 1d27c96..8dcc401 100644 (file)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2005-09 by the Quassel Project                          *
+ *   Copyright (C) 2005-2014 by the Quassel Project                        *
  *   devel@quassel-irc.org                                                 *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -15,7 +15,7 @@
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
  ***************************************************************************/
 
 #include "webpreviewitem.h"
@@ -24,8 +24,8 @@
 
 #include <QGraphicsProxyWidget>
 #include <QPainter>
-#include <QWebView>
-#include <QWebSettings>
+#include <QtWebKitWidgets/QWebView>
+#include <QtWebKit/QWebSettings>
 
 WebPreviewItem::WebPreviewItem(const QUrl &url)
     : QGraphicsItem(0), // needs to be a top level item as we otherwise cannot guarantee that it's on top of other chatlines
@@ -36,6 +36,7 @@ WebPreviewItem::WebPreviewItem(const QUrl &url)
     QWebView *webView = new QWebView;
     webView->settings()->setAttribute(QWebSettings::JavascriptEnabled, false);
     webView->load(url);
+    webView->setDisabled(true);
     webView->resize(1000, 750);
     QGraphicsProxyWidget *proxyItem = new QGraphicsProxyWidget(this);
     proxyItem->setWidget(webView);
@@ -43,7 +44,7 @@ WebPreviewItem::WebPreviewItem(const QUrl &url)
 
     qreal xScale = (_boundingRect.width() - 2 * frameWidth) / webView->width();
     qreal yScale = (_boundingRect.height() - 2 * frameWidth) / webView->height();
-    proxyItem->scale(xScale, yScale);
+    proxyItem->setTransform(QTransform::fromScale(xScale, yScale), true);
     proxyItem->setPos(frameWidth, frameWidth);
 
     setZValue(30);