1 |
#include "pictureview.h" |
#include "pictureview.h" |
2 |
|
|
3 |
#include <QPainter> |
#include <QPainter> |
4 |
|
#include <QDebug> |
5 |
|
|
6 |
#include "httpwrapper.h" |
#include "httpwrapper.h" |
7 |
|
|
25 |
image = it.value(); |
image = it.value(); |
26 |
this->repaint(); |
this->repaint(); |
27 |
} else { |
} else { |
28 |
QByteArray data = HttpWrapper::getSyncData(source); |
qDebug() << "Loading file " << source; |
29 |
|
|
30 |
QPixmap pixmap; |
QPixmap pixmap; |
31 |
pixmap.loadFromData( data ); |
if (source.at(0) == '/') { //local file |
32 |
|
pixmap = QPixmap(source); |
33 |
|
} else { |
34 |
|
QByteArray data = HttpWrapper::getSyncData(source); |
35 |
|
pixmap.loadFromData( data ); |
36 |
|
} |
37 |
|
|
38 |
QPixmap scaledImage = pixmap.scaledToHeight(size().height(), Qt::SmoothTransformation ); |
QPixmap scaledImage = pixmap.scaledToHeight(size().height(), Qt::SmoothTransformation ); |
39 |
|
|