From 9d4e840a6e1a7169a2863fa1ff1812f8fe19e615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Tue, 25 Feb 2014 01:21:46 +0100 Subject: Screenshots: Optimize image loading and memory use, fix list and button layout. --- logic/screenshots/Screenshot.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 logic/screenshots/Screenshot.cpp (limited to 'logic/screenshots/Screenshot.cpp') diff --git a/logic/screenshots/Screenshot.cpp b/logic/screenshots/Screenshot.cpp new file mode 100644 index 00000000..882e491f --- /dev/null +++ b/logic/screenshots/Screenshot.cpp @@ -0,0 +1,14 @@ +#include "Screenshot.h" +#include +#include +QIcon ScreenShot::getImage() +{ + if(!imageloaded) + { + QImage image(file); + QImage thumbnail = image.scaledToWidth(256, Qt::SmoothTransformation); + m_image = QIcon(QPixmap::fromImage(thumbnail)); + imageloaded = true; + } + return m_image; +} -- cgit v1.2.3