summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/previewimage.cpp10
-rw-r--r--src/previewimage.h10
2 files changed, 17 insertions, 3 deletions
diff --git a/src/previewimage.cpp b/src/previewimage.cpp
index ab0a05e6..96b02be7 100644
--- a/src/previewimage.cpp
+++ b/src/previewimage.cpp
@@ -26,6 +26,8 @@
#include "previewimage.h"
#include "previewimage.moc"
+#include "application.h"
+
#include <QFile>
#include <QMovie>
@@ -36,6 +38,7 @@
PreviewImage::PreviewImage(const QString &url, const QString &pos)
: QLabel()
, ws(0)
+ , m_url(url)
{
QString path = KStandardDirs::locateLocal("cache", QString("thumbs/rek") + pos + ".png", true);
@@ -71,3 +74,10 @@ void PreviewImage::setSiteImage()
setPixmap( ws->previewImage() );
}
+
+
+void PreviewImage::mousePressEvent(QMouseEvent *event)
+{
+ Q_UNUSED(event)
+ Application::instance()->loadUrl(m_url);
+} \ No newline at end of file
diff --git a/src/previewimage.h b/src/previewimage.h
index 612d98c6..52698019 100644
--- a/src/previewimage.h
+++ b/src/previewimage.h
@@ -32,7 +32,7 @@
#include <QLabel>
#include <QImage>
-
+#include <QString>
class PreviewImage : public QLabel
{
@@ -45,11 +45,15 @@ public:
public slots:
void setSiteImage();
-
+
+protected:
+ void mousePressEvent(QMouseEvent *event);
+
private:
QPixmap m_pixmap;
-
WebSnap *ws;
+
+ QString m_url;
};
#endif // PREVIEW_IMAGE_H